Skip to content

Commit f3a545c

Browse files
committed
added few more regex strings
1 parent 8a629c5 commit f3a545c

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

pypiper/ngstk.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1333,8 +1333,8 @@ def topHat_map(self, input_fastq, output_dir, genome, transcriptome, cpus):
13331333
return cmd
13341334

13351335
def picard_mark_duplicates(self, input_bam, output_bam, metrics_file, temp_dir="."):
1336-
transient_file = re.sub("\.bam$", "", output_bam) + ".dups.nosort.bam"
1337-
output_bam = re.sub("\.bam$", "", output_bam)
1336+
transient_file = re.sub(r"\.bam$", "", output_bam) + ".dups.nosort.bam"
1337+
output_bam = re.sub(r"\.bam$", "", output_bam)
13381338
cmd1 = self.tools.java + " -Xmx" + self.pm.javamem
13391339
cmd1 += " -jar `which MarkDuplicates.jar`"
13401340
cmd1 += " INPUT={0}".format(input_bam)
@@ -1406,7 +1406,7 @@ def shift_reads(self, input_bam, genome, output_bam):
14061406
return cmd
14071407

14081408
def sort_index_bam(self, input_bam, output_bam):
1409-
tmp_bam = re.sub("\.bam", ".sorted", input_bam)
1409+
tmp_bam = re.sub(r"\.bam", ".sorted", input_bam)
14101410
cmd1 = self.tools.samtools + " sort {0} {1}".format(input_bam, tmp_bam)
14111411
cmd2 = "mv {0}.bam {1}".format(tmp_bam, output_bam)
14121412
cmd3 = self.tools.samtools + " index {0}".format(output_bam)
@@ -1638,7 +1638,7 @@ def bam_to_bigwig(
16381638
# addjust fragment length dependent on read size and real fragment size
16391639
# (right now it asssumes 50bp reads with 180bp fragments)
16401640
cmds = list()
1641-
transient_file = os.path.abspath(re.sub("\.bigWig", "", output_bigwig))
1641+
transient_file = os.path.abspath(re.sub(r"\.bigWig", "", output_bigwig))
16421642
cmd1 = self.tools.bedtools + " bamtobed -i {0} |".format(input_bam)
16431643
if not tagmented:
16441644
cmd1 += (
@@ -2050,7 +2050,7 @@ def parse_bowtie_stats(self, stats_file):
20502050
line = [
20512051
i for i in range(len(content)) if " reads; of these:" in content[i]
20522052
][0]
2053-
stats["readCount"] = re.sub("\D.*", "", content[line])
2053+
stats["readCount"] = re.sub(r"\D.*", "", content[line])
20542054
if 7 > len(content) > 2:
20552055
line = [
20562056
i

0 commit comments

Comments
 (0)