From 866305ffa728cb6e90f16015b0b881ba6cb0362e Mon Sep 17 00:00:00 2001 From: Lei Yan Date: Sat, 22 Feb 2014 21:57:13 -0600 Subject: On branch master --- .../datasampledir/load_genotypes/sample.geno | 26 ++++++++++------------ wqflask/maintenance/dataset/datastructure.py | 10 +++++++++ wqflask/maintenance/dataset/load_genotypes.py | 12 +++++----- 3 files changed, 29 insertions(+), 19 deletions(-) (limited to 'wqflask/maintenance/dataset') diff --git a/wqflask/maintenance/dataset/datasampledir/load_genotypes/sample.geno b/wqflask/maintenance/dataset/datasampledir/load_genotypes/sample.geno index 6dad9ace..618e4833 100644 --- a/wqflask/maintenance/dataset/datasampledir/load_genotypes/sample.geno +++ b/wqflask/maintenance/dataset/datasampledir/load_genotypes/sample.geno @@ -1,14 +1,12 @@ -@name:BXD -@type:riset -@mat:B -@pat:D -@het:H -@unk:U -Chr Locus cM Mb BXD1 BXD2 BXD5 BXD6 BXD8 -1 rs6269442 0 3.482275 B B D D D -1 rs6365999 0 4.811062 B B D D D -1 rs6376963 0.895 5.008089 B B D D D -1 rs3677817 1.185 5.176058 B B D D D -1 rs8236463 2.081 5.579193 B B D D D -1 rs6333200 2.081 6.217921 B B D D D -1 rs6298633 2.367 6.820241 B B D D D +@name:BXD +@type:riset +@mat:B +@pat:D +@het:H +@unk:U +Chr Locus cM Mb BXD1 BXD2 BXD5 BXD6 BXD8 +1 rs6269442 0 3.482275 B B D D D +2 rs6365999 0.3 4.811062 B B D D D +3 rs6376963 0.895 5.008089 B B D D D +4 rs3677817 1.185 5.176058 B B D D D +5 rs8236463 2.081 5.579193 B B D D D diff --git a/wqflask/maintenance/dataset/datastructure.py b/wqflask/maintenance/dataset/datastructure.py index fd9386b3..0ee4b4ab 100644 --- a/wqflask/maintenance/dataset/datastructure.py +++ b/wqflask/maintenance/dataset/datastructure.py @@ -55,6 +55,16 @@ def get_species(inbredsetid): """ cursor.execute(sql, (inbredsetid)) return cursor.fetchone() + +def get_genofreeze_byinbredsetid(inbredsetid): + cursor, con = utilities.get_cursor() + sql = """ + SELECT GenoFreeze.`Id`, GenoFreeze.`Name`, GenoFreeze.`FullName`, GenoFreeze.`InbredSetId` + FROM GenoFreeze + WHERE GenoFreeze.`InbredSetId`=%s + """ + cursor.execute(sql, (inbredsetid)) + return cursor.fetchone() def get_nextdataid_phenotype(): cursor, con = utilities.get_cursor() diff --git a/wqflask/maintenance/dataset/load_genotypes.py b/wqflask/maintenance/dataset/load_genotypes.py index 0ae2c5cd..bca99b95 100644 --- a/wqflask/maintenance/dataset/load_genotypes.py +++ b/wqflask/maintenance/dataset/load_genotypes.py @@ -38,12 +38,14 @@ def main(argv): strainnames = line.split()[4:] strains = datastructure.get_strains_bynames(speciesid, strainnames) continue + # geno line cells = line.split() - Chr = cells[0] - Locus = cells[1] - cM = cells[2] - Mb = cells[3] - print len(cells) + chr = cells[0] + locus = cells[1] + cm = cells[2] + mb = cells[3] + values = cells[4:] + print values return # open db -- cgit v1.2.3