From ecb9b3ab07a8d938d11138cb83751dbc5ce14b1a Mon Sep 17 00:00:00 2001 From: Pjotr Prins Date: Sat, 12 Aug 2023 08:12:58 -0500 Subject: Add comment on Strain table --- examples/dump-species-metadata.scm | 42 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) 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"))) -- cgit v1.2.3