public void should_have_converted_the_transporter_as_expected()
        {
            var influx = _individual.MoleculeByName <IndividualTransporter>("T1_Influx");

            influx.TransportType.ShouldBeEqualTo(TransportType.Influx);

            //checking that it is not set to the default Efflux and that a conversion occurred
            var allTransporterContainers = _individual.AllMoleculeContainersFor <TransporterExpressionContainer>(influx);

            allTransporterContainers.Any(x => x.TransportDirection.ToString().Contains("Efflux")).ShouldBeFalse();

            var efflux_apical_bbb = _individual.MoleculeByName <IndividualTransporter>("T4_Efflux_Apical_BBB");

            efflux_apical_bbb.TransportType.ShouldBeEqualTo(TransportType.Efflux);
        }
Ejemplo n.º 2
0
        private IReadOnlyCollection <InducedProcess> allInducedProcessesFor(IndividualTransporter transporter, Individual individual)
        {
            var inducedProcessCache      = new Cache <string, InducedProcess>(x => x.Name, x => null);
            var allTransporterContainers = individual.AllMoleculeContainersFor <TransporterExpressionContainer>(transporter)
                                           .Where(x => x.TransportDirection != TransportDirectionId.None).ToList();

            //Global containers surrogate do not have a logical container associated
            var allOrganNames = new HashSet <string>(allTransporterContainers.Select(x => x.LogicalContainerName).Where(x => !string.IsNullOrEmpty(x)));

            foreach (var transporterContainer in allTransporterContainers)
            {
                //Logical containerName is empty for surrogate containers
                var logicalContainer = transporterContainer.LogicalContainerName;

                var allTransportTemplates = _transportTemplateRepository.All()
                                            .Where(x => x.TransportDirection == transporterContainer.TransportDirection);

                //a logical container is defined. We are dealing with a localized transporter
                if (!string.IsNullOrEmpty(logicalContainer))
                {
                    //For apical transport for Lumen => Mucosa, the compartment is the name of our mapping
                    allTransportTemplates = allTransportTemplates
                                            .Where(x => (x.SourceOrgan == logicalContainer || x.SourceCompartment == logicalContainer));
                }

                foreach (var transportTemplate in allTransportTemplates)
                {
                    var inducedProcess = inducedProcessCache[transportTemplate.ProcessName];
                    if (inducedProcess == null)
                    {
                        inducedProcess = new InducedProcess {
                            Name = transportTemplate.ProcessName
                        };
                        inducedProcess.AddOrgansToExclude(allOrganNames);
                        inducedProcessCache.Add(inducedProcess);
                    }

                    // For lumen transport. The source organ or target organ is in fact defined as a compartment
                    inducedProcess.AddSourceOrgan(transportTemplate.SourceOrgan.IsLumen() ? transportTemplate.SourceCompartment : transportTemplate.SourceOrgan);
                    inducedProcess.AddTargetOrgan(transportTemplate.TargetOrgan.IsLumen() ? transportTemplate.TargetCompartment : transportTemplate.TargetOrgan);
                }
            }

            return(inducedProcessCache);
        }
Ejemplo n.º 3
0
        private PathCache <TransporterExpressionContainer> allTransporterExpressionContainerFor(Individual individual, IndividualMolecule molecule)
        {
            var allTransporterExpressionContainer = individual.AllMoleculeContainersFor <TransporterExpressionContainer>(molecule);

            return(_containerTask.PathCacheFor(allTransporterExpressionContainer));
        }