private string membraneContainerDisplayName(MembraneLocation membraneLocation, TransporterExpressionContainerDTO containerDTO) { return($"{containerDTO.ContainerPathDTO.DisplayName} ({membraneLocation})"); }
public void MembraneLocationChanged(MembraneLocation membraneLocation) { AddCommand(_moleculeExpressionTask.SetMembraneLocationFor(_protein, membraneLocation)); }
public void SetMembraneLocation(TransporterExpressionContainerDTO transporterExpressionContainerDTO, MembraneLocation membraneLocation) { AddCommand(_moleculeExpressionTask.SetMembraneLocationFor(transporterContainerFrom(transporterExpressionContainerDTO), _transporter.TransportType, membraneLocation)); }
public ICommand SetMembraneLocationFor(TransporterExpressionContainer transporterContainer, TransportType transportType, MembraneLocation membraneLocation) { return(new SetMembraneTypeCommand(transporterContainer, transportType, membraneLocation, _executionContext).Run(_executionContext)); }
public ICommand SetMembraneLocationFor(IndividualProtein protein, MembraneLocation membraneLocation) { return(new SetProteinMembraneLocationCommand(protein, membraneLocation, _executionContext).Run(_executionContext)); }
protected override void PerformExecuteWith(IExecutionContext context) { _oldMembraneLocation = _protein.MembraneLocation; _protein.MembraneLocation = _newMembraneLocation; Description = PKSimConstants.Command.SetProteinMembraneLocationDescription(_oldMembraneLocation.ToString(), _newMembraneLocation.ToString()); }
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); }
private string membraneContainerDisplayName(MembraneLocation membraneLocation, TransporterExpressionContainerDTO containerDTO) { return(string.Format("{0} ({1})", containerDTO.ContainerPathDTO.DisplayName, membraneLocation)); }
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)); }
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); }
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; }
private static void validateTransporterMembrane(IndividualTransporter transporter, MembraneLocation membraneLocation) { CoreConstants.Compartment.LiverZones.Each(z => transporter.AllExpressionsContainers().FindByName(z).MembraneLocation.ShouldBeEqualTo(membraneLocation)); }
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 }