-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCoverage.py
More file actions
executable file
·44 lines (35 loc) · 1.55 KB
/
Coverage.py
File metadata and controls
executable file
·44 lines (35 loc) · 1.55 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
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/usr/bin/env python3
from PairedEndCommand import PairedEndCommand
class Coverage(PairedEndCommand):
def __init__(self, *args, **kwargs):
super(Coverage, self).__init__(*args, **kwargs)
def make_command(self, mapped):
# works with SAM or BAM
normcov = self.rebase_file(mapped)
normcov = self.replace_read_marker_with("_normcov", normcov)
normcov = self.replace_extension_with(".txt", normcov)
covstats = self.rebase_file(mapped)
covstats = self.replace_read_marker_with("_covstats", covstats)
covstats = self.replace_extension_with(".txt", covstats)
hist = self.rebase_file(mapped)
hist = self.replace_read_marker_with("_hist", hist)
hist = self.replace_extension_with(".txt", hist)
stats = self.rebase_file(mapped)
stats = self.replace_read_marker_with("_stats", stats)
stats = self.replace_extension_with(".txt", stats)
bincov = self.rebase_file(mapped)
bincov = self.replace_read_marker_with("_bincov", bincov)
bincov = self.replace_extension_with(".txt", bincov)
command = ("pileup.sh -Xmx{xmx} threads={t} in={i} normcov={normcov} "
"covstats={covstats} hist={hist} stats={stats} "
"bincov={bincov}").format(
xmx=self.get_mem(fraction=0.95),
t=self.get_threads(),
i=mapped,
normcov=normcov,
covstats=covstats,
hist=hist,
stats=stats,
bincov=bincov
)
return (command)