libsbmlcs.Reaction.getNumReactants C# (CSharp) Method

getNumReactants() public method

public getNumReactants ( ) : long
return long
        public long getNumReactants()
        {
            return (long)libsbmlPINVOKE.Reaction_getNumReactants(swigCPtr);
        }

Usage Example

コード例 #1
0
ファイル: ReactionImporter.cs プロジェクト: onwhenrdy/MoBi
        /// <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);
        }
All Usage Examples Of libsbmlcs.Reaction::getNumReactants