From 0e947ddcceb2d7d28bc0b3b929a74d876b7783da Mon Sep 17 00:00:00 2001 From: Ryan Welch Date: Thu, 19 Jan 2017 19:27:42 -0500 Subject: [PATCH] Don't cleanup temp files if --debug is enabled; remove temp debug messages --- swiss/PlinkLDFinder.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/swiss/PlinkLDFinder.py b/swiss/PlinkLDFinder.py index 96de22d..ae8807d 100644 --- a/swiss/PlinkLDFinder.py +++ b/swiss/PlinkLDFinder.py @@ -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: @@ -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)))