@molgenis/vip-report-vcf
v3.0.6
Published
TypeScript VCF library with support for both reading and writing
Downloads
453
Keywords
Readme
vip-report-vcf
TypeScript VCF library with support for both reading and writing. Supports parsing of Ensembl VEP annotations.
Usage
import { parseVcf } from "../VcfParser";
import { writeVcf } from "../VcfWriter";
const vcf = `
##fileformat=VCFv4.2
##INFO=<ID=DP,Number=1,Type=Integer,Description="Total Depth">
##INFO=<ID=H2,Number=0,Type=Flag,Description="HapMap2 membership">
##FORMAT=<ID=GT,Number=1,Type=String,Description="Genotype">
#CHROM\tPOS\tID\tREF\tALT\tQUAL\tFILTER\tINFO\tFORMAT\tS0
1\t12\t.\tC\tT\t.\tPASS\tDP=2;H2;\tGT\t0/1
`;
const parsedVcf = parseVcf(vcf);
console.log(writeVcf(parsedVcf));