Brace expansion
A metabolic network often contains several similar reactions which differ only by similar metabolites.
This is often the case when an enzyme or transporter can convert several similar metabolites.
To avoid typing one entry for each reaction, can be used.
This will be explained in the following.
Lets consider the creation of dessert from fruits as a chemical reaction.
The reactant are apple or pear, respectively, and the product is dessert.
apple => dessert
pear => dessert
To avoid typing two reactions, they can be coded by one single line in one dataset.
{ apple pear } => dessert
This line expands to the two lines above.
This can be tested using the pull down menu of the dataset.
There is a menu-item to list all generated reactions.
Brace expansion and attributes
Now lets add attributes to these reactions.
In the multi-line text field of the dataset the following line is added:
$TASTE="good"
The two reactions inherit the attribute $TASTE="good".
It will be included into the SBML export when the option
-useReactionAttributes TASTE
is given at the command line.
Both reactions get this attribute.
Nevertheless, it is possible, to assign an attribute only to one specific reaction
by appending the brace expansion item in curly brackets:
$TASTE{apple}="good"
Now only the reaction with apple gets this attribute.
Brace expansion and compartments
Brace expansion can also be applied to compartments.
The two compartments of the following example are "garden1" and "garden2".
The parenthetical group for the compartments should expand independently of the
parenthetical group of the metabolite.
Therefore we enclose the compartments in double curly braces.
{ apple pear }@{{ garden1 garden2 }} => dessert
This generates the following 4 reactions,
two of them get above attribute $TASTE:
pear@garden1 --> dessert
pear@garden2 --> dessert
apple@garden1 --> dessert $TASTE="good"
apple@garden2 --> dessert $TASTE="good"
The attribute can be confined to one specific reaction by adding
the respective compartment identifier.
$TASTE{apple}@garden2="good"
References on the left and right side of the equation
Let's add the parenthetical group of compartments also to the product "dessert".
{ apple pear }@{{ garden1 garden2 }} => dessert@{{ garden1 garden2 }}
This generates the following 4 reactions where also the reaction product is compartmentalized:
pear@garden1 --> dessert@garden1
pear@garden2 --> dessert@garden2
apple@garden1 --> dessert@garden1
apple@garden2 --> dessert@garden2 $TASTE="good"
Having identical parenthetical groups several times in the
equation, all further occurrence can be abbreviated by empty curly
parentheses. They need to be really empty, i.e. there must be no
space within. The following line is syntactically equivalent:
{ apple pear }@{{ garden1 garden2 }} => dessert@{{}}