Beispiel #1
0
        private void addSpecificBindingProcess(IMoleculeBuilder drug, IReactionMapping compoundReactionMapping, CompoundProperties compoundProperties)
        {
            var compound = compoundProperties.Compound;
            var process  = compound.ProcessByName(compoundReactionMapping.ProcessName);
            var complex  = _moleculeBuilderFactory.Create(QuantityType.Complex, _moleculeBuildingBlock.FormulaCache)
                           .WithName(compoundReactionMapping.ProductName(CoreConstants.Molecule.Complex));

            addMoleculeToBuildingBlock(complex, compoundProperties);
            var complexReactionFrom = _processBuilderMapper.ComplexReactionFrom(process, drug, complex, compoundReactionMapping.MoleculeName, _allMoleculeNames, _reactionBuildingBlock.FormulaCache);

            addReactionToBuildingBlock(complexReactionFrom, compound);
        }
Beispiel #2
0
        private IMoleculeBuilder getOrCreateMetaboliteFor(IReactionMapping compoundReactionMapping, CompoundProperties compoundProperties)
        {
            IMoleculeBuilder metabolite = null;
            var enzymaticProcess        = compoundReactionMapping as EnzymaticProcessSelection;

            if (enzymaticProcess != null)
            {
                metabolite = _moleculeBuildingBlock[enzymaticProcess.MetaboliteName];
            }

            if (metabolite != null)
            {
                return(metabolite);
            }

            metabolite = _moleculeBuilderFactory.Create(QuantityType.Metabolite, _moleculeBuildingBlock.FormulaCache)
                         .WithName(compoundReactionMapping.ProductName(CoreConstants.Molecule.Metabolite));

            addMoleculeToBuildingBlock(metabolite, compoundProperties);
            return(metabolite);
        }