From a0aa7bbf473506ff513c7a5557654f2bf05b0df9 Mon Sep 17 00:00:00 2001 From: Munyoki Kilyungi Date: Wed, 7 Sep 2022 11:03:32 +0300 Subject: Use "%s" instead of "%2.6f" or "%d" in query. * wqflask/wqflask/interval_analyst/GeneUtil.py (loadGenes): Use "%s". --- wqflask/wqflask/interval_analyst/GeneUtil.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/wqflask/wqflask/interval_analyst/GeneUtil.py b/wqflask/wqflask/interval_analyst/GeneUtil.py index 9e56f66b..780a4db1 100644 --- a/wqflask/wqflask/interval_analyst/GeneUtil.py +++ b/wqflask/wqflask/interval_analyst/GeneUtil.py @@ -82,12 +82,12 @@ def loadGenes(chrName, diffCol, startMb, endMb, species='mouse'): if diffCol and othSpec == 'mouse': cursor.execute( "SELECT count(*) FROM BXDSnpPosition " - "WHERE Chr = %s AND Mb >= %2.6f AND " - "Mb < %2.6f AND StrainId1 = %d " - "AND StrainId2 = %d", - (chrName, f"{newdict['TxStart']:2.6f}", - f"{newdict['TxEnd']:2.6f}", - diffCol[0], diffCol[1])) + "WHERE Chr = %s AND Mb >= %s AND " + "Mb < %s AND StrainId1 = %s " + "AND StrainId2 = %s", + (chrName, f"{newdict['TxStart']:2.6f}", + f"{newdict['TxEnd']:2.6f}", + diffCol[0], diffCol[1])) if snp_count := cursor.fetchone(): newdict2["snpCount"] = snp_count[0] -- cgit v1.2.3