Skip to content

Commit

Permalink
Don't cleanup temp files if --debug is enabled; remove temp debug mes…
Browse files Browse the repository at this point in the history
…sages
  • Loading branch information
welchr committed Jan 20, 2017
1 parent 2483521 commit 0e947dd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions swiss/PlinkLDFinder.py
Expand Up @@ -294,9 +294,8 @@ def cleanup():
delfile = tmpout + ext
try:
os.remove(delfile)
print "Deleted {}".format(delfile)
except:
print "Tried to delete {} but failed".format(delfile)
pass

# Loop over VCF lines, changing the ID to be a more descriptive EPACTS ID (chr:pos_ref/alt_id).
for line in proc_tabix.stdout:
Expand Down Expand Up @@ -358,7 +357,8 @@ def cleanup():
df.rename(columns = lambda x: x.replace("SNP","VARIANT"),inplace=True)

# Run cleanup
cleanup()
if not SWISS_DEBUG:
cleanup()

# Slight modification for swiss: it expects return to be dictionary of variant --> (dprime,rsq)
ld_data = dict(zip(df.VARIANT_B,df.apply(lambda x: tuple([x["DP"],x["R2"]]),axis=1)))
Expand Down

0 comments on commit 0e947dd

Please sign in to comment.