Skip to main content

VCF to MAF format converter

Project description

vcf2maf_lite

vcf2maf_lite is a lightweight Python adaptation of the vcf2maf Perl tool, designed to convert the VCF format to MAF format without adding variant annotations. For annotating a MAF file, Genome Nexus can be utilized.

Installation using pip

pip3 install vcf2maf_lite

Usage:

vcf2maf_lite --help

Usage: vcf2maf_lite [OPTIONS]

Options:
  -i, --input-data TEXT        A list of .vcf files or input data directories,
                               separated by commas  [required]
  -o, --output-directory TEXT  output data directory [optional]
  -c, --center TEXT            name of center (standard MAF field = 'Center')
                               [optional]
  -s, --sequence-source TEXT   Sequencing source (standard MAF field =
                               'Sequencing_Source'), e.g., WXS or WGS
                               [optional]
  -t, --tumor-id TEXT          The ID of the tumor sample utilized in the
                               genotype columns of the VCF file. [optional]
  -n, --normal-id TEXT         The ID of the normal sample utilized in the
                               genotype columns of the VCF file. [optional]
  -a, --retain-info TEXT       Comma-delimited names of INFO fields to retain
                               as extra columns in MAF [optional]
  -f, --retain-fmt TEXT        Comma-delimited names of FORMAT fields to
                               retain as extra columns in MAF [optional]
  --help                       Show this message and exit.

Example Usage:

vcf2maf_lite --input-data /data/vcf --output-directory /data/maf/ --center CTR --sequence-source WGS --tumor-id Tumor --normal-id Normal --retain-info Custom_filters,AC,AF,AC_nfe_seu,AC_afr,AF_afr --retain-fmt alt_count_raw,ref_count_raw,depth_raw

This command converts the VCF files in /vcf folder to MAF format.

  • The --input-data option is used to specify either a single VCF file or a directory containing multiple VCF files (separated by commas). This option supports passing multiple input files or directories at once.
  • The --output-directory option allows you to specify the directory where the MAF files will be saved. If no output path is provided, the default output directory vcf2maf_output will be used in the current working directory.
  • The --tumor-id option allows you to specify the ID of the tumor sample used in the genotype columns of the VCF file. If the option is not used, the script will automatically identify the tumor ID from either the tumor_sample keyword in the meta data lines or the sample columns from VCF header.
  • The --normal-id option allows you to specify the ID of the normal sample used in the genotype columns of the VCF file. If the option is not used, the script will automatically identify the normal ID from either the normal_sample keyword in the meta data lines or the sample columns from VCF header.
  • The --retain-info option allows you to specify the INFO fields to be retained as additional columns in the MAF. If the option is not used, standard MAF columns are included by default.
  • The --retain-fmt option allows you to specify the FORMAT fields to be retained as additional columns in the MAF. If the option is not used, standard MAF columns are included by default.

Importing to Python Scripts:

from vcf2maf_lite.vcf2maf_lite import main
from click.testing import CliRunner

runner = CliRunner()
runner.invoke(main, ['--input-data','test_vcf.vcf'])

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

vcf2maf_lite-0.1.2.tar.gz (18.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

vcf2maf_lite-0.1.2-py3-none-any.whl (18.3 kB view details)

Uploaded Python 3

File details

Details for the file vcf2maf_lite-0.1.2.tar.gz.

File metadata

  • Download URL: vcf2maf_lite-0.1.2.tar.gz
  • Upload date:
  • Size: 18.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.20

File hashes

Hashes for vcf2maf_lite-0.1.2.tar.gz
Algorithm Hash digest
SHA256 0a7c1d04b794e13f5dc427a7e75d9dd4e4d19f900fb1a639afb5bfeddbaf2a08
MD5 09924d6d6c76f19b171802dc04372174
BLAKE2b-256 8c7c0735e92ec748d9d835ad4c6516f5cb7862aeb1030717edc55831c9a4d105

See more details on using hashes here.

File details

Details for the file vcf2maf_lite-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: vcf2maf_lite-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 18.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.20

File hashes

Hashes for vcf2maf_lite-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 fe920b06fb13d217c2490c0d328ab2bae01ef43775467819d13c465be80e8c72
MD5 7532d5d9d4502d46f2479d9c44ecd8f3
BLAKE2b-256 f48f7397a74ca660dcd0ff9f1b0fc2c8fdfd72e9f15d031eb62c4d725eda23ac

See more details on using hashes here.

Supported by

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