Skip to main content

Convert .vcf files to HL7 FHIR standard

Project description

VCF to FHIR Converter

Introduction

VCF-formatted files are the lingua franca of next-generation sequencing, whereas HL7 FHIR is emerging as a standard language for electronic health record interoperability. A growing number of clinical genomics applications are emerging, based on the HL7 FHIR Genomics standard. Here, we provide an open source utility for converting variants from VCF format into HL7 FHIR Genomics format. Details of the translation logic are on the manual page. Conceptually, the utility takes a VCF as input and outputs a FHIR Genomics report.

Install

pip install vcf2fhir

Quick Examples

>>> import vcf2fhir
>>> Vcf_2_Fhir = vcf2fhir.Converter('sample.vcf', 'GRCh37')
>>> Vcf_2_Fhir.convert()

Logging

You can use python standard logging to enable logs. Two loggers ('vcf2fhir.general') and ('vcf2fhir.invalidrecord') are available to configure.

  • vcf2fhir.general: standard library logs.
  • vcf2fhir.invalidrecord: logs all the records from vcf file which are in conversion region but are not converted to fhir format.
>>> import logging
# create logger
>>> logger = logging.getLogger('vcf2fhir.invalidrecord')
>>> logger.setLevel(logging.DEBUG)
# create console handler and set level to debug
>>> ch = logging.FileHandler('invalidrecord.log')
>>> ch.setLevel(logging.DEBUG)
# create formatter
>>> formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
# add formatter to ch
>>> ch.setFormatter(formatter)
# add ch to logger
>>> logger.addHandler(ch)

Scope

Software converts simple variants (SNVs, Indels), along with zygosity and phase relationships, for autosomes, sex chromosomes, and mitochondrial DNA.

  • Not supported
    • Structural variants: Software does not support conversion of structural variants (where INFO.SVTYPE is present).
    • Alt contigs: Software does not support conversion of variants aligned to Alt contigs. We recommend caution in using this software against VCFs generated with an alternate-locus aware variant caller, as variants mapped to Alt contigs will not be converted.
    • Query liftover: Software assumes that regions (conversion region, studied region, noncallable region) and VCF are based on the same genomic build.
    • Chromosome synonyms (e.g. '1' vs. 'chr1'): Software assumes that chromosome representation is consistent between regions (e.g. in BED files) and VCF. For instance, if VCF uses 'chr1', then BED file must also use 'chr1'

License and Limitations

Software is available for use under an Apache 2.0 license, and is intended solely for experimental use, to help further Genomics-EHR integration exploration. Software is expressly not ready to be used with identifiable patient data or in delivering care to patients. Code issues should be tracked here. Comments and questions can also be directed to info@elimu.io or srikarchamala@gmail.com.

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

vcf2fhir-0.0.14.tar.gz (14.4 kB view details)

Uploaded Source

Built Distribution

vcf2fhir-0.0.14-py2-none-any.whl (14.9 kB view details)

Uploaded Python 2

File details

Details for the file vcf2fhir-0.0.14.tar.gz.

File metadata

  • Download URL: vcf2fhir-0.0.14.tar.gz
  • Upload date:
  • Size: 14.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.7.0

File hashes

Hashes for vcf2fhir-0.0.14.tar.gz
Algorithm Hash digest
SHA256 2b7baf95d94cd6518f3d582633d4e7d2fc75e59edf59078f9d6d676585a20cf8
MD5 8df3b9fb4e9a5114c2a6286810dcb62d
BLAKE2b-256 b97d69ff2eafb1acd8675bc5248836a79cdfa798fa5036dec64e92b03de22f0d

See more details on using hashes here.

File details

Details for the file vcf2fhir-0.0.14-py2-none-any.whl.

File metadata

  • Download URL: vcf2fhir-0.0.14-py2-none-any.whl
  • Upload date:
  • Size: 14.9 kB
  • Tags: Python 2
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.7.0

File hashes

Hashes for vcf2fhir-0.0.14-py2-none-any.whl
Algorithm Hash digest
SHA256 b37041138f7b7e9a112889ab44352fbb9974a6b637ef78fb34f1db8071a74321
MD5 a8e83d185b7937544ff344b5b47b7d86
BLAKE2b-256 5267d7f43c8406c1d3c55a3c6933832d4ba1cdae5741ab6fa93a8adc206f70dc

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