Commit bcb65b3 1 parent fd51e21 commit bcb65b3 Copy full SHA for bcb65b3
File tree 1 file changed +9
-0
lines changed
1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change 11
11
from pathlib import Path
12
12
import tempfile
13
13
import pandas as pd
14
+ import glob
14
15
from snakemake .shell import shell
15
16
16
17
def move_files (extension ):
@@ -129,6 +130,14 @@ def allfastq(directory):
129
130
# Move bam files to output directory
130
131
move_files ("bam" )
131
132
133
+ if not paired :
134
+ # Rename bam files so that they end with .bam and not -ext300.bam
135
+ bam_files = glob .glob (f"results/bam/{ directory } /*-ext300.bam" )
136
+ assert len (bam_files ) > 0 , "No single-end bam files found to remove -ext300 from file name..."
137
+ for bam in bam_files :
138
+ new_name = bam .replace ("-ext300" , "" )
139
+ os .rename (bam , new_name )
140
+
132
141
# Destroy temporary directory
133
142
print (f"Cleaning up temporary directory { temp_dir .name } " )
134
143
temp_dir .cleanup ()
You can’t perform that action at this time.
0 commit comments