From 392db369c0a56c182855acdc3ac932f8d9ac9181 Mon Sep 17 00:00:00 2001 From: Johan Zicola Date: Fri, 19 Jul 2019 15:31:45 +0200 Subject: [PATCH 1/2] Fix the bug with function remove_temp(). Also made a pull request on Lister github --- tepid/tepid.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tepid/tepid.py b/tepid/tepid.py index dca9d7c..4b65ecb 100644 --- a/tepid/tepid.py +++ b/tepid/tepid.py @@ -1002,6 +1002,7 @@ def discover_pe(options): imput split reads bam file must be name sorted TE annotation can be gzipped """ + print "Processing "+options.name print "Running paired-end mode" print 'Estimating mean insert size and coverage' @@ -1123,10 +1124,12 @@ def discover_pe(options): remove_temp(options) +# Fix bug by adding "./" in argument of x.startswith +# otherwise the files in list temp are not matching def remove_temp(options): if options.keep is False: temp = glob('./*.temp') - mytempfiles = [x for x in temp if x.startswith(options.prefix)] + mytempfiles = [x for x in temp if x.startswith("./"+options.prefix)] for i in mytempfiles: os.remove(i) os.remove(options.prefix + 'disc_sorted.bam') @@ -1155,6 +1158,7 @@ def discover_se(options): """ Single-end mode """ + print "Processing "+options.name print "Running single-end mode" cov = calc_cov(options.conc, 100000, 120000) @@ -1227,4 +1231,4 @@ def discover_se(options): with open("tepid_discover_log_{}.txt".format(options.name), 'a') as logfile: logfile.write("tepid-discover finished normally at {}\n".format(ctime())) - remove_temp(options) \ No newline at end of file + remove_temp(options) From 236cd6d514d760c05cdc197dbe3de598bf05984c Mon Sep 17 00:00:00 2001 From: Johan Zicola Date: Mon, 22 Jul 2019 10:08:21 +0200 Subject: [PATCH 2/2] Fix the bug for samtools sort due to old syntax usage --- Scripts/tepid-map | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Scripts/tepid-map b/Scripts/tepid-map index a033fcb..15156e2 100644 --- a/Scripts/tepid-map +++ b/Scripts/tepid-map @@ -69,7 +69,7 @@ map () { rm "${fname}.split.sam" echo "Sorting alignment" - samtools sort -@ $proc "${fname}_unsort.bam" "${fname}" + samtools sort -@ $proc "${fname}_unsort.bam" -o "${fname}.bam" rm "${fname}_unsort.bam" echo "Indexing alignment"