Exemplo n.º 1
0
        public void SynchronizeExpressionProfileWithSimulationSubject(ExpressionProfile expressionProfile, ISimulationSubject simulationSubject)
        {
            var moleculeInIndividual = simulationSubject.MoleculeByName(expressionProfile.MoleculeName);

            var(targetMolecule, targetIndividual) = expressionProfile;

            // SimulationSubject To ExpressionProfile. We do not update the parameter origin id in the target entities (expression profile)
            synchronizeExpressionProfiles(moleculeInIndividual, simulationSubject, targetMolecule, targetIndividual, updateParameterOriginId: false);

            //however we need to make sure that we reference the expression profile parameter in the source individual
            var allExpressionProfileParameters = allMoleculeParametersFor(targetIndividual, targetMolecule);
            var allIndividualParameters        = allMoleculeParametersFor(simulationSubject, moleculeInIndividual);

            _parameterIdUpdater.UpdateParameterIds(allExpressionProfileParameters, allIndividualParameters);
        }
Exemplo n.º 2
0
        private IEventGroupBuilder createFormulationAsEventGroupBuilderFrom(Formulation formulation)
        {
            var formulationBuilder = _objectBaseFactory.Create <IEventGroupBuilder>();

            formulationBuilder.UpdatePropertiesFrom(formulation, _cloneManagerForBuildingBlock);
            foreach (var parameter in formulation.AllParameters())
            {
                var builderParameter = _cloneManagerForBuildingBlock.Clone(parameter);
                //reset the origin in any case since it might have been set by clone
                builderParameter.Origin.ParameterId = string.Empty;
                formulationBuilder.Add(builderParameter);
            }

            _parameterIdUpdater.UpdateBuildingBlockId(formulationBuilder, formulation);
            _parameterIdUpdater.UpdateParameterIds(formulation, formulationBuilder);

            if (formulation.FormulationType.Equals(CoreConstants.Formulation.Particles))
            {
                setParticleRadiusDistributionParametersToLockedAndInvisible(formulationBuilder);
            }

            return(formulationBuilder);
        }