Skip to content

Commit

Permalink
fixed bug in -f blast_i
Browse files Browse the repository at this point in the history
  • Loading branch information
Tyler K. Chafin committed Aug 13, 2019
1 parent 4a7d6f1 commit 65ef3c0
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions mrbait/manage_bait_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def clearGFF(conn):

################################################################################

#function to reset all targets to passing
#function to reset all targets to passing
def resetTargets(conn):
cur = conn.cursor()
sql = '''
Expand All @@ -110,7 +110,7 @@ def resetTargets(conn):
cur.execute(sql)
conn.commit()

#function to reset all baits to passing
#function to reset all baits to passing
def resetBaits(conn):
cur = conn.cursor()
sql = '''
Expand Down Expand Up @@ -658,17 +658,17 @@ def updateChosenFromPandas(conn, df):
cur.execute("DROP TABLE IF EXISTS t")
conn.commit()

#Updates
#Updates
def updateLociMask(conn, newMask):
cur = conn.cursor()

#convert to data frame
#convert to data frame
df = pd.DataFrame(newMask, columns=("id", "mask"))
#create temporary table

#create temporary table
df.to_sql('m', conn, if_exists='replace')
#print(pd.read_sql_query("SELECT * FROM loci", conn))

#Hacky way to do it, but SQlite doesn't support FROM clause in UPDATEs...
sql_update = '''
UPDATE
Expand Down Expand Up @@ -1333,7 +1333,7 @@ def removeBaitsByWhitelist(conn, whitelist):
SET
pass = 0
WHERE
NOT EXISTS(SELECT * FROM ttt WHERE tt.baitid = regions.baitid)
NOT EXISTS(SELECT * FROM ttt WHERE ttt.baitid = regions.baitid)
'''
cur.execute(sql_update)
#Clear up the temp table t
Expand Down

0 comments on commit 65ef3c0

Please sign in to comment.