aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2024-07-02 10:17:42 -0500
committerFrederick Muriuki Muriithi2024-07-02 10:17:42 -0500
commit5568c4ee34d2539af7a6e880861dd90cca9fb78f (patch)
treee294880cc050d571264899a4df22bc4d57d90d49 /scripts
parenta68fe177ae41f2e58a64b3f8dcf3f825d004eeca (diff)
downloadgn-uploader-5568c4ee34d2539af7a6e880861dd90cca9fb78f.tar.gz
Ensure no duplicated values for the query.
Diffstat (limited to 'scripts')
-rw-r--r--scripts/rqtl2/install_genotypes.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/scripts/rqtl2/install_genotypes.py b/scripts/rqtl2/install_genotypes.py
index d0731a2..68ae365 100644
--- a/scripts/rqtl2/install_genotypes.py
+++ b/scripts/rqtl2/install_genotypes.py
@@ -40,11 +40,12 @@ def insert_markers(dbconn: mdb.Connection,
"VALUES (%(speciesid)s, %(marker)s, %(marker)s, %(chr)s, %(pos)s) "
"ON DUPLICATE KEY UPDATE SpeciesId=SpeciesId",
tuple({
- "speciesid": speciesid,
- "marker": marker,
- "chr": mdata.get(marker, {}).get("chr"),
- "pos": mdata.get(marker, {}).get("pos")
- } for marker in markers))
+ (speciesid, marker): {
+ "speciesid": speciesid,
+ "marker": marker,
+ "chr": mdata.get(marker, {}).get("chr"),
+ "pos": mdata.get(marker, {}).get("pos")
+ } for marker in markers}.items()))
return cursor.rowcount
def insert_individuals(dbconn: mdb.Connection,