varscanvcfremap

February 16, 2020 ยท View on GitHub

Normalize fields in VCF files generated by Varscan for use with TinDaisy CWL workflow. Works with both somatic and germline varscan output.

Modify Varscan-generated VCF files to make format of AD field more consistent with other callers. Specifically, value of the per-genotype AD field becomes "RD,AD". The RD field is removed. Care is taken to update the meta-information lines to be consistent with FORMAT fields.

Varscan input

Tested to work with Varscan 2.3.8.

From Varscan documentation, details about FORMAT fields:

  • AD - Reads supporting variant in tumor (or normal)
  • RD - Reads supporting reference in tumor (or normal)

See also VCF 4.2 documentation

We assume a particular order and names of the FORMAT fields: GT:GQ:DP:RD:AD:FREQ:DP4.
It is an error if FORMAT field is different (can be overridden with -w flag).

Compressed and uncompressed VCF input files are supported.

Output

Uncompressed VCF file is written

TODO Provide support for compressed output data

Meta-information

VCF meta-information lines are modified as follows

  • FORMAT meta-info line for ID=RD is removed
  • FORMAT meta-info line for ID=AD is rewritten as,
##FORMAT=<ID=AD,Number=R,Type=Integer,Description="Allelic depths for the ref and alt alleles in the order listed">
  • FILTER meta-info line is added as follows, to indicate that this VCF was processed,
##FILTER=<ID=varscan_AD,Description="Modify varscan AD and RD FORMAT field. New AD is 'RD,AD'; RD is removed ">

Call information

For somatic calls, the FORMAT field for each call is rewritten as, GT:GQ:DP:AD:FREQ:DP4 For germline calls, the FORMAT field for each call is rewritten as, GT:GQ:SDP:DP:AD:FREQ:PVAL:RBQ:ABQ:RDF:RDR:ADF:ADR

The genotype data for both TUMOR and NORMAL is modified as,

  • AD=RD_old,AD_old
  • RD is removed from the FORMAT field

Development

Preliminary analysis of varscan VCF and issues associated with merging took place on MGI:/gscuser/mwyczalk/projects/TinDaisy/CromwellRunner/adhoc-test/20191226.heiman. Contents of this work are saved in doc/20191226.heiman.tar.gz

For development and testing purposes, this project ships with test data and demonstration scripts for running within different contexts (direct, docker, cwl). See ./testing for details and code. At this time only somatic test data released, germline will be added once it is anonymized.

Project structure is based on MNP Filter CWL Tool

Implementation of filter is modeled after TinDaisy-Core merge filter, which is based on PyVCF (with code available for inspection in image here: /usr/local/lib/python3.8/site-packages/vcf)

Latest docker image: `mwyczalkowski/varscan_vcf_remap:20200216

Contact

Matt Wyczalkowski (m.wyczalkowski@wustl.edu)