xwatkins / vcf-to-json

Convert Variant Call Format (VCF) files into JSON

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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 vcfToJSON(fileContent);

About

Convert Variant Call Format (VCF) files into JSON


Languages

Language:TypeScript 83.8%Language:JavaScript 16.2%