Skip to main content

Annotate a VCF file with AF, AD and DP from tumor and normal BAMs

Project description

VAFator

DOI PyPI version Anaconda-Server Badge Run unit tests License

Annotate the variants in a VCF file with technical annotations from one or more BAM files.

Install from PyPI (pip install vafator) or from bioconda (conda install bioconda::vafator).

Annotations:

  • Allele frequency (AF): ratio of reads supporting the alternate allele. When more than one alternate allele is present then one value per alternate allele is provided.
  • Allele count (AC): count of reads supporting the alternate allele. When more than one alternate allele is present then one value per alternate allele is provided.
  • Depth of coverage (DP): number of reads covering the position of the variant

Outputs a VCF with the following annotations in the INFO field for tumor and normal:

chr1    12345       .       A       G       .       PASS  tumor_af=0.0;tumor_ac=0;tumor_dp=89;normal_af=0.0196;normal_ac=1;normal_dp=51
chr2    12345       .       A       G,T       .       PASS  tumor_af=0.2,0.2;tumor_ac=2,2;tumor_dp=10;normal_af=0.0,0.0;normal_ac=0,0;normal_dp=10

Both tumor and normal BAMs are optional, it can annotate only with the tumor BAM and viceversa.

If more than one BAM is provided for either the tumor or the normal then the annotations are calculated across all BAMs and for also each of them separately (eg: tumor_af provides the allele frequency across all tumor BAMs, tumor_af_1 and tumor_af_2 provide the allele frequency on the first and second BAM respectively).

Run it as follows:

$ vafator --help
usage: vafator [-h] --input-vcf INPUT_VCF --output-vcf OUTPUT_VCF
               [--normal-bams NORMAL_BAMS [NORMAL_BAMS ...]]
               [--tumor-bams TUMOR_BAMS [TUMOR_BAMS ...]]
               [--mapping-quality MAPPING_QUALITY]
               [--base-call-quality BASE_CALL_QUALITY]
               [--prefix BASE_CALL_QUALITY]

optional arguments:
  -h, --help            show this help message and exit
  --input-vcf INPUT_VCF
                        The VCF to annotate (default: None)
  --output-vcf OUTPUT_VCF
                        The annotated VCF (default: None)
  --normal-bams NORMAL_BAMS [NORMAL_BAMS ...]
                        Whitespace-separated list of normal BAMs to analyse
                        (default: [])
  --tumor-bams TUMOR_BAMS [TUMOR_BAMS ...]
                        Whitespace-separated list of tumor BAMs to analyse
                        (default: [])
  --mapping-quality MAPPING_QUALITY
                        All reads with a mapping quality lower or equal than
                        this threshold will be filtered out (default: 0)
  --base-call-quality BASE_CALL_QUALITY
                        All bases with a base call quality lower or equal than
                        this threshold will be filtered out (default: 29)
  --prefix PREFIX
                        When provided the annotations are preceded by this prefix, otherwise the annotations
                        are named as tumor_af, normal_af, tumor_ac, normal_ac, tumor_dp and normal_dp

Copyright (c) 2019-2021 TRON gGmbH (See LICENSE for licensing details) 

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vafator-0.4.0.tar.gz (10.6 kB view details)

Uploaded Source

Built Distribution

vafator-0.4.0-py3-none-any.whl (11.2 kB view details)

Uploaded Python 3

File details

Details for the file vafator-0.4.0.tar.gz.

File metadata

  • Download URL: vafator-0.4.0.tar.gz
  • Upload date:
  • Size: 10.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for vafator-0.4.0.tar.gz
Algorithm Hash digest
SHA256 3bf470288bb53a012f603d23b5961950c0345dc4ad9b11714a8134c77678e172
MD5 c70b7eb0060c39552fe06ceffccff38a
BLAKE2b-256 68c2f6171f39c1c0b70859b06a601f07a0c6c5ff06dc0761e5ad14f27b90ba1a

See more details on using hashes here.

File details

Details for the file vafator-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: vafator-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 11.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for vafator-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5e700d9133597010849d0e877f14211c221f0f14265f1109a0da63f103e38173
MD5 9108c0349abdbe3ccfcbc29d31e96bcb
BLAKE2b-256 afb6cf58c789d91820d8f7719cd2269a34908bd8dd28935f5ad3c3a5044872a7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page