コード例 #1
0
 public DistributedParameterToTableParameterConverter(
     IFormulaFactory formulaFactory,
     IEntityPathResolver entityPathResolver,
     IParameterFactory parameterFactory,
     ICloneManager cloneManager,
     IParameterQuery parameterQuery,
     IDimensionRepository dimensionRepository,
     IOntogenyRepository ontogenyRepository,
     IFullPathDisplayResolver fullPathDisplayResolver,
     IInterpolation interpolation,
     IParameterStartValuesCreator parameterStartValuesCreator,
     IObjectPathFactory objectPathFactory,
     IGenderRepository genderRepository)
 {
     _formulaFactory              = formulaFactory;
     _entityPathResolver          = entityPathResolver;
     _parameterFactory            = parameterFactory;
     _cloneManager                = cloneManager;
     _parameterQuery              = parameterQuery;
     _dimensionRepository         = dimensionRepository;
     _ontogenyRepository          = ontogenyRepository;
     _fullPathDisplayResolver     = fullPathDisplayResolver;
     _interpolation               = interpolation;
     _parameterStartValuesCreator = parameterStartValuesCreator;
     _objectPathFactory           = objectPathFactory;
     _genderRepository            = genderRepository;
     _timeDimension               = dimensionRepository.Time;
     _yearUnit = _timeDimension.Unit(dimensionRepository.AgeInYears.BaseUnit.Name);
 }
コード例 #2
0
 public MatlabPopulationFactory(IMatlabPopulationSettingsToPopulationSettingsMapper populationSettingsMapper, IRandomPopulationFactory randomPopulationFactory,
                                IOntogenyRepository ontogenyRepository, IMoleculeOntogenyVariabilityUpdater ontogenyVariabilityUpdater, IIndividualEnzymeFactory individualEnzymeFactory)
 {
     _populationSettingsMapper   = populationSettingsMapper;
     _randomPopulationFactory    = randomPopulationFactory;
     _ontogenyRepository         = ontogenyRepository;
     _ontogenyVariabilityUpdater = ontogenyVariabilityUpdater;
     _individualEnzymeFactory    = individualEnzymeFactory;
 }
コード例 #3
0
ファイル: OntogenyTaskSpecs.cs プロジェクト: yvkashyap/PK-Sim
 protected override void Context()
 {
     _context = A.Fake <IExecutionContext>();
     _applicationController = A.Fake <IApplicationController>();
     _dataImporter          = A.Fake <IDataImporter>();
     _dimensionRepository   = A.Fake <IDimensionRepository>();
     _ontogenyRepository    = A.Fake <IOntogenyRepository>();
     _entityTask            = A.Fake <IEntityTask>();
     _formulaFactory        = A.Fake <IFormulaFactory>();
     sut = new IndividualOntogenyTask(_context, _applicationController, _dataImporter, _dimensionRepository, _ontogenyRepository, _entityTask, _formulaFactory);
 }
コード例 #4
0
 public MoleculeParameterTask(
     IMoleculeParameterRepository moleculeParameterRepository,
     ITransportContainerUpdater transportContainerUpdater,
     IOntogenyRepository ontogenyRepository,
     IOntogenyTask ontogenyTask)
 {
     _moleculeParameterRepository = moleculeParameterRepository;
     _transportContainerUpdater   = transportContainerUpdater;
     _ontogenyRepository          = ontogenyRepository;
     _ontogenyTask = ontogenyTask;
 }
コード例 #5
0
 public ShowOntogenyDataPresenter(IShowOntogenyDataView view, IOntogenyRepository ontogenyRepository,
                                  ISimpleChartPresenter simpleChartPresenter, IDimensionRepository dimensionRepository,
                                  IGroupRepository groupRepository, IDisplayUnitRetriever displayUnitRetriever) : base(view)
 {
     _ontogenyRepository   = ontogenyRepository;
     _simpleChartPresenter = simpleChartPresenter;
     _dimensionRepository  = dimensionRepository;
     _groupRepository      = groupRepository;
     _displayUnitRetriever = displayUnitRetriever;
     _view.AddChart(_simpleChartPresenter.View);
 }
コード例 #6
0
 protected override void Context()
 {
     _view = A.Fake <IOntogenySelectionView>();
     _ontogenyRepository = A.Fake <IOntogenyRepository>();
     _ontogenyTask       = A.Fake <IOntogenyTask <Individual> >();
     _commandRegister    = A.Fake <ICommandCollector>();
     _allOntogenies      = new List <Ontogeny>();
     A.CallTo(() => _ontogenyRepository.AllFor(CoreConstants.Species.Human)).Returns(_allOntogenies);
     sut = new OntogenySelectionPresenter <Individual>(_view, _ontogenyRepository, _ontogenyTask);
     sut.InitializeWith(_commandRegister);
 }
コード例 #7
0
ファイル: OntogenyTask.cs プロジェクト: valdiman/PK-Sim
 public OntogenyTask(IExecutionContext executionContext, IApplicationController applicationController, IDataImporter dataImporter,
                     IDimensionRepository dimensionRepository, IOntogenyRepository ontogenyRepository, IEntityTask entityTask, IFormulaFactory formulaFactory)
 {
     _executionContext      = executionContext;
     _applicationController = applicationController;
     _dataImporter          = dataImporter;
     _dimensionRepository   = dimensionRepository;
     _ontogenyRepository    = ontogenyRepository;
     _entityTask            = entityTask;
     _formulaFactory        = formulaFactory;
 }
コード例 #8
0
 public UsedMoleculeRepository(
     IPKSimProjectRetriever projectRetriever,
     IOntogenyRepository ontogenyRepository,
     IMoleculeParameterRepository moleculeParameterRepository,
     ITransporterContainerTemplateRepository transporterContainerTemplateRepository)
 {
     _projectRetriever                       = projectRetriever;
     _ontogenyRepository                     = ontogenyRepository;
     _moleculeParameterRepository            = moleculeParameterRepository;
     _transporterContainerTemplateRepository = transporterContainerTemplateRepository;
 }
コード例 #9
0
        protected override void Context()
        {
            _individual                    = new Individual();
            _individual.OriginData         = new OriginData();
            _individual.OriginData.Species = new Species().WithName("Human");
            _ontogeny = new DatabaseOntogeny {
                Name = "toto"
            };
            _molecule = new IndividualEnzyme {
                Name = "CYP3A4"
            };
            _executionContext                  = A.Fake <IExecutionContext>();
            _proteinExpressionPresenter        = A.Fake <IProteinExpressionsPresenter>();
            _simpleMoleculePresenter           = A.Fake <ISimpleMoleculePresenter>();
            _querySettingsMapper               = A.Fake <IMoleculeToQueryExpressionSettingsMapper>();
            _applicationController             = A.Fake <IApplicationController>();
            _individualMoleculeFactoryResolver = A.Fake <IIndividualMoleculeFactoryResolver>();
            _transportContainerUpdater         = A.Fake <ITransportContainerUpdater>();
            _containerTask = A.Fake <IContainerTask>();
            _moleculeParameterRepository    = A.Fake <IMoleculeParameterRepository>();
            _proteinExpressionDbPathManager = A.Fake <IProteinExpressionsDatabasePathManager>();
            A.CallTo(() => _applicationController.Start <IProteinExpressionsPresenter>()).Returns(_proteinExpressionPresenter);
            A.CallTo(() => _applicationController.Start <ISimpleMoleculePresenter>()).Returns(_simpleMoleculePresenter);
            _ontogenyRepository = A.Fake <IOntogenyRepository>();
            var proteinFactory = A.Fake <IIndividualMoleculeFactory>();

            _moleculeContainer1 = new MoleculeExpressionContainer().WithName("C1");
            _moleculeContainer1.Add(DomainHelperForSpecs.ConstantParameterWithValue(5).WithName(CoreConstants.Parameter.RelExp));
            _moleculeContainer1.Add(DomainHelperForSpecs.ConstantParameterWithValue(1).WithName(CoreConstants.Parameter.RelExpNorm));
            _moleculeContainer2 = new MoleculeExpressionContainer().WithName("C2");
            _moleculeContainer2.Add(DomainHelperForSpecs.ConstantParameterWithValue(5).WithName(CoreConstants.Parameter.RelExp));
            _moleculeContainer2.Add(DomainHelperForSpecs.ConstantParameterWithValue(1).WithName(CoreConstants.Parameter.RelExpNorm));
            A.CallTo(() => _individualMoleculeFactoryResolver.FactoryFor <IndividualProtein>()).Returns(proteinFactory);
            A.CallTo(() => proteinFactory.CreateFor(_individual)).Returns(_molecule);
            _molecule.Add(_moleculeContainer1);
            _molecule.Add(_moleculeContainer2);
            _molecule.Add(DomainHelperForSpecs.ConstantParameterWithValue(10).WithName(CoreConstants.Parameter.REFERENCE_CONCENTRATION));
            _molecule.Add(DomainHelperForSpecs.ConstantParameterWithValue(20).WithName(CoreConstants.Parameter.HALF_LIFE_LIVER));
            _molecule.Add(DomainHelperForSpecs.ConstantParameterWithValue(30).WithName(CoreConstants.Parameter.HALF_LIFE_INTESTINE));

            A.CallTo(() => _ontogenyRepository.AllFor(_individual.Species.Name)).Returns(new[] { _ontogeny, new DatabaseOntogeny {
                                                                                                     Name = "tralala"
                                                                                                 }, });
            A.CallTo(() => _executionContext.Resolve <IOntogenyRepository>()).Returns(_ontogenyRepository);

            _subjectExpressionTask = new IndividualExpressionTask(_executionContext);

            _ontogenyTask = A.Fake <IOntogenyTask <Individual> >();
            sut           = new MoleculeExpressionTask <Individual>(_applicationController, _executionContext,
                                                                    _individualMoleculeFactoryResolver, _querySettingsMapper,
                                                                    _containerTask, _proteinExpressionDbPathManager,
                                                                    _ontogenyRepository, _transportContainerUpdater, _moleculeParameterRepository, _subjectExpressionTask, _ontogenyTask);
        }
コード例 #10
0
        protected override void Context()
        {
            _molecule = new IndividualEnzyme
            {
                DomainHelperForSpecs.ConstantParameterWithValue(0).WithName(CoreConstants.Parameters.ONTOGENY_FACTOR),
                DomainHelperForSpecs.ConstantParameterWithValue(0).WithName(CoreConstants.Parameters.ONTOGENY_FACTOR_GI)
            };

            _ontogeny           = new DatabaseOntogeny();
            _ontogenyRepository = A.Fake <IOntogenyRepository>();
            _entityPathResolver = new EntityPathResolverForSpecs();
            sut = new MoleculeOntogenyVariabilityUpdater(_ontogenyRepository, _entityPathResolver);
        }
コード例 #11
0
        protected override void Context()
        {
            _view = A.Fake <IShowOntogenyDataView>();
            _ontogenyRepository   = A.Fake <IOntogenyRepository>();
            _simpleChartPresenter = A.Fake <ISimpleChartPresenter>();
            _dimensionRepository  = A.Fake <IDimensionRepository>();
            _groupRepository      = A.Fake <IGroupRepository>();
            _displayUnitRetriever = A.Fake <IDisplayUnitRetriever>();

            _groupLiver = new Group {
                Name = "Liver"
            };
            _groupDuodenum = new Group {
                Name = "Duodenum"
            };
            _tableFormula = new TableFormula();
            _ontogeny     = new DatabaseOntogeny {
                SpeciesName = "toto"
            };
            _anotherOntogeny = new DatabaseOntogeny {
                SpeciesName = "toto"
            };
            _allOntongies = new List <Ontogeny> {
                _ontogeny, _anotherOntogeny
            };
            _ontoData = new List <OntogenyMetaData>();
            _ontoData.Add(new OntogenyMetaData {
                GroupName = "Liver"
            });
            _ontoData.Add(new OntogenyMetaData {
                GroupName = "Duodenum"
            });
            _allMetaData = new List <OntogenyMetaData>();

            A.CallTo(() => _dimensionRepository.AgeInYears).Returns(A.Fake <IDimension>());
            A.CallTo(() => _dimensionRepository.Fraction).Returns(DomainHelperForSpecs.FractionDimensionForSpecs());
            A.CallTo(() => _simpleChartPresenter.Plot(A <TableFormula> ._)).Returns(new CurveChart().WithAxes());
            A.CallTo(() => _simpleChartPresenter.Plot(A <DataRepository> ._, Scalings.Linear)).Returns(new CurveChart().WithAxes());
            A.CallTo(() => _groupRepository.GroupByName("Liver")).Returns(_groupLiver);
            A.CallTo(() => _groupRepository.GroupByName("Duodenum")).Returns(_groupDuodenum);
            A.CallTo(() => _ontogenyRepository.AllValuesFor(_ontogeny)).Returns(_ontoData);
            A.CallTo(() => _ontogenyRepository.AllFor(_ontogeny.SpeciesName)).Returns(_allOntongies);
            A.CallTo(() => _ontogenyRepository.AllValuesFor(_ontogeny, _groupLiver.Name)).Returns(_allMetaData);

            sut = new ShowOntogenyDataPresenter(_view, _ontogenyRepository, _simpleChartPresenter, _dimensionRepository, _groupRepository, _displayUnitRetriever);

            A.CallTo(() => _view.BindTo(A <ShowOntogenyDataDTO> ._))
            .Invokes(x => ShowOntogenyDataDTO = x.GetArgument <ShowOntogenyDataDTO>(0));
        }
コード例 #12
0
        protected override void Context()
        {
            _project          = new PKSimProject();
            _projectRetriever = A.Fake <IPKSimProjectRetriever>();
            _transporterContainerTemplateRepository = A.Fake <ITransporterContainerTemplateRepository>();
            A.CallTo(() => _projectRetriever.Current).Returns(_project);

            _compound1          = A.Fake <Compound>();
            _compound1.IsLoaded = false;
            _compound2          = new Compound {
                IsLoaded = true
            };
            _compound2.AddProcess(new EnzymaticProcess {
                MoleculeName = "ProjA", Name = "P1"
            });
            _compound2.AddProcess(new EnzymaticProcess {
                MoleculeName = "ProjC", Name = "P2"
            });
            _compound2.AddProcess(new EnzymaticProcess {
                MoleculeName = "ProjB", Name = "P3"
            });


            _ontogenyRepository          = A.Fake <IOntogenyRepository>();
            _moleculeParameterRepository = A.Fake <IMoleculeParameterRepository>();

            _expressionProfile          = A.Fake <ExpressionProfile>();
            _expressionProfile.IsLoaded = true;
            A.CallTo(() => _expressionProfile.MoleculeName).Returns("ProjE");

            _project.AddBuildingBlock(_compound1);
            _project.AddBuildingBlock(_compound2);
            _project.AddBuildingBlock(_expressionProfile);
            sut = new UsedMoleculeRepository(_projectRetriever, _ontogenyRepository, _moleculeParameterRepository, _transporterContainerTemplateRepository);

            var molParam1 = new MoleculeParameter {
                MoleculeName = "DbB"
            };
            var molParam2 = new MoleculeParameter {
                MoleculeName = "DbA"
            };

            A.CallTo(() => _moleculeParameterRepository.All()).Returns(new[] { molParam1, molParam2 });
            A.CallTo(() => _transporterContainerTemplateRepository.AllTransporterNames).Returns(new[] { "ATRANS1", "TRANS2" });

            A.CallTo(() => _ontogenyRepository.AllFor(CoreConstants.Species.HUMAN)).Returns(new[] { new DatabaseOntogeny {
                                                                                                        Name = "OntoC"
                                                                                                    } });
        }
コード例 #13
0
        protected override void Context()
        {
            _transportContainerUpdater = A.Fake <ITransportContainerUpdater>();
            _ontogenyRepository        = A.Fake <IOntogenyRepository>();
            _ontogenyTask = A.Fake <IOntogenyTask>();
            _moleculeParameterRepository = A.Fake <IMoleculeParameterRepository>();

            sut       = new MoleculeParameterTask(_moleculeParameterRepository, _transportContainerUpdater, _ontogenyRepository, _ontogenyTask);
            _molecule = new IndividualEnzyme {
                Name = "CYP3A4"
            };
            _molecule.Add(DomainHelperForSpecs.ConstantParameterWithValue(10).WithName(CoreConstants.Parameters.REFERENCE_CONCENTRATION));
            _molecule.Add(DomainHelperForSpecs.ConstantParameterWithValue(20).WithName(CoreConstants.Parameters.HALF_LIFE_LIVER));
            _molecule.Add(DomainHelperForSpecs.ConstantParameterWithValue(30).WithName(CoreConstants.Parameters.HALF_LIFE_INTESTINE));
        }
コード例 #14
0
        protected override Task Context()
        {
            _distributedTableFormulaMapper = A.Fake <DistributedTableFormulaMapper>();
            _ontogenyRepository            = A.Fake <IOntogenyRepository>();

            sut = new OntogenyMapper(_distributedTableFormulaMapper, _ontogenyRepository);

            _distributedTableFormula = new DistributedTableFormula();
            _snapshotTable           = new Snapshots.DistributedTableFormula();
            A.CallTo(() => _distributedTableFormulaMapper.MapToSnapshot(_distributedTableFormula)).Returns(_snapshotTable);

            _simulationSubject = A.Fake <ISimulationSubject>();

            return(Task.FromResult(true));
        }
コード例 #15
0
        public override void GlobalContext()
        {
            base.GlobalContext();
            _individual             = DomainFactoryForSpecs.CreateStandardIndividual();
            _moleculeExpressionTask = IoC.Resolve <IMoleculeExpressionTask <Individual> >();
            _ontogenyRepository     = IoC.Resolve <IOntogenyRepository>();

            _expressionProfileForEnzyme = DomainFactoryForSpecs.CreateExpressionProfile <IndividualEnzyme>();
            _moleculeExpressionTask.AddExpressionProfile(_individual, _expressionProfileForEnzyme);
            _individualEnzyme        = _individual.MoleculeByName <IndividualEnzyme>(_expressionProfileForEnzyme.MoleculeName);
            _expressionProfileEnzyme = _expressionProfileForEnzyme.Molecule.DowncastTo <IndividualEnzyme>();

            _expressionProfileForTransporter = DomainFactoryForSpecs.CreateExpressionProfile <IndividualTransporter>(moleculeName: "TRANS");
            _moleculeExpressionTask.AddExpressionProfile(_individual, _expressionProfileForTransporter);
            _individualTransporter        = _individual.MoleculeByName <IndividualTransporter>(_expressionProfileForTransporter.MoleculeName);
            _expressionProfileTransporter = _expressionProfileForTransporter.Molecule.DowncastTo <IndividualTransporter>();
        }
コード例 #16
0
        protected override void Context()
        {
            _individual = new Individual {
                OriginData = new OriginData {
                    Species = new Species().WithName("Human")
                }
            };
            _ontogeny = new DatabaseOntogeny {
                Name = "toto"
            };
            _executionContext = A.Fake <IExecutionContext>();
            _individualMoleculeFactoryResolver = A.Fake <IIndividualMoleculeFactoryResolver>();
            _ontogenyRepository = A.Fake <IOntogenyRepository>();
            var proteinFactory = A.Fake <IIndividualMoleculeFactory>();

            _expressionProfileUpdater = A.Fake <IExpressionProfileUpdater>();
            _moleculeContainer1       = new MoleculeExpressionContainer().WithName("C1");
            _moleculeContainer1.Add(DomainHelperForSpecs.ConstantParameterWithValue(5).WithName(CoreConstants.Parameters.REL_EXP));
            _moleculeContainer2 = new MoleculeExpressionContainer().WithName("C2");
            _moleculeContainer2.Add(DomainHelperForSpecs.ConstantParameterWithValue(5).WithName(CoreConstants.Parameters.REL_EXP));
            A.CallTo(() => _individualMoleculeFactoryResolver.FactoryFor <IndividualProtein>()).Returns(proteinFactory);
            _molecule = new IndividualEnzyme {
                Name = "CYP3A4"
            };
            _molecule.Add(_moleculeContainer1);
            _molecule.Add(_moleculeContainer2);
            A.CallTo(() => proteinFactory.AddMoleculeTo(_individual, A <string> ._)).Returns(_molecule);

            A.CallTo(() => _ontogenyRepository.AllFor(_individual.Species.Name)).Returns(new[] { _ontogeny, new DatabaseOntogeny {
                                                                                                     Name = "tralala"
                                                                                                 }, });
            A.CallTo(() => _executionContext.Resolve <IOntogenyRepository>()).Returns(_ontogenyRepository);

            _subjectExpressionTask = new IndividualExpressionTask(_executionContext);

            sut = new MoleculeExpressionTask <Individual>(
                _executionContext,
                _individualMoleculeFactoryResolver,
                _subjectExpressionTask,
                _expressionProfileUpdater
                );
        }
コード例 #17
0
 public MoleculeExpressionTask(IApplicationController applicationController, IExecutionContext executionContext,
                               IIndividualMoleculeFactoryResolver individualMoleculeFactoryResolver,
                               IMoleculeToQueryExpressionSettingsMapper queryExpressionSettingsMapper,
                               IContainerTask containerTask,
                               IProteinExpressionsDatabasePathManager proteinExpressionsDatabasePathManager,
                               IOntogenyRepository ontogenyRepository,
                               ITransportContainerUpdater transportContainerUpdater,
                               ISimulationSubjectExpressionTask <TSimulationSubject> simulationSubjectExpressionTask,
                               IOntogenyTask <TSimulationSubject> ontogenyTask,
                               IMoleculeParameterTask moleculeParameterTask)
 {
     _applicationController             = applicationController;
     _executionContext                  = executionContext;
     _individualMoleculeFactoryResolver = individualMoleculeFactoryResolver;
     _queryExpressionSettingsMapper     = queryExpressionSettingsMapper;
     _containerTask = containerTask;
     _proteinExpressionsDatabasePathManager = proteinExpressionsDatabasePathManager;
     _ontogenyRepository              = ontogenyRepository;
     _transportContainerUpdater       = transportContainerUpdater;
     _simulationSubjectExpressionTask = simulationSubjectExpressionTask;
     _ontogenyTask          = ontogenyTask;
     _moleculeParameterTask = moleculeParameterTask;
 }
コード例 #18
0
 public OntogenySelectionPresenter(IOntogenySelectionView view, IOntogenyRepository ontogenyRepository, IOntogenyTask <TSimulationSubject> ontogenyTask)
     : base(view)
 {
     _ontogenyTask  = ontogenyTask;
     _allOntogenies = ontogenyRepository.AllFor(CoreConstants.Species.Human);
 }
コード例 #19
0
 public OntogenySelectionPresenter(IOntogenySelectionView view, IOntogenyRepository ontogenyRepository, IOntogenyTask ontogenyTask)
     : base(view)
 {
     _ontogenyTask  = ontogenyTask;
     _allOntogenies = ontogenyRepository.AllFor(CoreConstants.Species.HUMAN);
 }
コード例 #20
0
 public MoleculeOntogenyVariabilityUpdater(IOntogenyRepository ontogenyRepository, IEntityPathResolver entityPathResolver)
 {
     _ontogenyRepository = ontogenyRepository;
     _entityPathResolver = entityPathResolver;
 }
コード例 #21
0
 public OntogenyFactorsRetriever(IOntogenyRepository ontogenyRepository)
 {
     _ontogenyRepository = ontogenyRepository;
 }
コード例 #22
0
 public IndividualOntogenyTask(IExecutionContext executionContext, IApplicationController applicationController, IDataImporter dataImporter, IDimensionRepository dimensionRepository, IOntogenyRepository ontogenyRepository, IEntityTask entityTask, IFormulaFactory formulaFactory) : base(executionContext, applicationController, dataImporter, dimensionRepository, ontogenyRepository, entityTask, formulaFactory)
 {
 }
コード例 #23
0
 protected override void Context()
 {
     _ontogenyRepository = A.Fake <IOntogenyRepository>();
     sut            = new OntogenyFactorsRetriever(_ontogenyRepository);
     _moleculeNames = new List <MoleculeOntogeny>();
 }
コード例 #24
0
ファイル: OntogenyMapper.cs プロジェクト: yvkashyap/PK-Sim
 public OntogenyMapper(DistributedTableFormulaMapper distributedTableFormulaMapper, IOntogenyRepository ontogenyRepository)
 {
     _distributedTableFormulaMapper = distributedTableFormulaMapper;
     _ontogenyRepository            = ontogenyRepository;
 }