libsbmlcs.Reaction.getProduct C# (CSharp) Method

getProduct() public method

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

Same methods

Reaction::getProduct ( string species ) : SpeciesReference

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