private bool isRenalClearance(IPartialProcessMapping compoundProcessMapping) { var systemicPocess = compoundProcessMapping as SystemicProcessSelection; if (systemicPocess == null) { return(false); } return((systemicPocess.ProcessType == SystemicProcessTypes.Renal) || (systemicPocess.ProcessType == SystemicProcessTypes.GFR)); }
private void addTransportProcess(IMoleculeBuilder drug, IPartialProcessMapping compoundProcessMapping, CompoundProperties compoundProperties) { var compound = compoundProperties.Compound; var process = compound.ProcessByName(compoundProcessMapping.ProcessName); if (isRenalClearance(compoundProcessMapping)) { var renalPassiveProcess = _processBuilderMapper.PassiveTransportProcessFrom(process, drug.Name, _passiveTransports.FormulaCache); _passiveTransports.Add(renalPassiveProcess); _parameterIdUpdater.UpdateBuildingBlockId(renalPassiveProcess.Parameters, compound); return; } var transporter = _individual.MoleculeByName <IndividualTransporter>(compoundProcessMapping.MoleculeName); var transporterMoleculeContainer = _processBuilderMapper.ActiveTransportFrom(process, transporter, _moleculeBuildingBlock.FormulaCache); _interactionKineticUpdater.UpdateTransport(transporterMoleculeContainer, compoundProcessMapping.MoleculeName, compound.Name, _simulation, _moleculeBuildingBlock.FormulaCache); _parameterIdUpdater.UpdateBuildingBlockId(transporterMoleculeContainer.Parameters, compound); drug.AddTransporterMoleculeContainer(transporterMoleculeContainer); }
private static SimulationPartialProcess newSimulationPartialProcess <TIndividualMolecule>(TIndividualMolecule individualMolecule, PartialProcess partialProcess, IPartialProcessMapping partialProcessMapping = null) where TIndividualMolecule : IndividualMolecule { return(new SimulationPartialProcess { CompoundProcess = partialProcess, IndividualMolecule = individualMolecule, PartialProcessMapping = partialProcessMapping }); }
private static bool isSelected <TPartialProcess>(TPartialProcess compoundProcess, IPartialProcessMapping mapping) where TPartialProcess : PartialProcess { return(compoundProcess != null && string.Equals(compoundProcess.ParentCompound.Name, mapping.CompoundName)); }