Example #1
0
        public override void GlobalContext()
        {
            base.GlobalContext();
            _enzyme.GetRelativeExpressionNormParameterFor(CoreConstants.Compartment.Plasma).Value              = 0;
            _enzyme.GetRelativeExpressionNormParameterFor(CoreConstants.Compartment.BloodCells).Value          = 0;
            _enzyme.GetRelativeExpressionNormParameterFor(CoreConstants.Compartment.VascularEndothelium).Value = 0;
            _enzyme.GetRelativeExpressionNormParameterFor(CoreConstants.Compartment.Periportal).Value          = 1;

            _simulation = DomainFactoryForSpecs.CreateModelLessSimulationWith(_individual, _compound, _protocol)
                          .DowncastTo <IndividualSimulation>();

            _simulation.CompoundPropertiesList.First()
            .Processes
            .MetabolizationSelection
            .AddPartialProcessSelection(new EnzymaticProcessSelection {
                CompoundName = _compound.Name, ProcessName = _metabolizationProcess.Name, MoleculeName = _enzyme.Name
            });

            DomainFactoryForSpecs.AddModelToSimulation(_simulation);

            var objectPatFactory = new ObjectPathFactoryForSpecs();
            var path             = objectPatFactory.CreateObjectPathFrom(Constants.ORGANISM,
                                                                         CoreConstants.Organ.Liver,
                                                                         CoreConstants.Compartment.Pericentral,
                                                                         CoreConstants.Compartment.Intracellular,
                                                                         CoreConstants.Molecule.ProcessProductName(_compound.Name, _enzyme.Name, CoreConstants.Molecule.Metabolite),
                                                                         CoreConstants.Observer.ObserverNameFrom(CoreConstants.Observer.FRACTION_OF_DOSE, _compound.Name));

            var quantitySelection = new QuantitySelection(path.ToString(), QuantityType.Metabolite);

            _simulation.OutputSelections.AddOutput(quantitySelection);
        }
        public static IDistributedParameter NormalDistributedParameter(double defaultMean = 0, double defaultDeviation = 1, double defaultPercentile = 0.5, bool isDefault = false, bool distributionParameterIsDefault = true)
        {
            var parameter = new DistributedParameter().WithId("P1");

            parameter.IsDefault = isDefault;
            var pathFactory = new ObjectPathFactoryForSpecs();
            var meanParameter = new Parameter {
                Name = Constants.Distribution.MEAN
            }.WithFormula(new ConstantFormula(defaultMean).WithId("MeanFormula")).WithId("Mean");

            meanParameter.IsDefault = distributionParameterIsDefault;
            addDimensionTo(meanParameter);
            var stdParameter = new Parameter {
                Name = Constants.Distribution.DEVIATION
            }.WithFormula(new ConstantFormula(defaultDeviation).WithId("DeviationFormula")).WithId("Deviation");

            stdParameter.IsDefault = distributionParameterIsDefault;
            addDimensionTo(stdParameter);
            var percentileParameter = new Parameter {
                Name = Constants.Distribution.PERCENTILE
            }.WithFormula(new ConstantFormula(defaultPercentile).WithId("PercentileFormula")).WithId("Percentile");

            percentileParameter.IsDefault = distributionParameterIsDefault;
            addDimensionTo(percentileParameter);
            parameter.Add(meanParameter);
            parameter.Add(stdParameter);
            parameter.Add(percentileParameter);
            parameter.Formula = new NormalDistributionFormula().WithId("NormalDistributionFormula");
            parameter.Formula.AddObjectPath(pathFactory.CreateRelativeFormulaUsablePath(parameter, meanParameter));
            parameter.Formula.AddObjectPath(pathFactory.CreateRelativeFormulaUsablePath(parameter, stdParameter));
            addDimensionTo(parameter);
            return(parameter);
        }
Example #3
0
        public override void GlobalContext()
        {
            base.GlobalContext();
            _allExpressionParameters[CoreConstants.Compartment.PLASMA].Value               = 0;
            _allExpressionParameters[CoreConstants.Compartment.BLOOD_CELLS].Value          = 0;
            _allExpressionParameters[CoreConstants.Compartment.VASCULAR_ENDOTHELIUM].Value = 0;
            _allExpressionParameters[CoreConstants.Compartment.PERIPORTAL].Value           = 1;

            _simulation = DomainFactoryForSpecs.CreateModelLessSimulationWith(_individual, _compound, _protocol)
                          .DowncastTo <IndividualSimulation>();

            _simulation.CompoundPropertiesList.First()
            .Processes
            .MetabolizationSelection
            .AddPartialProcessSelection(new EnzymaticProcessSelection
            {
                CompoundName = _compound.Name, ProcessName = _metabolizationProcess.Name, MoleculeName = _enzyme.Name
            });

            DomainFactoryForSpecs.AddModelToSimulation(_simulation);

            var objectPatFactory = new ObjectPathFactoryForSpecs();
            var path             = objectPatFactory.CreateObjectPathFrom(Constants.ORGANISM,
                                                                         CoreConstants.Organ.LIVER,
                                                                         CoreConstants.Compartment.PERICENTRAL,
                                                                         CoreConstants.Compartment.INTRACELLULAR,
                                                                         CoreConstants.Molecule.ProcessProductName(_compound.Name, _enzyme.Name, CoreConstants.Molecule.Metabolite),
                                                                         CoreConstants.Observer.ObserverNameFrom(CoreConstants.Observer.FRACTION_OF_DOSE, _compound.Name));

            var quantitySelection = new QuantitySelection(path.ToString(), QuantityType.Metabolite);

            _simulation.OutputSelections.AddOutput(quantitySelection);
        }
        protected override void Context()
        {
            base.Context();
            var objectPathFactory = new ObjectPathFactoryForSpecs();

            _oneParameter      = DomainHelperForSpecs.ConstantParameterWithValue(1).WithName("P1").WithId("1");
            _parameter         = DomainHelperForSpecs.ConstantParameterWithValue(5).WithName("toto").WithId("2");
            _parameter.Formula = new ExplicitFormula("2*3").WithId("p");
            _container.Add(_oneParameter);
            _container.Add(_parameter);
            _parameter.Formula.AddObjectPath(objectPathFactory.CreateRelativeFormulaUsablePath(_parameter, _oneParameter));
            _parameter.Value = 10;
        }