private async Task <CompoundProcessesSelection> modelProcessSelectionFrom(CompoundProcessSelection[] snapshotProcesses, Model.Compound compound, ISimulationSubject simulationSubject, SnapshotContext snapshotContext) { var compoundProcessesSelection = new CompoundProcessesSelection(); if (snapshotProcesses == null) { return(compoundProcessesSelection); } foreach (var snapshotProcess in snapshotProcesses) { var process = compound.ProcessByName(snapshotProcess.Name) ?? notSelectedProcessFrom(snapshotProcess, simulationSubject); if (process == null) { //No process found and a name was specified. This is a snapshot that is corrupted if (!string.IsNullOrEmpty(snapshotProcess.Name)) { _logger.AddWarning(PKSimConstants.Error.ProcessNotFoundInCompound(snapshotProcess.Name, compound.Name)); } continue; } await addProcessToProcessSelection(compoundProcessesSelection, snapshotProcess, process, snapshotContext); } return(compoundProcessesSelection); }
private async Task addProcessToProcessSelection(CompoundProcessesSelection compoundProcessesSelection, CompoundProcessSelection compoundProcessSelection, Model.CompoundProcess process) { var processSelectionGroup = selectionGroupFor(compoundProcessesSelection, process); var processSelection = await _processMappingMapper.MapToModel(compoundProcessSelection, process); processSelectionGroup.AddProcessSelection(processSelection); }
private async Task addProcessToProcessSelection(CompoundProcessesSelection compoundProcessesSelection, CompoundProcessSelection snapshotCompoundProcessSelection, Model.CompoundProcess process, SnapshotContext snapshotContext) { var processSelectionGroup = selectionGroupFor(compoundProcessesSelection, process); var processContext = new CompoundProcessSnapshotContext(process, snapshotContext); var processSelection = await _processMappingMapper.MapToModel(snapshotCompoundProcessSelection, processContext); processSelectionGroup.AddProcessSelection(processSelection); }
private void addUndefinedProteinForSystemicProcessesToIndividual(CompoundProcessesSelection compoundProcessesSelection) { var hepaticPlasmaClearance = compoundProcessesSelection.MetabolizationSelection.ProcessSelectionFor(SystemicProcessTypes.Hepatic); if (hepaticPlasmaClearance != null) { addUndefinedLiver(); } var biliaryClearance = compoundProcessesSelection.TransportAndExcretionSelection.ProcessSelectionFor(SystemicProcessTypes.Biliary); if (biliaryClearance != null) { addUndefinedLiverTransporter(); } }
private async Task <CompoundProcessesSelection> modelProcessSelectionFrom(CompoundProcessSelection[] snapshotProcesses, Model.Compound compound) { var compoundProcessesSelection = new CompoundProcessesSelection(); if (snapshotProcesses == null) { return(compoundProcessesSelection); } foreach (var snapshotProcess in snapshotProcesses) { var process = compound.ProcessByName(snapshotProcess.Name); if (process == null) { _logger.AddWarning(PKSimConstants.Error.ProcessNotFoundInCompound(snapshotProcess.Name, compound.Name)); } else { await addProcessToProcessSelection(compoundProcessesSelection, snapshotProcess, process); } } return(compoundProcessesSelection); }
private Task <CompoundProcessSelection[]> snapshotProcessSelectionFrom(CompoundProcessesSelection compoundProcessesSelection) { return(_processMappingMapper.MapToSnapshots(compoundProcessesSelection.AllProcesses())); }
private ProcessSelectionGroup selectionGroupFor(CompoundProcessesSelection compoundProcessesSelection, Model.CompoundProcess process) { return(selectionGroup <EnzymaticProcess>(compoundProcessesSelection.MetabolizationSelection, process, SystemicProcessTypes.Hepatic) ?? selectionGroup <TransportPartialProcess>(compoundProcessesSelection.TransportAndExcretionSelection, process, SystemicProcessTypes.GFR, SystemicProcessTypes.Biliary, SystemicProcessTypes.Renal) ?? selectionGroup <SpecificBindingPartialProcess>(compoundProcessesSelection.SpecificBindingSelection, process)); }