- 
                Notifications
    
You must be signed in to change notification settings  - Fork 0
 
Home
        Aneil Mallavarapu edited this page Mar 8, 2018 
        ·
        1 revision
      
    Javascript parser for Sequence Variant Nomenclature.
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] 
We add extensions to the existing standard which allows us to perform pattern matching using logic operators:
- OR operator 
^ - AND operator 
& - NOT operator 
! - GROUPING operator 
{} 
Logic operators can be used throughout the expression E.g.,
- match either simple variant 
111T>Gor222A>GNC0001_1.11:g.[111T>G^222A>G] - match one or another sequence variant
{NC0001_1.11:g.111T>G}^{NC0002_2.11:g.222T>G} - match a complex condition ((111 or 222) and (333 or 444)) on one cis variant
NC0001_1.11:g.[{111T>G^222T>G}&{333>T>G^444T>G}] - match either one transvariant pattern or another
NC0001_1.11:g.{[111T>G];[222T>G]}^{[333T>G];[444T>G]} - match either one unphased variant pattern or another
NC0001_1.11:g.{[111T>G](;)[222T>G]}^{[333T>G](;)[444T>G]} - use nested logical operators
{NC0001_1.11:g.111T>G}^{NC0002_2.11:g.{[111T>G]^[222T>G]}^{[333T>G];[444T>G]}} 
WIP
var svn = require('seqvarnomjs');
var pattern = svn.parse('NC0001_1.11:g.[111T>G^222A>G]');
var genotype = svn.parse('NC0001_1.11:g.111T>G');
svn.match(pattern, genotype); // => true