Skip to main content

Human mitochondrial variants annotation using HmtVar.

Project description

HmtNote

https://img.shields.io/pypi/v/hmtnote.svg Project Status: WIP – Initial development is in progress, but there has not yet been a stable, usable release suitable for the public. https://travis-ci.com/robertopreste/HmtNote.svg?token=zzk3yyGKDnWjk4pFXFuz&branch=master https://circleci.com/gh/robertopreste/HmtNote.svg?style=svg&circle-token=b910c3491e8df21fee34293ace05a35a116759c7 https://codecov.io/gh/robertopreste/HmtNote/branch/master/graph/badge.svg Documentation Status Updates Downloads https://img.shields.io/badge/Say%20Thanks-!-1EAEDB.svg

Human mitochondrial variants annotation using HmtVar.

Features

HmtNote is a bioinformatics Python module and command line interface that can be used to annotate human mitochondrial variants from a VCF file, using data available on HmtVar.

Annotations are grouped into basic, cross-reference, variability and predictions, depending on the type of information they provide. It is possible to either use all of them to fully annotate a VCF file, or choose specific annotations of interest.

HmtNote works by pulling the required data from HmtVar on the fly, but if you’re planning to annotate VCF files offline, it is possible to download the annotation database so that HmtNote can use it when no internet connection is available.

For more information, please refer to the Usage section of the documentation.

Installation

PLEASE NOTE: HmtNote only supports Python >= 3.6!

The preferred installation method for HmtNote is using pip:

$ pip install hmtnote

For more information, please refer to the Installation section of the documentation.

Usage

Command Line Interface

HmtNote can be used as a command line tool, using the annotate command and providing the input VCF file name and the file name or path where the annotated VCF will be saved:

hmtnote annotate input.vcf annotated.vcf

By default, HmtNote will annotate the VCF file using all four groups of annotations (basic, cross-reference, variability and predictions). If desired, you can select which specific annotation you want, using respectively --basic, --crossref, --variab and --predict (or -b, -c, -v, -p), or any combination of these options:

hmtnote annotate input.vcf annotated_basic.vcf --basic
hmtnote annotate input.vcf annotated_crossreferences.vcf --crossref
hmtnote annotate input.vcf annotated_variability.vcf --variab
hmtnote annotate input.vcf annotated_predictions.vcf --predict
hmtnote annotate input.vcf annotate_basic_variability.vcf --basic --variab

It is also possible to convert the resulting annotated VCF file to CSV format, for a simpler visual inspection of the data, by simply specifying the --csv option (please note that an output VCF file name must be provided):

hmtnote annotate input.vcf annotated.vcf --csv

An additional annotated.csv file will be created in the same directory of annotated.vcf.

By default, HmtNote works by pulling the required data from HmtVar on the fly, but if you’re planning to annotate VCF files offline, first download the annotation database using the dump command:

hmtnote dump

After that, HmtNote is capable of working even when no internet connection is available; this can be achieved using the --offline option after the usual annotation command:

hmtnote annotate input.vcf annotated.vcf --offline
hmtnote annotate input.vcf annotated_variability.vcf --variab --offline

For more information, please refer to the Usage section of the documentation.

Python Module

HmtNote can also be imported in a Python script and its function annotate_vcf() can be used to annotate a given VCF:

from hmtnote import annotate
annotate("input.vcf", "annotated.vcf")

By default, annotate_vcf() will annotate the VCF using all four groups of annotations (basic, cross-reference, variability and predictions). If desired, you can specify which kind of annotation you want, using respectively the basic=True, crossref=True, variab=True, predict=True arguments, or any combination of them:

annotate("input.vcf", "annotated_basic.vcf", basic=True)
annotate("input.vcf", "annotated_crossreferences.vcf", crossref=True)
annotate("input.vcf", "annotated_variability.vcf", variab=True)
annotate("input.vcf", "annotated_predictions.vcf", predict=True)

An additional annotated CSV can be produced from the output VCF using the csv=True argument:

annotate("input.vcf", "annotated.vcf", csv=True)

It is also possible to download the annotation database using the dump() function, and perform offline annotation of VCF files by simply adding the offline=True argument to annotate_vcf():

from hmtnote import dump
dump()
annotate("input.vcf", "annotated.vcf", offline=True)

For more information, please refer to the Usage section of the documentation.

Citing HmtNote

If you find HmtNote useful for your research, please cite this work:

Preste R. et al - Human mitochondrial variant annotation with HmtNote (doi: https://doi.org/10.1101/600619)

Credits

This package was created with Cookiecutter and the cc-pypackage project template.

History

0.1.0 (2019-03-03)

  • First release on PyPI.

0.1.1 (2019-03-04)

  • Clean installation requirements for conda;

  • Update documentation.

0.1.2 (2019-03-15)

  • Classes and methods are protected where needed;

  • Code style is clean.

0.1.3 (2019-03-17)

  • Fix issue with --predict annotation, which didn’t retrieve the correct field from HmtVar.

0.1.4 (2019-03-19)

  • Fix issue that prevented importing annotate_vcf() into Python scripts.

0.1.5 (2019-03-20)

  • Add HmtVar ID of the variant in basic and full annotation;

  • Change Disease Score annotation to DiseaseScore.

0.2.0 (2019-03-25)

  • Add warnings to hmtnote command to be compliant with future versions;

  • Check internet connection before trying to annotate variants.

0.3.0 (2019-03-27)

  • Add options to download the annotation database locally;

  • Use local database to annotate variants (instead of calling HmtVar’s API);

  • Fallback to using local database when no internet connection is available;

  • Check if local database actually exists before performing offline annotation;

  • Databases are downloaded asynchronously.

0.3.1 (2019-03-29)

  • Update installation requirements and documentation.

0.4.0 (2019-04-03)

  • Add support for insertion and deletion annotations;

  • Add test suite and files for indels.

0.5.0 (2019-04-28)

  • Replace VCF parsing using VCFpy instead of cyvcf2;

  • Rename hmtnote.annotate_vcf() to hmtnote.annotate() for compliance with CLI.

0.5.1 (2019-04-29)

  • Fix issue with the new VCFpy implementation where new info where badly reported;

  • Update test files restricting the number of entries to 80 for faster testing.

0.5.2 (2019-04-30)

  • Fix requirements in setup.py file.

0.5.3 (2019-05-06)

  • Update requirements in setup.py.

0.5.4 (2019-05-06)

  • Fix installation issue.

0.5.5 (2019-05-06)

  • Fix VCF record parsing issue.

0.6.0 (2019-06-25)

  • Use vcfpy2 for VCF files parsing;

  • Dump annotation files directly from HmtVar instead of the original API call;

  • Add annotation progress bar;

  • Check internet connection using httpstat.us;

  • Update tests and add more test cases;

  • Update documentation with detailed API usage.

0.7.0 (2019-07-26)

  • Add --csv command line option to convert output to CSV format;

  • Add homoplasmy annotations;

  • Update all tests accordingly;

  • Update documentation.

0.7.1 (2019-07-30)

  • Fix issue with echoed string (#78);

  • Fix issue with CSV format columns (#79);

  • Update testfiles.

0.7.2 (2019-08-16)

  • Remove pysam from requirements and fix dependencies;

  • Change docstrings to Google style;

  • Update documentation;

  • Update testfiles.

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

hmtnote-0.7.2.tar.gz (289.5 kB view details)

Uploaded Source

Built Distribution

hmtnote-0.7.2-py2.py3-none-any.whl (15.2 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file hmtnote-0.7.2.tar.gz.

File metadata

  • Download URL: hmtnote-0.7.2.tar.gz
  • Upload date:
  • Size: 289.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.3

File hashes

Hashes for hmtnote-0.7.2.tar.gz
Algorithm Hash digest
SHA256 843300a160a0947ab3572c220198e88cc5d6b0fdf554f3a168e9cabdc6e66e8e
MD5 6e11b13a07b5008fd3f69190d8c8af9d
BLAKE2b-256 4387357453bf87701e7c2cf016909f507887e4fd1c72effb712c0c1b7336c568

See more details on using hashes here.

File details

Details for the file hmtnote-0.7.2-py2.py3-none-any.whl.

File metadata

  • Download URL: hmtnote-0.7.2-py2.py3-none-any.whl
  • Upload date:
  • Size: 15.2 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.3

File hashes

Hashes for hmtnote-0.7.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 e757e3590315ced57c566eb95a840ec9c97e53b69bcee88d8065b05c6ccb54f3
MD5 34d710d2f81ff796d342804816922068
BLAKE2b-256 bb279f6fef8eb73ef702b2884b7a1e0b2083d0da606fb2d0c99ba1b680f9e0ef

See more details on using hashes here.

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