private void addIrreversibleBindings(IMoleculeBuilder molecule, InteractionProcess irreversibleInteraction) { var irreversibleBindingReaction = _processBuilderMapper.InactivationReactionFrom(irreversibleInteraction, molecule, _allMoleculeNames, _reactionBuildingBlock.FormulaCache); _interactionKineticUpdater.UpdateReaction(irreversibleBindingReaction, molecule.Name, irreversibleInteraction.ParentCompound.Name, _simulation, _reactionBuildingBlock.FormulaCache); _reactionBuildingBlock.Add(irreversibleBindingReaction); }
private void addInduction(IMoleculeBuilder molecule, InteractionProcess inductionProcess) { var inductionReaction = _processBuilderMapper.InductionReactionFrom(inductionProcess, molecule, _allMoleculeNames, _reactionBuildingBlock.FormulaCache); _reactionBuildingBlock.Add(inductionReaction); }
public IReactionBuilder InductionReactionFrom(InteractionProcess interactionProcess, IMoleculeBuilder protein, IReadOnlyCollection <string> forbiddenNames, IFormulaCache formulaCache) { var reaction = interactionReactionFrom(interactionProcess, protein, forbiddenNames, formulaCache); reaction.AddProduct(new ReactionPartnerBuilder(protein.Name, 1)); return(reaction); }
protected override void Context() { base.Context(); _compound = new Compound().WithName("Comp"); _interactionProcess = new InhibitionProcess { ParentContainer = _compound }.WithName("Proc"); }
private IReactionBuilder interactionReactionFrom(InteractionProcess interactionProcess, IMoleculeBuilder protein, IReadOnlyCollection <string> forbiddenNames, IFormulaCache formulaCache) { var compound = interactionProcess.ParentCompound; var reactionName = CoreConstants.CompositeNameFor(compound.Name, interactionProcess.Name); var reaction = createReactionFromProcess(interactionProcess, reactionName, forbiddenNames); //replace keywords replaceKeywordsInProcess(reaction, new[] { CoreConstants.KeyWords.Molecule, CoreConstants.KeyWords.Protein, CoreConstants.KeyWords.Reaction }, new[] { compound.Name, protein.Name, interactionProcess.Name }); formulaCache.Add(reaction.Formula); return(reaction); }
public IReactionBuilder InductionReactionFrom(InteractionProcess interactionProcess, IMoleculeBuilder protein, IReadOnlyCollection <string> forbiddenNames, IFormulaCache formulaCache) { var reaction = interactionReactionFrom(interactionProcess, protein, forbiddenNames, formulaCache); reaction.AddProduct(new ReactionPartnerBuilder(protein.Name, 1)); //Induction occurs only in Intracellular and Interstitial reaction.ContainerCriteria.Add(new InContainerCondition(TISSUE_ORGAN)); reaction.ContainerCriteria.Add(new NotMatchTagCondition(PLASMA)); reaction.ContainerCriteria.Add(new NotMatchTagCondition(BLOOD_CELLS)); reaction.ContainerCriteria.Add(new NotMatchTagCondition(ENDOSOME)); return(reaction); }
protected override void Context() { _partialProcessRetriever = new PartialProcessRetriever(); _individual = new Individual(); _simulation = A.Fake <Simulation>(); _compound = new Compound().WithName("Comp"); _notSelectedInteractionProcess = A.Fake <InteractionProcess>(); A.CallTo(() => _simulation.Individual).Returns(_individual); A.CallTo(() => _simulation.Compounds).Returns(new[] { _compound }); sut = new InteractionProcessRetriever(_partialProcessRetriever) { NotSelectedInteractionProcess = _notSelectedInteractionProcess }; }
protected override void Context() { _interactionProcessRetriever = A.Fake <IInteractionProcessRetriever>(); _view = A.Fake <ISimulationCompoundInteractionSelectionView>(); sut = new SimulationCompoundInteractionSelectionPresenter(_view, _interactionProcessRetriever); _interactionProperties = new InteractionProperties(); _allSimulationInteractionProcesses = new List <SimulationPartialProcess>(); _simulation = A.Fake <Simulation>(); var individual = new Individual().WithName("Enzyme"); _molecule1 = new IndividualEnzyme().WithName("CYP3A4"); _undefinedLiver = new IndividualEnzyme().WithName(CoreConstants.Molecule.UndefinedLiver); individual.AddMolecule(_molecule1); individual.AddMolecule(_undefinedLiver); _interactionProcess1 = new InhibitionProcess().WithName("INTERACTION1"); _interactionProcess2 = new InhibitionProcess().WithName("INTERACTION2"); _interactionProcess3 = new InhibitionProcess().WithName("INTERACTION3"); var comp1 = new Compound(); comp1.AddProcess(_interactionProcess1); var comp2 = new Compound(); comp2.AddProcess(_interactionProcess2); comp2.AddProcess(_interactionProcess3); _allSimulationInteractionProcesses.Add(new SimulationPartialProcess { CompoundProcess = _interactionProcess1, IndividualMolecule = _molecule1 }); _allSimulationInteractionProcesses.Add(new SimulationPartialProcess { CompoundProcess = _interactionProcess2, IndividualMolecule = _molecule1 }); A.CallTo(() => _simulation.InteractionProperties).Returns(_interactionProperties); A.CallTo(() => _simulation.Individual).Returns(individual); A.CallTo(() => _simulation.Compounds).Returns(new[] { comp1, comp2 }); A.CallTo(_interactionProcessRetriever).WithReturnType <IReadOnlyList <SimulationPartialProcess> >() .Invokes(x => _useDefaultMap = x.GetArgument <bool>(2)) .Returns(_allSimulationInteractionProcesses); A.CallTo(() => _view.BindTo(A <IEnumerable <SimulationInteractionProcessSelectionDTO> > ._)) .Invokes(x => _allSimulationInteractionProcessSelectionDTO = x.GetArgument <IEnumerable <SimulationInteractionProcessSelectionDTO> >(0)); }
protected override void Context() { _simulation = A.Fake <Simulation>(); _competitiveInhibition1 = new InhibitionProcess { InteractionType = InteractionType.CompetitiveInhibition }.WithName("CompetitiveInhibition1"); _competitiveInhibition2 = new InhibitionProcess { InteractionType = InteractionType.CompetitiveInhibition }.WithName("CompetitiveInhibition2"); _uncompetitiveInhibition = new InhibitionProcess { InteractionType = InteractionType.UncompetitiveInhibition }.WithName("UncompetitiveInhibition"); _compound1 = new Compound().WithName("Compound1"); _compound1.AddProcess(_competitiveInhibition1); _compound1.AddProcess(_uncompetitiveInhibition); _compound2 = new Compound().WithName("Compound2"); _compound2.AddProcess(_competitiveInhibition2); _interactionProperties = new InteractionProperties(); A.CallTo(() => _simulation.InteractionProperties).Returns(_interactionProperties); A.CallTo(() => _simulation.Compounds).Returns(new[] { _compound1, _compound2 }); _objectPathFactory = new ObjectPathFactoryForSpecs(); _dimensionRepository = A.Fake <IDimensionRepository>(); _interactionTask = new InteractionTask(); sut = new CompetitiveInhibitionsKineticUpdaterSpecification(_objectPathFactory, _dimensionRepository, _interactionTask); _interactionProperties.AddInteraction(new InteractionSelection { MoleculeName = _moleculeName, ProcessName = _competitiveInhibition1.Name, CompoundName = _compound1.Name }); _interactionProperties.AddInteraction(new InteractionSelection { MoleculeName = _moleculeName, ProcessName = _competitiveInhibition2.Name, CompoundName = _compound2.Name }); _interactionProperties.AddInteraction(new InteractionSelection { MoleculeName = _moleculeName, ProcessName = _uncompetitiveInhibition.Name, CompoundName = _compound2.Name }); }
protected override void Context() { base.Context(); _formulaCache = new FormulaCache(); _protein = new MoleculeBuilder().WithName("CYP3A4"); _interactionProcess = new InductionProcess().WithName("Induction"); _interactionProcess.InternalName = "AA"; _compound = new Compound().WithName("Inhibitor"); _compound.AddProcess(_interactionProcess); _template = new PKSimReaction(); A.CallTo(() => _simulationActiveProcessRepository.ProcessFor <PKSimReaction>(_interactionProcess.InternalName)).Returns(_template); var reaction = new PKSimReaction { Formula = new ExplicitFormula().WithName("ABC") }; reaction.Formula.AddObjectPath(new FormulaUsablePath(CoreConstants.KeyWords.Protein, "P1").WithAlias("P1")); reaction.Formula.AddObjectPath(new FormulaUsablePath(CoreConstants.KeyWords.Reaction, "R1").WithAlias("R1")); reaction.Formula.AddObjectPath(new FormulaUsablePath(CoreConstants.KeyWords.Molecule, "M11").WithAlias("M1")); A.CallTo(() => _cloneManager.Clone <IReactionBuilder>(_template)).Returns(reaction); }
private static bool shouldGenerateInteractionContainer(InteractionProperties interactionProperties, InteractionProcess interactionProcess) { return(interactionProperties.Uses(interactionProcess)); }
private IFormulaUsablePath kiPath(string kiParameter, Compound inhibitor, InteractionProcess process, string kiAlias) { return(_objectPathFactory.CreateFormulaUsablePathFrom(inhibitor.Name, process.Name, kiParameter) .WithAlias(kiAlias) .WithDimension(_dimensionRepository.MolarConcentration)); }
protected override void Context() { base.Context(); _interactionProcess = new InhibitionProcess(); }