forked from bioexcel/BioExcel_Align
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbxcl_align
50 lines (38 loc) · 1.71 KB
/
bxcl_align
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
45
46
47
48
49
50
#!/usr/bin/env python
"""
This script performs the Alignment step of the Cancer
Genome Variant pipeline, controlling the processes for
each step.
"""
import sys
import shutil
import bioexcel_align.runbwa as rb
import bioexcel_align.rungatk as rg
import bioexcel_align.alignutils as au
if __name__ == "__main__":
description = ("This script performs the Alignment step of the Cancer "
"Genome Variant pipeline.")
args = au.parse_command_line(description)
if args.bwa_version == 'stable':
pbwa = rb.bwamem_stable(args.bwa_ind_ref, args.threads, args.date,
args.sample, args.files, args.bwadir)
pbwa.wait()
elif args.bwa_version == 'beta':
pbwa = rb.bwamem_beta(args.bwa_ind_ref, args.threads, args.date,
args.sample, args.files, args.bwadir)
pbwa.wait()
else:
sys.exit('No BWA Mem version selected')
psamidx = rb.samtools_index('{0}/{1}.raw.bam'.format(args.bwadir,
args.sample))
psamidx.wait()
pbr = rg.baserecal(args.jvm_opts, args.threads, args.ref,
'{0}/{1}.raw.bam'.format(args.bwadir, args.sample),
args.knownsites, args.gatkdir, args.sample)
pbr.wait()
pab = rg.applybqsr(args.jvm_opts, args.threads,
'{0}/{1}.raw.bam'.format(args.bwadir, args.sample),
args.gatkdir, args.sample)
pab.wait()
shutil.copy('{0}/{1}.final.bam'.format(args.gatkdir, args.sample),
'{0}/{1}.final.bam'.format(args.outdir, args.sample))