Skip to content

Commit 3e04cb8

Browse files
committed
Remove INFO/CPX_TYPE from TinyResolve VCFs
GATK's SVCluster tool will not accept all SV type / CPX subtype combinations so we remove the CPX subtype annotation from all non-CPX SVs in the VCFs produced by TinyResolve.
1 parent 56047a5 commit 3e04cb8

File tree

1 file changed

+21
-3
lines changed

1 file changed

+21
-3
lines changed

wdl/TinyResolve.wdl

+21-3
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ workflow TinyResolve {
1515
Int samples_per_shard = 25
1616
String sv_pipeline_docker
1717
String linux_docker
18+
Boolean rm_cpx_type = true
1819
RuntimeAttr? runtime_attr_resolve
1920
RuntimeAttr? runtime_attr_untar
2021
RuntimeAttr? runtime_attr_concattars
@@ -78,6 +79,7 @@ workflow TinyResolve {
7879
sv_pipeline_docker = sv_pipeline_docker,
7980
cytoband=cytoband,
8081
cytoband_idx=cytoband_idx,
82+
rm_cpx_type = rm_cpx_type,
8183
discfile=GetShardDiscfiles.shard_items,
8284
discfile_idx=GetShardDiscfileIndexes.shard_items,
8385
mei_bed=mei_bed,
@@ -111,6 +113,7 @@ task ResolveManta {
111113
File cytoband
112114
File mei_bed
113115
String sv_pipeline_docker
116+
Boolean rm_cpx_type
114117
RuntimeAttr? runtime_attr_override
115118
}
116119

@@ -139,9 +142,24 @@ task ResolveManta {
139142
pe=${discfiles[$i]}
140143
sample_no=`printf %03d $i`
141144
bash /opt/sv-pipeline/00_preprocessing/scripts/mantatloccheck.sh $vcf $pe ${sample_id} ~{mei_bed} ~{cytoband}
142-
mv ${sample_id}.manta.complex.vcf.gz tloc_${sample_no}.${sample_id}.manta.complex.vcf.gz
143-
bgzip manta.unresolved.vcf
144-
mv manta.unresolved.vcf.gz ${sample_no}.${sample_id}.manta.unresolved.vcf.gz
145+
if [[ ~{true='true' false='false' rm_cpx_type} = 'true' ]]; then
146+
bcftools annotate --include 'INFO/SVTYPE != "CPX"' --keep-sites \
147+
--remove 'INFO/CPX_TYPE' \
148+
--output "tloc_${sample_no}.${sample_id}.manta.complex.vcf.gz" \
149+
--output-type z \
150+
"${sample_id}.manta.complex.vcf.gz"
151+
rm "${sample_id}.manta.complex.vcf.gz"
152+
bcftools annotate --include 'INFO/SVTYPE != "CPX"' --keep-sites \
153+
--remove 'INFO/CPX_TYPE' \
154+
--output "${sample_no}.${sample_id}.manta.unresolved.vcf.gz" \
155+
--output-type z \
156+
manta.unresolved.vcf
157+
rm manta.unresolved.vcf
158+
else
159+
mv ${sample_id}.manta.complex.vcf.gz tloc_${sample_no}.${sample_id}.manta.complex.vcf.gz
160+
bgzip manta.unresolved.vcf
161+
mv manta.unresolved.vcf.gz ${sample_no}.${sample_id}.manta.unresolved.vcf.gz
162+
fi
145163
done
146164
find . -type f -name '*.complex.vcf.gz' \
147165
| tar --create --file='manta_tloc_~{shard_number}.tar' --files-from=-

0 commit comments

Comments
 (0)