libsbmlcs.Reaction.getReactant C# (CSharp) Method

getReactant() public method

public getReactant ( long n ) : SpeciesReference
n long
return SpeciesReference
        public SpeciesReference getReactant(long n)
        {
            IntPtr cPtr = libsbmlPINVOKE.Reaction_getReactant__SWIG_0(swigCPtr, n);
            SpeciesReference ret = (cPtr == IntPtr.Zero) ? null : new SpeciesReference(cPtr, false);
            return ret;
        }

Same methods

Reaction::getReactant ( string species ) : SpeciesReference

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::getReactant