Пример #1
0
        protected override void Context()
        {
            sut = new ExpressionContainersRetriever();
            var objectPathFactory  = new ObjectPathFactoryForSpecs();
            var entityPathResolver = new EntityPathResolverForSpecs();

            _liver.Add(_intLiver);
            _liver.Add(_cellLiver);
            _liver.Add(_plsLiver);
            _liver.Add(_bcLiver);
            _liver.Add(_endoLiver);

            _kidney.Add(_intKidney);
            _kidney.Add(_cellKidney);
            _kidney.Add(_plsKidney);
            _kidney.Add(_bcKidney);
            _kidney.Add(_endoKidney);

            _lumen.Add(_duodenum);
            _organism.Add(_liver);
            _organism.Add(_kidney);
            _organism.Add(_lumen);

            _protein = new IndividualEnzyme();
            _protein.Add(new MoleculeExpressionContainer {
                OrganPath = objectPathFactory.CreateObjectPathFrom(CoreConstants.Compartment.BloodCells)
            }.WithName(CoreConstants.Compartment.BloodCells));
            _protein.Add(new MoleculeExpressionContainer {
                OrganPath = objectPathFactory.CreateObjectPathFrom(CoreConstants.Compartment.Plasma)
            }.WithName(CoreConstants.Compartment.Plasma));
            _protein.Add(new MoleculeExpressionContainer {
                OrganPath = objectPathFactory.CreateObjectPathFrom(CoreConstants.Compartment.VascularEndothelium)
            }.WithName(CoreConstants.Compartment.VascularEndothelium));
            _protein.Add(new MoleculeExpressionContainer {
                OrganPath = entityPathResolver.ObjectPathFor(_liver)
            }.WithName(CoreConstants.Organ.Liver));
            _protein.Add(new MoleculeExpressionContainer {
                OrganPath = entityPathResolver.ObjectPathFor(_kidney)
            }.WithName(CoreConstants.Organ.Kidney));
            _protein.Add(new MoleculeExpressionContainer {
                OrganPath = entityPathResolver.ObjectPathFor(_lumen), GroupName = CoreConstants.Groups.GI_LUMEN, ContainerName = _duodenum.Name
            }.WithName(CoreConstants.ContainerName.LumenSegmentNameFor("Duodenum")));
        }
Пример #2
0
        public static Individual CreateIndividual()
        {
            var originData = new OriginData();

            originData.SubPopulation     = new SubPopulation();
            originData.Species           = new Species().WithName("Species");
            originData.Gender            = new Gender().WithName("Gender");
            originData.SpeciesPopulation = new SpeciesPopulation().WithName("Population");
            var pvv      = new ParameterValueVersion().WithName("PVVName");
            var category = new ParameterValueVersionCategory().WithName("CategoryName");

            category.Add(pvv);
            originData.SubPopulation.AddParameterValueVersion(pvv);
            var organism   = new Organism().WithName("Organism").WithId("OrganismId");
            var organLiver = new Organ().WithName(CoreConstants.Organ.Liver).WithId("LiverId");

            organLiver.OrganType = OrganType.Liver;
            var periportal = new Compartment().WithName(CoreConstants.Compartment.Periportal).WithId("PeriportalId");

            periportal.Add(new Container().WithName(CoreConstants.Compartment.Intracellular).WithId("PeriportalIntracellular"));
            var pericentral = new Compartment().WithName(CoreConstants.Compartment.Pericentral).WithId("PericentralId");

            pericentral.Add(new Container().WithName(CoreConstants.Compartment.Intracellular).WithId("PericentralIntracellular"));
            organLiver.Add(periportal);
            organLiver.Add(pericentral);

            var organKidney = new Organ().WithName(CoreConstants.Organ.Kidney).WithId("KidneyId");

            organKidney.OrganType = OrganType.Kidney;
            organKidney.Add(new Compartment {
                Visible = true
            }.WithName(CoreConstants.Compartment.Plasma).WithId("KidneyPlasma"));
            var lumen = new Organ().WithName("GiTract").WithId("GiTract");

            lumen.OrganType = OrganType.Lumen;

            var duodenum  = new Compartment().WithName("Duodenum").WithId("Duodenum");
            var caecum    = new Compartment().WithName("Caecum").WithId("Caecum");
            var dimension = Constants.Dimension.NO_DIMENSION;

            var parameterLiver = new PKSimParameter().WithName("PLiver").WithId("PLiverId").WithFormula(new ExplicitFormula("1").WithId("1")).WithDimension(dimension);

            parameterLiver.Info = new ParameterValueMetaData {
                DefaultValue = 1
            };
            var parameterKidney = new PKSimParameter().WithName("PKidney").WithId("PKidneyId").WithFormula(new ExplicitFormula("2").WithId("2")).WithDimension(dimension);

            parameterKidney.Info = new ParameterValueMetaData {
                DefaultValue = 2
            };
            var parameterOrganism = new PKSimParameter().WithName(ParameterInOrganism).WithId("POrganismId").WithFormula(new ExplicitFormula("3").WithId("3")).WithDimension(dimension);

            parameterOrganism.Info = new ParameterValueMetaData {
                DefaultValue = 3
            };
            organLiver.Add(parameterLiver);
            organKidney.Add(parameterKidney);
            organism.Add(organLiver);
            organism.Add(organKidney);
            organism.Add(lumen);
            organism.Add(parameterOrganism);
            lumen.Add(duodenum);
            lumen.Add(caecum);

            var individual = new Individual {
                OriginData = originData
            }.WithName("Individual").WithId("IndividualId");

            individual.Add(organism);

            return(individual);
        }
Пример #3
0
        public static Individual CreateIndividual(string speciesName = "Species")
        {
            var originData = new OriginData
            {
                SubPopulation = new SubPopulation(),
                Species       = new Species {
                    DisplayName = speciesName, Id = speciesName
                }.WithName(speciesName),
                Gender     = new Gender().WithName("Gender"),
                Population = new SpeciesPopulation().WithName("Population"),
            };

            var pvv      = new ParameterValueVersion().WithName("PVVName");
            var category = new ParameterValueVersionCategory().WithName("CategoryName");

            category.Add(pvv);
            originData.SubPopulation.AddParameterValueVersion(pvv);
            var organism   = new Organism().WithName(Constants.ORGANISM).WithId("OrganismId");
            var organLiver = new Organ().WithName(CoreConstants.Organ.LIVER).WithId("LiverId");

            organLiver.OrganType = OrganType.TissueOrgansNotInGiTract;
            var periportal = new Compartment().WithName(CoreConstants.Compartment.PERIPORTAL).WithId("PeriportalId");

            periportal.Add(new Container().WithName(CoreConstants.Compartment.INTRACELLULAR).WithId("PeriportalIntracellular"));
            var pericentral = new Compartment().WithName(CoreConstants.Compartment.PERICENTRAL).WithId("PericentralId");

            pericentral.Add(new Container().WithName(CoreConstants.Compartment.INTRACELLULAR).WithId("PericentralIntracellular"));
            organLiver.Add(periportal);
            organLiver.Add(pericentral);

            var organKidney = new Organ().WithName(CoreConstants.Organ.KIDNEY).WithId("KidneyId");

            organKidney.OrganType = OrganType.TissueOrgansNotInGiTract;
            organKidney.Add(new Compartment {
                Visible = true
            }.WithName(CoreConstants.Compartment.PLASMA).WithId("KidneyPlasma"));
            var lumen = new Organ().WithName("GiTract").WithId("GiTract");

            lumen.OrganType = OrganType.Lumen;

            var duodenum  = new Compartment().WithName("Duodenum").WithId("Duodenum");
            var caecum    = new Compartment().WithName("Caecum").WithId("Caecum");
            var dimension = Constants.Dimension.NO_DIMENSION;

            var parameterLiver = new PKSimParameter().WithName("PLiver").WithId("PLiverId").WithFormula(new ExplicitFormula("1").WithId("1")).WithDimension(dimension);

            parameterLiver.Info = new ParameterValueMetaData {
                DefaultValue = 1
            };
            var parameterKidney = new PKSimParameter().WithName("PKidney").WithId("PKidneyId").WithFormula(new ExplicitFormula("2").WithId("2")).WithDimension(dimension);

            parameterKidney.Info = new ParameterValueMetaData {
                DefaultValue = 2
            };
            var parameterOrganism = new PKSimParameter().WithName(ParameterInOrganism).WithId("POrganismId").WithFormula(new ExplicitFormula("3").WithId("3")).WithDimension(dimension);

            parameterOrganism.Info = new ParameterValueMetaData {
                DefaultValue = 3
            };
            organLiver.Add(parameterLiver);
            organKidney.Add(parameterKidney);
            organism.Add(organLiver);
            organism.Add(organKidney);
            organism.Add(lumen);
            organism.Add(parameterOrganism);
            lumen.Add(duodenum);
            lumen.Add(caecum);

            var individual = new Individual {
                OriginData = originData
            }.WithName("Individual").WithId("IndividualId");

            individual.Add(organism);

            return(individual);
        }