-
Notifications
You must be signed in to change notification settings - Fork 16
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
Primary and foreign keys #44
Comments
The reason I did not made Note however that I would not like to force primary/foreign key constraints to database columns to keep the design of the tables as simple as possible... but we can discuss on that obviously. |
OK. But if Another way to do it would require/generate a unique ID, use that for reference, and then have another column with the external ID? |
What about the use case that somebody wants to generate a "superduper merged DB" from HMDB, ChEBI, KEGG etc. Then the |
In the end, the I also thought of using the InChiKey as primary identifier, but that does not work out, as even HMDB has several compounds with the same InChiKEy, but different compound ids. If you want we can force the compound id to be unique in the |
Allow me to share my experience. Making up my own merged database (HMDB+MoNA+Nist+, ...) I used two variables: compound_id (primary key) and old_compound_id (primigenius id, for traceability reasons). |
Thanks for the feedback @jmbadia ! And based on which identifier/information you merge compounds across databases? Is it the InChiKey? |
Yes, and it is something our group still talk about because we know we have under the same 'compound' different isomers (and it hurts). But at the end we have assumed a very pragmatic approach: A) It is a information that we just can not have. The only way to differentiate among compounds in a DB would be considering "isomeric smiles" (not available usually) or "name" (very inconsistent) values. So actually it would be very difficult to know which isomer is every compound's DB Obviously, we might as well not have merged compounds |
BTW we also merge spectra, but it is no so controversial. Same (relative) spectral matrix & same nuclear spectral metadata=> same spectra |
Wouldn't it make sense to set the
compound_id
in thecompound
table as a primary key and unique?Then
synonym
could refer to the key. All other additional tables added with new features would require the foreign key reference.I don't know if it has many practical applications but I like the idea of having this explicit and potential error if tables are added without proper reference.
The text was updated successfully, but these errors were encountered: