delly.py 1.74 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# Copyright (C) 2012 INRA
# 
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# 
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# 
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
#

from weaver.function import ShellFunction
from jflow.component import Component
19
import os.path
20
21
22

class Delly (Component):
    
23
    def define_parameters(self, input_bam, reference_genome, min_mapq=30):
24
        self.add_input_file_list("input_bam", "One bam file by individual/condition", default=input_bam, file_format="bam", required=True)
25
        self.add_input_file("reference_genome", "On which genome should the reads being aligned on", default=reference_genome, required=True)
26
        self.add_output_file("output_file", "Delly output file", filename="delly.vcf")
27
        self.add_parameter("min_mapq", "min. paired-end mapping quality", type=int, default=min_mapq)
28
29

    def process(self):
30
        delly = ShellFunction(self.get_exec_path("delly") \
31
32
33
                              + " -g {0} -q {1}".format(self.reference_genome, self.min_mapq) \
                              + " -o $1 $2 > /dev/null;" \
                              + " if [ ! -e $1 ]; then touch $1; fi", 
34
                              cmd_format='{EXE} {OUT} {IN}')
35
        delly(inputs=self.input_bam, outputs=self.output_file)
36