private string membraneContainerDisplayName(MembraneLocation membraneLocation, TransporterExpressionContainerDTO containerDTO)
 {
     return($"{containerDTO.ContainerPathDTO.DisplayName} ({membraneLocation})");
 }
 public void MembraneLocationChanged(MembraneLocation membraneLocation)
 {
     AddCommand(_moleculeExpressionTask.SetMembraneLocationFor(_protein, membraneLocation));
 }
Exemplo n.º 3
0
 public void SetMembraneLocation(TransporterExpressionContainerDTO transporterExpressionContainerDTO, MembraneLocation membraneLocation)
 {
     AddCommand(_moleculeExpressionTask.SetMembraneLocationFor(transporterContainerFrom(transporterExpressionContainerDTO), _transporter.TransportType, membraneLocation));
 }
Exemplo n.º 4
0
 public ICommand SetMembraneLocationFor(TransporterExpressionContainer transporterContainer, TransportType transportType, MembraneLocation membraneLocation)
 {
     return(new SetMembraneTypeCommand(transporterContainer, transportType, membraneLocation, _executionContext).Run(_executionContext));
 }
Exemplo n.º 5
0
 public ICommand SetMembraneLocationFor(IndividualProtein protein, MembraneLocation membraneLocation)
 {
     return(new SetProteinMembraneLocationCommand(protein, membraneLocation, _executionContext).Run(_executionContext));
 }
Exemplo n.º 6
0
 protected override void PerformExecuteWith(IExecutionContext context)
 {
     _oldMembraneLocation      = _protein.MembraneLocation;
     _protein.MembraneLocation = _newMembraneLocation;
     Description = PKSimConstants.Command.SetProteinMembraneLocationDescription(_oldMembraneLocation.ToString(), _newMembraneLocation.ToString());
 }
Exemplo n.º 7
0
        public void UpdateTransporterFromTemplate(ITransporterExpressionContainer transporterContainer, string species, MembraneLocation membraneLocation, TransportType transportType)
        {
            //we need to retrieve the process name for the given MembraneTupe/Process Type combo
            var templateToUse = _transporterContainerTemplateRepository.TransportersFor(species, transporterContainer.Name)
                                .Where(x => x.MembraneLocation == membraneLocation)
                                .FirstOrDefault(x => x.TransportType == transportType);

            //That should never happen, otherwise we would have a transporter container with an unknown process
            if (templateToUse == null)
            {
                throw new PKSimException(PKSimConstants.Error.CouldNotFindTransporterFor(transporterContainer.Name, membraneLocation.ToString(), transportType.ToString()));
            }

            transporterContainer.UpdatePropertiesFrom(templateToUse);
        }
Exemplo n.º 8
0
 private string membraneContainerDisplayName(MembraneLocation membraneLocation, TransporterExpressionContainerDTO containerDTO)
 {
     return(string.Format("{0} ({1})", containerDTO.ContainerPathDTO.DisplayName, membraneLocation));
 }
Exemplo n.º 9
0
 public SetProteinMembraneLocationCommand(PKSim.Core.Model.IndividualProtein protein, MembraneLocation membraneLocation, IExecutionContext context)
 {
     _protein             = protein;
     BuildingBlockId      = context.BuildingBlockIdContaining(protein);
     _newMembraneLocation = membraneLocation;
     ObjectType           = PKSimConstants.ObjectTypes.Protein;
     CommandType          = PKSimConstants.Command.CommandTypeEdit;
     _proteinId           = _protein.Id;
     context.UpdateBuildinBlockPropertiesInCommand(this, context.BuildingBlockContaining(_protein));
 }
Exemplo n.º 10
0
 public SetMembraneTypeCommand(TransporterExpressionContainer transporterContainer, TransportType transportType, MembraneLocation newMembraneLocation, IExecutionContext context)
 {
     _transporterContainer   = transporterContainer;
     _transportType          = transportType;
     _transporterContainerId = _transporterContainer.Id;
     _newMembraneLocation    = newMembraneLocation;
     _individual             = context.BuildingBlockContaining(_transporterContainer).DowncastTo <Individual>();
     BuildingBlockId         = _individual.Id;
     _oldMembraneLocation    = _transporterContainer.MembraneLocation;
     ObjectType  = PKSimConstants.ObjectTypes.Transporter;
     CommandType = PKSimConstants.Command.CommandTypeEdit;
     context.UpdateBuildinBlockPropertiesInCommand(this, _individual);
 }
Exemplo n.º 11
0
 public SetTransportTypeCommand(TransporterExpressionContainer transporterContainer, TransportType oldTransportType, TransportType newTransportType, MembraneLocation membraneLocationToUse, IExecutionContext context)
 {
     _transporterContainer   = transporterContainer;
     _membraneLocationToUse  = membraneLocationToUse;
     _transporterContainerId = _transporterContainer.Id;
     _individual             = context.BuildingBlockContaining(transporterContainer).DowncastTo <Individual>();
     BuildingBlockId         = _individual.Id;
     _newTransportType       = newTransportType;
     _oldTransportType       = oldTransportType;
     ObjectType  = PKSimConstants.ObjectTypes.Transporter;
     CommandType = PKSimConstants.Command.CommandTypeEdit;
     context.UpdateBuildinBlockPropertiesInCommand(this, _individual);
     Visible = false;
 }
Exemplo n.º 12
0
 private static void validateTransporterMembrane(IndividualTransporter transporter, MembraneLocation membraneLocation)
 {
     CoreConstants.Compartment.LiverZones.Each(z => transporter.AllExpressionsContainers().FindByName(z).MembraneLocation.ShouldBeEqualTo(membraneLocation));
 }
Exemplo n.º 13
0
        public static Localization ConvertToLocalization(TissueLocation tissueLocation, MembraneLocation membraneLocation,
                                                         IntracellularVascularEndoLocation vascularEndoLocation)
        {
            switch (tissueLocation)
            {
            case TissueLocation.Interstitial:
                return(Localization.Interstitial | Localization.BloodCellsIntracellular | Localization.VascMembraneTissueSide);

            case TissueLocation.Intracellular:
                var vacEndoLocalization = vascularEndoLocation == IntracellularVascularEndoLocation.Endosomal
                  ? Localization.VascEndosome
                  : Localization.VascMembraneTissueSide;
                return(Localization.Intracellular | Localization.BloodCellsIntracellular | vacEndoLocalization);

            case TissueLocation.ExtracellularMembrane:
                var membLocation = membraneLocation == MembraneLocation.Apical
                  ? Localization.VascMembranePlasmaSide
                  : Localization.VascMembraneTissueSide;
                return(Localization.Interstitial | Localization.BloodCellsMembrane | membLocation);

            default:
                throw new ArgumentOutOfRangeException(nameof(tissueLocation), tissueLocation, null);
            }
        }
        public static void ConvertMembraneLocationToParameterFraction(IReadOnlyList <TransporterExpressionContainer> transporterExpressionContainers, MembraneLocation membraneLocation)
        {
            var firstContainer = transporterExpressionContainers[0];

            if (firstContainer.LogicalContainer.IsBrain())
            {
                //Is there by construction
                var plasma      = transporterExpressionContainers.First(x => x.CompartmentName == PLASMA);
                var fractionBBB = plasma.Parameter(FRACTION_EXPRESSED_AT_BLOOD_BRAIN_BARRIER);
                switch (membraneLocation)
                {
                //we need to set the value of f_bbb to zero
                case MembraneLocation.Tissue:
                    fractionBBB.Value = 0;
                    return;

                //we need to set the value of f_bbb to 1
                case MembraneLocation.BloodBrainBarrier:
                    fractionBBB.Value = 1;
                    return;
                }
            }

            if (firstContainer.LogicalContainer.IsOrganWithLumen())
            {
                //Is there by construction
                var intracellular           = transporterExpressionContainers.First(x => x.CompartmentName == INTRACELLULAR);
                var fractionExpressedApical = intracellular.Parameter(FRACTION_EXPRESSED_APICAL);
                switch (membraneLocation)
                {
                //we need to set the value of f_expressed_apical to zero
                case MembraneLocation.Basolateral:
                    fractionExpressedApical.Value = 0;
                    return;

                //we need to set the value of f_bbb to 1
                case MembraneLocation.Apical:
                    fractionExpressedApical.Value = 1;
                    return;
                }
            }


            //this should never happen
        }