Skip to main content

No project description provided

Project description

dvartk (variant comparison toolkit)

Install

pip install dvartk

Philosophy

Basically a package for comparing SNVs of maf files

  • in the future, SV, INDEL support, vcf support as well

Usage

Comparing SNVs

import dvartk

# set MAF paths
maf1_path = '/path/to/maf1'
maf2_path = '/path/to/maf2'

# convert custom chrom, pos, ref, alt column names to "chrom", "pos", "ref", "alt"
snv_file_config = dvartk.parser.SnvFileConfig('Chromosome', 'Start_Position', 'Reference_Allele', 'Tumor_Seq_Allele2')

# load and convert columns of MAF
maf1 = dvartk.load_and_convert_snv_maf_columns(maf1_path, snv_file_config)
maf2 = dvartk.load_and_convert_snv_maf_columns(maf2_path, snv_file_config)

# get set counts (intersection, difference, ...) between maf1 and maf2
# first make a SNV comparison instance
snv_cmp = SnvComparison(maf1, maf2)
snv_cmp.get_set_counts() # get A[maf1], B[maf2] counts
summary = snv_cmp.make_oneliner()
print(summary)

Plot SNV trinucleotide spectra

import dvartk

# set a MAF path
maf_path = '/path/to/maf'

# get counts per trinucleotide type
counts = dvartk.count_snvs(maf)
dvartk.plot_snv_spectra(
    counts,
    'plot title',  # title of the plot e.g. sample ID
    save_path=None,  # output path for your plot; if None, don't save plot
    tag=' (bar)'  # tag to add to plot title; if None, don't add tag
)

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

dvartk-0.1.3.tar.gz (5.3 kB view hashes)

Uploaded Source

Built Distribution

dvartk-0.1.3-py3-none-any.whl (5.8 kB view hashes)

Uploaded Python 3

Supported by

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