diff options
author | Frederick Muriuki Muriithi | 2024-07-02 10:17:42 -0500 |
---|---|---|
committer | Frederick Muriuki Muriithi | 2024-07-02 10:17:42 -0500 |
commit | 5568c4ee34d2539af7a6e880861dd90cca9fb78f (patch) | |
tree | e294880cc050d571264899a4df22bc4d57d90d49 | |
parent | a68fe177ae41f2e58a64b3f8dcf3f825d004eeca (diff) | |
download | gn-uploader-5568c4ee34d2539af7a6e880861dd90cca9fb78f.tar.gz |
Ensure no duplicated values for the query.
-rw-r--r-- | scripts/rqtl2/install_genotypes.py | 11 |
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, |