libsbmlcs.Reaction.getNumProducts C# (CSharp) Method

getNumProducts() public method

public getNumProducts ( ) : long
return long
        public long getNumProducts()
        {
            return (long)libsbmlPINVOKE.Reaction_getNumProducts(swigCPtr);
        }

Usage Example

コード例 #1
0
ファイル: ReactionImporter.cs プロジェクト: onwhenrdy/MoBi
        /// <summary>
        ///     Saves products of a SBML reaction into a dictionary, containing their compartment and SpeciesReference.
        /// </summary>
        private Dictionary <string, List <SpeciesReference> > ComputeProducts(Reaction sbmlReaction, Model model)
        {
            var productCompartmentMoleculeDictionary = new Dictionary <string, List <SpeciesReference> >();

            for (long i = 0; i < sbmlReaction.getNumProducts(); i++)
            {
                var product        = sbmlReaction.getProduct(i);
                var productSpecies = GetSpeciesById(product.getSpecies(), model);
                var compartment    = productSpecies.getCompartment();
                if (_sbmlInformation.MoleculeInformation.All(info => info.SpeciesIds.TrueForAll(s => s != productSpecies.getId())))
                {
                    continue;
                }

                if (!productCompartmentMoleculeDictionary.ContainsKey(compartment))
                {
                    productCompartmentMoleculeDictionary[compartment] = new List <SpeciesReference> {
                        product
                    }
                }
                ;
                else
                {
                    productCompartmentMoleculeDictionary[compartment].Add(product);
                }
            }
            return(productCompartmentMoleculeDictionary);
        }
All Usage Examples Of libsbmlcs.Reaction::getNumProducts