-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathReduceReads.py
More file actions
31 lines (27 loc) · 1.06 KB
/
ReduceReads.py
File metadata and controls
31 lines (27 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/env python3
from PairedEndCommand import PairedEndCommand
class ReduceReads(PairedEndCommand):
def __init__(self, *args, **kwargs):
super(ReduceReads, self).__init__(*args, **kwargs)
self.set_default("reference", "reference.fa")
self.set_default("tmp_dir", "~/tmp")
self.set_default("GATK",
"~/.prog/GenomeAnalysisTK/GenomeAnalysisTK.jar")
def make_command(self, filename):
"""
Use GATK ReduceReads to compress BAM file into variant regions only
:param filename: input BAM file
:return: command string
"""
outfile = self.rebase_file(filename)
command = ("java -Xms{xms} -Xmx{xmx} -Djava.io.tmpdir={tmp} -jar "
"{gatk} -T ReduceReads -R {ref} -I {i} -O {o}").format(
xms=self.get_mem(0.98),
xmx=self.get_mem(0.99),
tmp=self.tmp_dir,
gatk=self.GATK,
ref=self.reference,
i=filename,
o=outfile
) # ReduceReads command
return (command)