Exemplo n.º 1
0
 protected override void Context()
 {
     base.Context();
     _moleculeBuildingBlock = new MoleculeBuildingBlock();
     _moleculeBuildingBlock.Add(new MoleculeBuilder().WithName("Drug"));
     _moleculeBuildingBlock.Add(new MoleculeBuilder().WithName("Transporter"));
 }
Exemplo n.º 2
0
        public override void GlobalContext()
        {
            base.GlobalContext();
            _simulation            = DomainFactoryForSpecs.CreateDefaultSimulation();
            _moleculeBuildingBlock = new MoleculeBuildingBlock();
            var compoundProperties = _simulation.CompoundPropertiesList.First();

            _compoundName = compoundProperties.Compound.Name;
            _moleculeBuildingBlock.Add(new MoleculeBuilder {
                Name = _compoundName, QuantityType = QuantityType.Drug
            });
            _moleculeBuildingBlock.Add(new MoleculeBuilder {
                Name = "Enzyme", QuantityType = QuantityType.Enzyme
            });
            _moleculeBuildingBlock.Add(new MoleculeBuilder {
                Name = "Metabolite", QuantityType = QuantityType.Metabolite
            });
            _moleculeBuildingBlock.Add(new MoleculeBuilder {
                Name = "Protein", QuantityType = QuantityType.OtherProtein
            });
            var specificBindingSelection = new ProcessSelection {
                CompoundName = _compoundName, MoleculeName = "Protein", ProcessName = "Specific Binding"
            };
            var metabolizationSelection = new EnzymaticProcessSelection {
                CompoundName = _compoundName, MoleculeName = "Protein", ProcessName = "Metabolism"
            };

            _complexProductName    = specificBindingSelection.ProductName(CoreConstants.Molecule.Complex);
            _metaboliteProductName = specificBindingSelection.ProductName(CoreConstants.Molecule.Metabolite);
            _moleculeBuildingBlock.Add(new MoleculeBuilder {
                Name = _complexProductName, QuantityType = QuantityType.Complex
            });
            compoundProperties.Processes.SpecificBindingSelection.AddPartialProcessSelection(specificBindingSelection);
            compoundProperties.Processes.MetabolizationSelection.AddPartialProcessSelection(metabolizationSelection);
        }
Exemplo n.º 3
0
 protected override void Context()
 {
     base.Context();
     _moleculeBuildingBlock = new MoleculeBuildingBlock {
         Id = "1"
     };
     _moleculeBuildingBlock.Add(A.Fake <IMoleculeBuilder>().WithId("2"));
     _moleculeBuildingBlock.Add(A.Fake <IMoleculeBuilder>().WithId("3"));
 }
Exemplo n.º 4
0
        /// <summary>
        ///     Creates one dummy Species for each Compartment.
        /// </summary>
        private void CreateDummySpecies()
        {
            foreach (var child in GetMainTopContainer().GetAllChildren <IContainer>())
            {
                if (child.Name == Constants.MOLECULE_PROPERTIES)
                {
                    continue;
                }
                var mbuilder = _moleculeBuilderFactory.Create(MoleculeBuildingBlock.FormulaCache)
                               .WithName(SBMLConstants.SBML_DUMMYSPECIES + child.Name)
                               .WithDescription(SBMLConstants.SBML_DUMMYSPECIES + child.Name);

                MoleculeBuildingBlock.Add(mbuilder);
                _sbmlInformation.DummyNameContainerDictionary[mbuilder.Name] = child.Name;
            }
        }
Exemplo n.º 5
0
 protected override void Context()
 {
     base.Context();
     _moleculeBuildingBlock = new MoleculeBuildingBlock();
     sut.Edit(_moleculeBuildingBlock);
     _moleculeBuilder = new MoleculeBuilder();
     _moleculeBuildingBlock.Add(_moleculeBuilder);
 }
 protected override void Context()
 {
     sut              = new FormulaUsageChecker();
     _formula         = new ExplicitFormula("1").WithName("Test Formula");
     _buildingBlock   = new MoleculeBuildingBlock();
     _moleculeBuilder = new MoleculeBuilder().WithName("Container");
     _moleculeBuilder.DefaultStartFormula = A.Fake <IFormula>();
     _buildingBlock.Add(_moleculeBuilder);
 }
Exemplo n.º 7
0
 protected override void Context()
 {
     _moleculeBuildingBlock = new MoleculeBuildingBlock();
     _molecule1             = new MoleculeBuilder {
         Name = "M1", IsFloating = true
     };
     _molecule2 = new MoleculeBuilder {
         Name = "M2", IsFloating = true
     };
     _molecule3 = new MoleculeBuilder {
         Name = "M3", IsFloating = false
     };
     _moleculeBuildingBlock.Add(_molecule1);
     _moleculeBuildingBlock.Add(_molecule2);
     _moleculeBuildingBlock.Add(_molecule3);
     _validParameter              = new Parameter().WithFormula(new ConstantFormula(5)).WithName("_validParameter");
     _invalidParameter            = new Parameter().WithFormula(new ConstantFormula(double.NaN)).WithName("_invalidParameter");
     _invalidParameterWithFormula = new Parameter().WithFormula(new ExplicitFormula("0/0")).WithName("_invalidParameterWithFormula");
     _molecule3.AddParameter(_invalidParameter);
     sut = new MoleculeBuildingBlockValidator();
 }
        protected override void Context()
        {
            base.Context();
            _molecules = new MoleculeBuildingBlock();
            _molecules.Add(createMoleculeBuilder("Drug"));
            _molecules.Add(createMoleculeBuilder("Other"));
            _spatialStrcuture = new SpatialStructure();
            _spatialStrcuture.NeighborhoodsContainer            = new Container().WithName(Constants.NEIGHBORHOODS);
            _spatialStrcuture.GlobalMoleculeDependentProperties = new Container();
            _globalParameter = new Parameter().WithName("GlobalMoleculeParameter").WithFormula(new ConstantFormula(2));
            _spatialStrcuture.GlobalMoleculeDependentProperties.Add(_globalParameter);
            var topcontainer = new Container().WithName("Organism");
            var organ        = new Container().WithName("Organ").WithParentContainer(topcontainer);
            var mp           = new Container().WithName(Constants.MOLECULE_PROPERTIES).WithParentContainer(organ);

            new Parameter().WithName("Local").WithFormula(new ConstantFormula(3)).WithParentContainer(mp);
            _spatialStrcuture.AddTopContainer(topcontainer);
            var neighborhood = new NeighborhoodBuilder().WithName("A2B");
            var nmp          = new Container().WithName(Constants.MOLECULE_PROPERTIES).WithParentContainer(neighborhood);

            new Parameter().WithName("Hallo").WithFormula(new ConstantFormula(4)).WithParentContainer(nmp);
            _spatialStrcuture.AddNeighborhood(neighborhood);
        }
Exemplo n.º 9
0
        private void addMoleculeToBuildingBlock(IMoleculeBuilder moleculeBuilder, CompoundProperties compoundProperties)
        {
            if (_allMoleculeNames.Contains(moleculeBuilder.Name))
            {
                throw new TwoMoleculesWithSameNameException(moleculeBuilder.Name);
            }

            _allMoleculeNames.Add(moleculeBuilder.Name);

            //set the used calculation method according to current settings
            if (compoundProperties != null)
            {
                _moleculeCalculationRetriever.AllMoleculeCalculationMethodsUsedBy(compoundProperties).Each(moleculeBuilder.AddUsedCalculationMethod);
            }

            _moleculeBuildingBlock.Add(moleculeBuilder);
        }
Exemplo n.º 10
0
        public override void GlobalContext()
        {
            base.GlobalContext();

            var compound   = DomainFactoryForSpecs.CreateStandardCompound();
            var individual = DomainFactoryForSpecs.CreateStandardIndividual();
            var protocol   = DomainFactoryForSpecs.CreateStandardIVBolusProtocol();

            _simulation            = _simulation = DomainFactoryForSpecs.CreateSimulationWith(individual, compound, protocol, CoreConstants.Model.TwoPores) as IndividualSimulation;
            _moleculeBuildingBlock = new MoleculeBuildingBlock();
            var compoundProperties = _simulation.CompoundPropertiesList.First();

            _compoundName = compoundProperties.Compound.Name;
            _moleculeBuildingBlock.Add(new MoleculeBuilder {
                Name = _compoundName, QuantityType = QuantityType.Drug
            });

            _observerName = CoreConstants.Observer.ObserverNameFrom("Whole Organ incl. FcRn_Complex", _compoundName);
        }
Exemplo n.º 11
0
 protected override void Context()
 {
     base.Context();
     _eventBuildingBlock = new EventGroupBuildingBlock().WithName("Events");
     _applicationBuilder = new ApplicationBuilder().WithName("Tada");
     _applicationBuilder.MoleculeName = "B";
     _eventBuildingBlock.Add(_applicationBuilder);
     _molceuleBuidingBlock = new MoleculeBuildingBlock().WithName("Molecules");
     _molceuleBuidingBlock.Add(new MoleculeBuilder().WithName("A"));
     _buildConfiguration                      = new BuildConfiguration();
     _buildConfiguration.Molecules            = _molceuleBuidingBlock;
     _buildConfiguration.MoleculeStartValues  = new MoleculeStartValuesBuildingBlock();
     _buildConfiguration.Observers            = new ObserverBuildingBlock();
     _buildConfiguration.ParameterStartValues = new ParameterStartValuesBuildingBlock();
     _buildConfiguration.PassiveTransports    = new PassiveTransportBuildingBlock();
     _buildConfiguration.Reactions            = new ReactionBuildingBlock();
     _buildConfiguration.SpatialStructure     = new SpatialStructure();
     _buildConfiguration.EventGroups          = _eventBuildingBlock;
 }
Exemplo n.º 12
0
        public override void GlobalContext()
        {
            base.GlobalContext();

            var compound   = DomainFactoryForSpecs.CreateStandardCompound();
            var individual = DomainFactoryForSpecs.CreateStandardIndividual();
            var protocol   = DomainFactoryForSpecs.CreateStandardIVBolusProtocol();

            _simulation            = DomainFactoryForSpecs.CreateSimulationWith(individual, compound, protocol, CoreConstants.Model.TwoPores).DowncastTo <IndividualSimulation>();
            _moleculeBuildingBlock = new MoleculeBuildingBlock();
            var compoundProperties = _simulation.CompoundPropertiesList.First();

            _compoundName = compoundProperties.Compound.Name;
            _moleculeBuildingBlock.Add(new MoleculeBuilder {
                Name = _compoundName, QuantityType = QuantityType.Drug
            });

            _observerName = CoreConstants.Observer.ObserverNameFrom(CoreConstantsForSpecs.Observer.WHOLE_ORGAN_INCLUDING_FCRN_COMPLEX, _compoundName);
        }
        protected override void Context()
        {
            _moleculeBuildingBlock = new MoleculeBuildingBlock {
                Id = "Id"
            };
            _builder = new MoleculeBuilder {
                Name = "name"
            };
            _moleculeBuildingBlock.Add(_builder);
            _spatialStructure = new SpatialStructure();
            var firstContainer = new Container {
                Name = _firstPathEntry
            };

            firstContainer.Add(new Container {
                Name = "Path", Mode = _containerMode
            });
            _spatialStructure.Add(firstContainer);
            _moleculeStartValue = new MoleculeStartValue {
                Name = _moleculeName, ContainerPath = new ObjectPath("The", "Path")
            };

            sut = new MoleculeResolver();
        }