aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPjotr Prins2023-08-12 08:12:58 -0500
committerPjotr Prins2023-08-12 08:12:58 -0500
commitecb9b3ab07a8d938d11138cb83751dbc5ce14b1a (patch)
treeee8bf4714ddaee46c12730b80c7be0e50e7ce8c2
parent14314aca35d7d7283ac20bec5234df41db8a1bc3 (diff)
downloadgn-transform-databases-ecb9b3ab07a8d938d11138cb83751dbc5ce14b1a.tar.gz
Add comment on Strain table
-rwxr-xr-xexamples/dump-species-metadata.scm42
1 files changed, 42 insertions, 0 deletions
diff --git a/examples/dump-species-metadata.scm b/examples/dump-species-metadata.scm
index 3e429f0..a7e242a 100755
--- a/examples/dump-species-metadata.scm
+++ b/examples/dump-species-metadata.scm
@@ -55,6 +55,48 @@
(set gnt:family (field Species Family))
(set gnt:organism (ontology 'taxon: (field Species TaxonomyId)))))
+#!
+
+The ProbeData table contains StrainID.
+
+MariaDB [db_webqtl]> select * from ProbeData limit 2;
++--------+----------+---------+
+| Id | StrainId | value |
++--------+----------+---------+
+| 503636 | 42 | 11.6906 |
+| 503636 | 43 | 11.4205 |
++--------+----------+---------+
+
+Likewise
+
+MariaDB [db_webqtl]> select * from ProbeSetData wher limit 2;
++----+----------+-------+
+| Id | StrainId | value |
++----+----------+-------+
+| 1 | 1 | 5.742 |
+| 1 | 2 | 5.006 |
++----+----------+-------+
+
+To get at the strain use
+
+MariaDB [db_webqtl]> select * from Strain where Id=1 limit 15;
++----+--------+--------+-----------+--------+-------+
+| Id | Name | Name2 | SpeciesId | Symbol | Alias |
++----+--------+--------+-----------+--------+-------+
+| 1 | B6D2F1 | B6D2F1 | 1 | NULL | NULL |
++----+--------+--------+-----------+--------+-------+
+
+A typical query may look like
+
+SELECT Strain.Name, Strain.Id FROM Strain, Species
+WHERE Strain.Name IN f{create_in_clause(self.samplelist)}
+AND Strain.SpeciesId=Species.Id
+AND Species.name = %s, (self.group.species,)
+
+At this point it is not very clear how Name, Name2, Symbol and Alias are used.
+
+!#
+
(define-dump dump-strain
(tables (Strain
(left-join Species "ON Strain.SpeciesId = Species.SpeciesId")))