Commit 8f3220b2 authored by Penom Nom's avatar Penom Nom
Browse files

Fix bug with prefix and only one fastq by read.

parent 5d6a01a8
......@@ -130,8 +130,12 @@ class BWA (Analysis):
# Create dictionary : key = prefix and value = the output bam
outputs_path = Utils.get_filepath_by_prefix( self.bam_files, self.group_prefix)
# Merges bam
# Merges bam or rename
for prefix in self.group_prefix:
[cmd_inputs_pattern, next_arg_number] = Utils.get_argument_pattern(groups_path[prefix], 1)
samtoolsmerge = ShellFunction( self.get_exec_path("samtools") + ' merge ${' + str(next_arg_number) + '} ' + cmd_inputs_pattern + " 2>> " + self.stderr, cmd_format='{EXE} {IN} {OUT}')
samtoolsmerge(inputs=groups_path[prefix], outputs=outputs_path[prefix])
\ No newline at end of file
if len(groups_path[prefix]) > 1:
[cmd_inputs_pattern, next_arg_number] = Utils.get_argument_pattern(groups_path[prefix], 1)
samtoolsmerge = ShellFunction( self.get_exec_path("samtools") + ' merge ${' + str(next_arg_number) + '} ' + cmd_inputs_pattern + " 2>> " + self.stderr, cmd_format='{EXE} {IN} {OUT}')
samtoolsmerge(inputs=groups_path[prefix], outputs=outputs_path[prefix])
else:
move = ShellFunction( "mv ${1} ${2}", cmd_format='{EXE} {IN} {OUT}')
move(inputs=groups_path[prefix], outputs=outputs_path[prefix])
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment