Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #2302 bug influx #2327

Merged
merged 8 commits into from
Sep 12, 2022
Merged

Fixes #2302 bug influx #2327

merged 8 commits into from
Sep 12, 2022

Conversation

msevestre
Copy link
Member

No description provided.

@msevestre msevestre changed the title WIP #2302 add failing tests Fixes #2302 bug influx Sep 9, 2022
Copy link
Member Author

@msevestre msevestre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Yuri05 As discussed. Splitted everything into two tables, removed the container table
Seems to be what we need. Makes also much more sense to me :)

Comment on lines +90920 to +90932
CREATE TABLE tab_known_transporters_containers
(
gene text,
species text,
container_type text,
container_name text,
transport_type text,
membrane text,
constraint tab_known_transporters_containers_pk
primary key (gene, species, container_type, container_name),
constraint tab_known_transporters_containers_tab_known_transporters_gene_species_fk
foreign key (gene, species) references tab_known_transporters (gene, species)
);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing in the table definition:

  • Foreign Key {container_type, container_name} => tab_container_names
  • transport_type: constraint with allowed types (Influx, Efflux, ...)
    • Actually it would be better to define a new table "tab_active_transport_types" with just 1 column "transport_type"
      (with foreign key tab_active_transport_types.transport_type => tab_process_types.process_type)
      And then define foreign key tab_known_transporters_containers.transport_type => tab_active_transport_types
  • membrane: constraint (Apical, Basolateral)

If you want, we can merge as is and I will add the FKs/Constraints after that.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes please. I just copied the table that we had before so it somewhat should have taken over the relationship. I don't think we had constraints on columns at all

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Membrane is also brain barrier etc.

INSERT INTO tab_known_transporters_containers VALUES('ABCC6','Human','COMPARTMENT','Periportal','Efflux','Basolateral');
INSERT INTO tab_known_transporters_containers VALUES('SLC22A9','Human','COMPARTMENT','Pericentral','Efflux','Basolateral');
INSERT INTO tab_known_transporters_containers VALUES('SLC22A9','Human','COMPARTMENT','Periportal','Efflux','Basolateral');
CREATE TABLE tab_transport_directions (transport_direction text CONSTRAINT tab_transport_directions_pk PRIMARY KEY, display_name text NOT NULL, description text NOT NULL, icon text DEFAULT Influx);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

...icon text DEFAULT Influx
The default value for the icon does not really make sense here, right?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was from before. No idea what this is.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know, just noticed it only now :)

INSERT INTO tab_transport_directions VALUES('EffluxBloodCellsToPlasma','Efflux Blood Cells to Plasma','Efflux transport from blood cells to blood plasma across blood cell membrane','Efflux');
INSERT INTO tab_transport_directions VALUES('InfluxInterstitialToIntracellular','Influx Interstitial to Intracellular','Influx transport from interstitial into intracellular space across cell membrane','Influx');
INSERT INTO tab_transport_directions VALUES('EffluxIntracellularToInterstitial','Efflux Intracellular to Interstitial','Efflux transport from intracellular into interstitial space across cell membrane','Efflux');
INSERT INTO tab_transport_directions VALUES('InfluxLumenToMucosaIntracellular','Influx Lumen To Mucosa/Intracellular','Active uptake from gastrointestinal lumen into mucosal cells','Influx');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'Influx Lumen To Mucosa/Intracellular'
Replace "To" with "to"

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also stuff from before. If you look at the dump, this is a dump o the db

Copy link
Member

@Yuri05 Yuri05 Sep 12, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same. Old error, but I didn't notice it before

INSERT INTO tab_transport_directions VALUES('InfluxBrainPlasmaToInterstitial','Influx Plasma to Interstitial','Influx transport from blood plasma to interstitial space across the blood-brain-barrier','Influx');
INSERT INTO tab_transport_directions VALUES('EffluxBrainInterstitialToPlasma','Efflux Interstitial to Plasma','Efflux transport from interstitial space to blood plasma across the blood-brain-barrier','Efflux');
INSERT INTO tab_transport_directions VALUES('PgpBrainInterstitialToPlasma','[DEPRECATED] Pgp Interstitial to plasma','[DEPRECATED] Pgp transport from interstitial space to blood plasma across the blood-brain-barrier accounting for the structural peculiarity of P-gp transporter. Will be removed in version 12 of the software','Pgp');
INSERT INTO tab_transport_directions VALUES('None','','','');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need this "None"-entry?

Comment on lines 45 to 53
var transportType = _transporterTemplateRepository.TransportTypeFor(speciesName, transporterName);
transporter.TransportType = transportType;

if (!_transporterTemplateRepository.HasTransporterTemplateFor(speciesName, transporterName))
{
//No template was found for the given name. Raise event warning
_eventPublisher.PublishEvent(new NoTransporterTemplateAvailableEvent(transporter));
return;
}
Copy link
Member

@Yuri05 Yuri05 Sep 12, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are the lines 45-46 called BEFORE the lines 48-53?
I would expect the opposite order: transporter type from template is set only if the template exists

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well there is still a default being returned if not found. in the TemplateRepository. ,Maywe we should rename to TransportTypeOrDefault

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, would be good to rename it, otherwise the code here looking strange (without going in the called functions)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, just created some additional issues.
If you rename TransportTypeFor=>TransportTypeOrDefault we can merge I think

@msevestre
Copy link
Member Author

Most comments here are unrelated to the PR. Can you create an issue for those and fix (even better )?

@msevestre
Copy link
Member Author

@Yuri05 Done:
Merging

@msevestre msevestre merged commit 2ee6143 into develop Sep 12, 2022
@msevestre msevestre deleted the 2302-bug-influx branch September 12, 2022 14:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants