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

2328 db #2333

Merged
merged 4 commits into from
Sep 14, 2022
Merged

2328 db #2333

merged 4 commits into from
Sep 14, 2022

Conversation

Yuri05
Copy link
Member

@Yuri05 Yuri05 commented Sep 13, 2022

No description provided.

@Yuri05 Yuri05 requested a review from msevestre September 13, 2022 10:18
INSERT INTO tab_active_transport_types VALUES('BiDirectional');
INSERT INTO tab_active_transport_types VALUES('Efflux');
INSERT INTO tab_active_transport_types VALUES('Influx');
INSERT INTO tab_active_transport_types VALUES('PgpLike');
Copy link
Member Author

Choose a reason for hiding this comment

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

Added the new table tab_active_transport_types with the 4 currently available active transport types.
So actually it's just a subset of tab_process_types

CREATE TABLE [tab_known_transporters](
[gene] text REFERENCES [tab_protein_names]([protein]) ON UPDATE CASCADE,
[species] text REFERENCES [tab_species]([species]) ON UPDATE CASCADE,
[transport_type] text REFERENCES [tab_active_transport_types]([transport_type]) ON UPDATE CASCADE,
Copy link
Member Author

Choose a reason for hiding this comment

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

Added FKs for gene and transport_type

[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]) ON UPDATE CASCADE,
FOREIGN KEY([container_type], [container_name]) REFERENCES [tab_container_names]([container_type], [container_name]) ON UPDATE CASCADE,
Copy link
Member Author

Choose a reason for hiding this comment

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

Added FK for container_type+container_name

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]) ON UPDATE CASCADE,
FOREIGN KEY([container_type], [container_name]) REFERENCES [tab_container_names]([container_type], [container_name]) ON UPDATE CASCADE,
CHECK(membrane IN ('Apical', 'Basolateral', 'BloodBrainBarrier', 'Tissue')));
Copy link
Member Author

Choose a reason for hiding this comment

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

Added membrane as constraint.
Was thinking about defining another new table (membrane_types or so) - but currently this is the only place where the membrane is used, so I kept is as check constraint.

Copy link
Member

Choose a reason for hiding this comment

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

yep/ Not use anywhere else

Copy link
Member

Choose a reason for hiding this comment

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

In fact, if we agree to remove BloodBrainBarrier and TIssue and use Apical and Basolateral, then we can only keep the two entries here

[transport_direction] text CONSTRAINT [tab_transport_directions_pk] PRIMARY KEY,
[display_name] text NOT NULL,
[description] text NOT NULL,
[icon] text);
Copy link
Member Author

Choose a reason for hiding this comment

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

removed the weird default value from the icon column

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]) ON UPDATE CASCADE,
FOREIGN KEY([container_type], [container_name]) REFERENCES [tab_container_names]([container_type], [container_name]) ON UPDATE CASCADE,
CHECK(membrane IN ('Apical', 'Basolateral', 'BloodBrainBarrier', 'Tissue')));
Copy link
Member

Choose a reason for hiding this comment

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

yep/ Not use anywhere else

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]) ON UPDATE CASCADE,
FOREIGN KEY([container_type], [container_name]) REFERENCES [tab_container_names]([container_type], [container_name]) ON UPDATE CASCADE,
CHECK(membrane IN ('Apical', 'Basolateral', 'BloodBrainBarrier', 'Tissue')));
Copy link
Member

Choose a reason for hiding this comment

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

In fact, if we agree to remove BloodBrainBarrier and TIssue and use Apical and Basolateral, then we can only keep the two entries here

@Yuri05
Copy link
Member Author

Yuri05 commented Sep 13, 2022

In fact, if we agree to remove BloodBrainBarrier and TIssue and use Apical and Basolateral, then we can only keep the two entries here

OK, BloodBrainBarrier is the default so it can be removed indeed. But we cannot remove "Tissue" (or how should we indicate then that the Transporter in brain is NOT blood brain Barrier ? )

@msevestre
Copy link
Member

We use apical or basolateral (tissue means one or the other, I added it as comment in the code). Since it's only used in a switch statement...I just need to change it and done

@Yuri05
Copy link
Member Author

Yuri05 commented Sep 13, 2022

I added it as comment in the code

Where is it?

@Yuri05
Copy link
Member Author

Yuri05 commented Sep 14, 2022

ok, merging for now.
@msevestre Let's create another issue for the constraint. I'm still not quite sure why we should keep only Apical/Basolateral in the constraint.

@Yuri05 Yuri05 merged commit c4ab32a into Open-Systems-Pharmacology:develop Sep 14, 2022
@Yuri05 Yuri05 deleted the 2328_DB branch April 5, 2023 08:30
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