/// <summary>
/// Saves educts of a SBML reaction into a dictionary, containing their compartment and SpeciesReference.
/// </summary>
private Dictionary <string, List <SpeciesReference> > ComputeEducts(Reaction sbmlReaction, Model model)
{
var eductCompartmentMoleculeDictionary = new Dictionary <string, List <SpeciesReference> >();
for (long i = 0; i < sbmlReaction.getNumReactants(); i++)
{
var reactant = sbmlReaction.getReactant(i);
var reactantSpecies = GetSpeciesById(reactant.getSpecies(), model);
var compartment = reactantSpecies.getCompartment();
if (_sbmlInformation.MoleculeInformation.All(info => info.SpeciesIds.TrueForAll(s => s != reactantSpecies.getId())))
{
continue;
}
if (!eductCompartmentMoleculeDictionary.ContainsKey(compartment))
{
eductCompartmentMoleculeDictionary[compartment] = new List <SpeciesReference> {
reactant
}
}
;
else
{
eductCompartmentMoleculeDictionary[compartment].Add(reactant);
}
}
return(eductCompartmentMoleculeDictionary);
}