vcftojson

A simple parser to convert VCF files to JSON

Usage no npm install needed!

<script type="module">
  import vcftojson from 'https://cdn.skypack.dev/vcftojson';
</script>

README

Build Status

VCF to JSON converter

A module to parse Variant Call Format (VCF) into JSON. An optional parameter allows to map the genomic coordinates to the protein coordinates using the UniProt Coordinates API.

Installation

npm i --save vcftojson

API

  1. fileContent:
  2. options
  • runVEP: a boolean used to fetch additional data from VEP. VEP determines the effect of your variants (SNPs, insertions, deletions, CNVs or structural variants) on genes, transcripts, and protein sequence, as well as regulatory regions.

Usage

From a node script:

import {vcfToJSON} from 'vcftojson`;

const fileContent = await fs.readFileSync(
  "./path_to/my_file.vcf",
  { encoding: "utf-8" } //if you don't provide this it will come as a Stream
);

const json = await index.vcfToJSON(fileContent);