Example #1
0
        protected override void Context()
        {
            base.Context();

            _simulation      = A.Fake <Simulation>();
            _mixedInhibition = new InhibitionProcess {
                InteractionType = InteractionType.MixedInhibition
            }.WithName("MixedInhibition");
            _competitiveInhibition = new InhibitionProcess {
                InteractionType = InteractionType.CompetitiveInhibition
            }.WithName("CompetitiveInhibition");
            _compound1 = new Compound().WithName("Compound1");
            _compound2 = new Compound().WithName("Compound2");
            _compound2.AddProcess(_mixedInhibition);
            _compound2.AddProcess(_competitiveInhibition);

            _interactionProperties = new InteractionProperties();
            A.CallTo(() => _simulation.InteractionProperties).Returns(_interactionProperties);
            A.CallTo(() => _simulation.Compounds).Returns(new[] { _compound1, _compound2 });

            _interactionProperties.AddInteraction(new InteractionSelection {
                MoleculeName = _moleculeName, ProcessName = _mixedInhibition.Name, CompoundName = _compound2.Name
            });
            _interactionProperties.AddInteraction(new InteractionSelection {
                MoleculeName = _moleculeName, ProcessName = _competitiveInhibition.Name, CompoundName = _compound2.Name
            });
        }
Example #2
0
        protected override void Context()
        {
            _simulation       = A.Fake <Simulation>();
            _mixedInhibition1 = new InhibitionProcess {
                InteractionType = InteractionType.MixedInhibition
            }.WithName("MixedInhibition1");
            _mixedInhibition2 = new InhibitionProcess {
                InteractionType = InteractionType.MixedInhibition
            }.WithName("MixedInhibition2");
            _compound1 = new Compound().WithName("Compound1");

            _compound2 = new Compound().WithName("Compound2");
            _compound2.AddProcess(_mixedInhibition1);
            _compound2.AddProcess(_mixedInhibition2);

            _interactionProperties = new InteractionProperties();
            A.CallTo(() => _simulation.InteractionProperties).Returns(_interactionProperties);
            A.CallTo(() => _simulation.Compounds).Returns(new[] { _compound1, _compound2 });

            sut = new MixedInhibitionKineticUpdaterSpecification(new ObjectPathFactoryForSpecs(), A.Fake <IDimensionRepository>(), new InteractionTask());

            _interactionProperties.AddInteraction(new InteractionSelection {
                MoleculeName = _moleculeName, ProcessName = _mixedInhibition1.Name, CompoundName = _compound2.Name
            });
            _interactionProperties.AddInteraction(new InteractionSelection {
                MoleculeName = _moleculeName, ProcessName = _mixedInhibition2.Name, CompoundName = _compound2.Name
            });
        }
        protected override void Context()
        {
            _formulaCache      = A.Fake <IFormulaCache>();
            _repository        = A.Fake <IRepository <IInteractionKineticUpdaterSpecification> >();
            _objectBaseFactory = A.Fake <IObjectBaseFactory>();
            A.CallTo(() => _objectBaseFactory.Create <ExplicitFormula>()).ReturnsLazily(x => new ExplicitFormula());
            A.CallTo(() => _repository.All()).Returns(_allKineticUpdaterSpecifications);
            sut = new InteractionKineticUpdater(_repository, _objectBaseFactory);

            _reaction = new ReactionBuilder();
            _transporterMoleculeContainer = new TransporterMoleculeContainer();
            _simulation            = A.Fake <Simulation>();
            _interactionProperties = new InteractionProperties();

            _interactionProperties.AddInteraction(new InteractionSelection {
                MoleculeName = _enzymeName, ProcessName = _processName
            });
            A.CallTo(() => _simulation.InteractionProperties).Returns(_interactionProperties);


            _kmFactor   = new PKSimParameter().WithName(CoreConstants.Parameter.KM_INTERACTION_FACTOR).WithFormula(new ExplicitFormula("1"));
            _vmaxFactor = new PKSimParameter().WithName(CoreConstants.Parameter.KCAT_INTERACTION_FACTOR).WithFormula(new ExplicitFormula("1"));

            _reaction.Add(_kmFactor);
            _reaction.Add(_vmaxFactor);

            _transporterMoleculeContainer.Add(_kmFactor);
            _transporterMoleculeContainer.Add(_vmaxFactor);
        }
        protected override void Context()
        {
            _simulation = A.Fake <Simulation>();
            _irreversibleInhibition1 = new InhibitionProcess {
                InteractionType = InteractionType.IrreversibleInhibition
            }.WithName("IrreversibleInhibition1");
            _irreversibleInhibition2 = new InhibitionProcess {
                InteractionType = InteractionType.IrreversibleInhibition
            }.WithName("IrreversibleInhibition2");
            _uncompetitiveInhibition = new InhibitionProcess {
                InteractionType = InteractionType.UncompetitiveInhibition
            }.WithName("UncompetitiveInhibition");
            _compound1 = new Compound().WithName("Compound1");
            _compound1.AddProcess(_irreversibleInhibition1);
            _compound1.AddProcess(_uncompetitiveInhibition);

            _compound2 = new Compound().WithName("Compound2");
            _compound2.AddProcess(_irreversibleInhibition2);

            _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 IrreversibleInhibitionKineticUpdaterSpecification(_objectPathFactory, _dimensionRepository, _interactionTask);

            _interactionProperties.AddInteraction(new InteractionSelection {
                MoleculeName = _moleculeName, ProcessName = _irreversibleInhibition1.Name, CompoundName = _compound1.Name
            });
            _interactionProperties.AddInteraction(new InteractionSelection {
                MoleculeName = _moleculeName, ProcessName = _irreversibleInhibition2.Name, CompoundName = _compound2.Name
            });
            _interactionProperties.AddInteraction(new InteractionSelection {
                MoleculeName = _moleculeName, ProcessName = _uncompetitiveInhibition.Name, CompoundName = _compound2.Name
            });
        }
        protected override void Context()
        {
            base.Context();
            _interactionProperties = new InteractionProperties();
            var inhibitionProcess = new InhibitionProcess {
                InteractionType = InteractionType.CompetitiveInhibition
            }.WithName("Proc");
            var interaction = new InteractionSelection {
                CompoundName = _compound.Name, ProcessName = inhibitionProcess.Name
            };

            _compound.AddProcess(inhibitionProcess);
            _interactionProperties.AddInteraction(interaction);
            _compoundProperties = new CompoundProperties();
        }
        protected override void Context()
        {
            base.Context();
            _moleculeMappable        = new IndividualEnzyme().WithName("MoleculeMapped");
            _moleculeAlreadySelected = new IndividualEnzyme().WithName("MoleculeAlreadySelected");
            _moleculeNotMapped       = new IndividualEnzyme().WithName("MoleculeNotMapped");
            _inhibitionProcess1      = new InhibitionProcess().WithName("InhibitionProcess1");
            _inhibitionProcess2      = new InhibitionProcess().WithName("InhibitionProcess2");
            _inductionProcess1       = new InductionProcess().WithName("InductionProcess1");
            _inhibitionProcess3      = new InhibitionProcess().WithName("InhibitionProcess3");

            _individual.AddMolecule(_moleculeNotMapped);
            _individual.AddMolecule(_moleculeMappable);
            _individual.AddMolecule(_moleculeAlreadySelected);

            _compound.AddProcess(_inhibitionProcess1);

            _compound2 = new Compound().WithName("Comp2");
            _compound2.AddProcess(_inhibitionProcess2);
            _inhibitionProcess2.MoleculeName = _moleculeMappable.Name;

            _compound2.AddProcess(_inhibitionProcess3);
            _inhibitionProcess3.MoleculeName = _moleculeMappable.Name;

            _compound2.AddProcess(_inductionProcess1);
            _inductionProcess1.MoleculeName = _moleculeMappable.Name;

            var interactionProperties = new InteractionProperties();

            interactionProperties.AddInteraction(new InteractionSelection {
                MoleculeName = _moleculeAlreadySelected.Name, ProcessName = _inhibitionProcess1.Name, CompoundName = _compound.Name
            });

            A.CallTo(() => _simulation.InteractionProperties).Returns(interactionProperties);
            A.CallTo(() => _simulation.Compounds).Returns(new[] { _compound, _compound2 });
        }