2.1.0 • Published 9 months ago

@bcgsc-pori/graphkb-parser v2.1.0

Weekly downloads
58
License
GPL-3.0
Repository
github
Last release
9 months ago

GraphKB Parser

codecov build npm version node versions

This repository is part of the platform for oncogenomic reporting and interpretation.

About

The GraphKB parser is a node module for parsing variant notation and producing strings from parsed notation.

Getting Started

Import the package (Or try it out online with RunKit)

const {parseVariant, stringifyVariant, jsonifyVariant} = require('@bcgsc-pori/graphkb-parser');

To use the variant parser methods simply pass a string into

> const parsedResult = parseVariant('FEATURE:p.G12D');
{
    'prefix': 'p',
    ...
}

Which returns a variant notation object. This can be turned back into a string

> stringifyVariant(parsedResult);
'FEATURE:p.G12D'

or a JSON (removes extra attributes used by parse methods)

> jsonifyVariant(parsedResult)

If the notation is improperly formatted, the parse function will raise a parsing error

try {
   const parsedResult = parseVariant('FEATUREp.G12D');
} catch (err) {
    if (err instanceof kbp.error.ParsingError) {
        console.log('Error in parsing the notation');
    }
}

See notation for information regarding the notation syntax.

2.1.0

9 months ago

2.0.0

2 years ago

1.1.3

2 years ago

1.1.2

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.0

3 years ago