-
Notifications
You must be signed in to change notification settings - Fork 50
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
Fixes #2302 bug influx #2327
Conversation
There was a problem hiding this 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 :)
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) | ||
); |
There was a problem hiding this comment.
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 keytab_active_transport_types.transport_type => tab_process_types.process_type
)
And then define foreign keytab_known_transporters_containers.transport_type => tab_active_transport_types
- Actually it would be better to define a new table "tab_active_transport_types" with just 1 column "transport_type"
- membrane: constraint (Apical, Basolateral)
If you want, we can merge as is and I will add the FKs/Constraints after that.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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'); |
There was a problem hiding this comment.
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"
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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','','',''); |
There was a problem hiding this comment.
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?
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; | ||
} |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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
Most comments here are unrelated to the PR. Can you create an issue for those and fix (even better )? |
@Yuri05 Done: |
No description provided.