-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcommands.txt
55 lines (41 loc) · 1.78 KB
/
commands.txt
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
51
52
53
54
55
## Commands
This section lists command(s) run by variantMerging workflow
* Running variantMerging
### Preprocessing
A vetting script makes sure we have matching formats used across vcf, in addition making separate vcf files with only PASS calls
```
set -euxo pipefail
python3 ~{preprocessScript} ~{vcfFile} -o ~{basename(vcfFile, '.vcf.gz')}_tmp.vcf -r ~{referenceId}
bgzip -c ~{basename(vcfFile, '.vcf.gz')}_tmp.vcf > ~{basename(vcfFile, '.vcf.gz')}_processed.vcf.gz
bcftools view -f "PASS" ~{basename(vcfFile, '.vcf.gz')}_processed.vcf.gz | bgzip -c > ~{basename(vcfFile, '.vcf.gz')}_processed_pass.vcf.gz
```
### Merge variants with GATK (picard)
```
gatk MergeVcfs -I ~{sep=" -I " inputVcfs} -O ~{outputPrefix}_mergedVcfs.vcf.gz
```
### Customized combining of the variants
This step is custom-scripted and the produced vcf has variants annotated in a very detailed way
```
set -euxo pipefail
python3 <<CODE
import sys
v = "~{sep=' ' inputVcfs}"
vcfFiles = v.split()
with open("vcf_list", 'w') as l:
for v in vcfFiles:
l.write(v + "\n")
CODE
python3 ~{combiningScript} vcf_list -c ~{outputPrefix}_tmp.vcf -n ~{sep=',' inputNames}
gatk SortVcf -I ~{outputPrefix}_tmp.vcf -R ~{referenceFasta} -O ~{outputPrefix}_combined.vcf.gz
```
### Ensemble variants with bcbio tools
```
~{ensembleProgram} ensemble ~{outputPrefix}_ensembled.vcf.gz ~{referenceFasta} --names ~{sep=',' inputNames} ~{additionalParameters} ~{sep=' ' inputVcfs}
```
### Post-processing
```
set -euxo pipefail
python3 ~{postprocessScript} ~{vcfFile} -o ~{basename(vcfFile, '.vcf.gz')}_tmp.vcf -r ~{referenceId} -t ~{tumorName} ~{"-n " + normalName}
bgzip -c ~{basename(vcfFile, '.vcf.gz')}_tmp.vcf > ~{basename(vcfFile, '.vcf.gz')}.vcf.gz
tabix -p vcf ~{basename(vcfFile, '.vcf.gz')}.vcf.gz
```