Skip to content

precisely/seqvarnomjs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

81 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CircleCI

SEQVARNOMJS

Javascript parser for Sequence Variant Nomenclature.

Quick Start

Note: this is a private repo hosted on Github, so you need to:

yarn install git@github.com/precisely/seqvarnomjs

Example

var svn = require('seqvarnomjs');

var pattern = svn.parse('NC0001_1.11:g.111T>G');
var genotype = svn.parse('NC0001_1.11:g.[111T>G];[111=]');

svn.match(pattern, genotype); // => true

Details

This library interprets SVN strings such as:

  • simple variants NC00001_1.11:g.111T>G
  • wild type NC00001_1.11:g.111=
  • compound cis variants NC0001_1.11:g.[111T>G;222A>G]
    • 111T>G and 222A>G are on the same chromosome copy
  • trans variants NC0001_1.11:g.[111T>G];[222A>G]
    • 111T>G and 222A>G are on different chromosome copies
  • variants with uncertain phasing NC0001_1.11:g.[111T>G](;)[222A>G]
    • 111T>G and 222A>G may be on same chromosome copy or different ones
  • complex variants NC0001_1.11:g.[111T>G;222A>G];[333=](;)[444T>A];[555G>A]

E.g.,

  • match a variant:
    const genotype = parse('NC0001_1.11:g.[111T>G]');
    const pattern = parse('NC0001_1.11:g.[111T>G]');
    genotype.matches(pattern); // => true
  • match a part of a variant:
    const genotype = parse('NC0001_1.11:g.[111T>G;222=](;)[333G>C;111=]');
    const pattern = parse('NC0001_1.11:g.[111T>G]');
    genotype.matches(pattern); // => true