Commit 61b54402 authored by Celine Noirot's avatar Celine Noirot
Browse files

ordering chain of samtools

parent 8e577650
......@@ -114,13 +114,14 @@ class Bismark (Analysis):
##################################################################################
def process(self):
#to do merge bam per samples!
if self.is_paired:
bismark_fn = ShellFunction(self.get_exec_path("bismark") + " " + self.args + " -o " + self.output_directory + " --temp_dir " + self.output_directory + \
" " + self.reference_directory + " -1 $1 -2 $2 2> $4 ; "+ self.get_exec_path("samtools") + " sort $3 $6 2>> $4; mv $6.bam $6 2>> $4;" , cmd_format='{EXE} {IN} {OUT}')
" " + self.reference_directory + " -1 $1 -2 $2 2> $4 ; ln -s $3 $6 2>> $4;" , cmd_format='{EXE} {IN} {OUT}')
bismark_map = MultiMap(bismark_fn, inputs=[self.input_files_R1, self.input_files_R2], outputs=[self.output_files,self.stderrs,self.output_report,self.output_bam], includes=self.reference_genome)
else:
bismark_fn = ShellFunction(self.get_exec_path("bismark") + " " + self.args + " -o " + self.output_directory + " --temp_dir " + self.output_directory + \
" " + self.reference_directory + " $1 2> $3 ; "+ self.get_exec_path("samtools") + " sort $2 $5 2>> $3; mv $5.bam $5 2>> $3;" , cmd_format='{EXE} {IN} {OUT}')
" " + self.reference_directory + " $1 2> $3 ; ln -s $2 $5 2>> $3;" , cmd_format='{EXE} {IN} {OUT}')
bismark_map = MultiMap(bismark_fn, self.input_files_R1, outputs=[self.output_files,self.stderrs,self.output_report,self.output_bam], includes=self.reference_genome)
def post_process(self):
......
......@@ -67,11 +67,12 @@ class RemoveDuplicate (Analysis):
self.add_shell_execution(self.get_exec_path("samtools") + " flagstat $1 > $2", cmd_format='{EXE} {IN} {OUT}',
inputs=[self.bam], outputs=[self.flagstat_init], map=True)
self.add_shell_execution(self.get_exec_path("samtools") + " sort -m "+self.mem+" -@"+str(self.cpu)+" $1 $2; mv $2.bam $2",
cmd_format='{EXE} {IN} {OUT}', inputs=[self.bam], outputs=[self.temp_sorted1], map=True)
if self.is_paired :
#samtools rmdup
self.add_shell_execution(self.get_exec_path("samtools_old") + " rmdup $1 $2 2>> $3", cmd_format='{EXE} {IN} {OUT}',
inputs=[self.bam], outputs=[self.temp_rmdup,self.rmdup_stderr], map=True)
inputs=[self.temp_sorted1], outputs=[self.temp_rmdup,self.rmdup_stderr], map=True)
self.add_shell_execution(self.get_exec_path("samtools") + " flagstat $1 > $2", cmd_format='{EXE} {IN} {OUT}',
inputs=[self.temp_rmdup], outputs=[self.flagstat_rmdup], map=True)
#remove singleton after rmdup
......
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