![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
genomediff
Advanced tools
Parses strings from files in the GenomeDiff format generated by the breseq variant caller for haploid microbial organisms.
Parses strings from files in the GenomeDiff format generated by the breseq variant caller for haploid microbial organisms.
$(node bin)/npm install genomediff
Note: It has only been tested with Node 5.
GenomeDiff strings are parsed using GenomeDiff.parse(<string>)
. The GenomeDiff object contains a metadata
dict with the meta data, as well as mutations
, evidence
and validation
lists, each containing records of that type. Records can be accessed through this list or by id using GenomeDiff.parse(<string>)[<id>]
. GenomeDiff is an iterable and iterating it will return all properties and records.
For accessing all the records you can use GenomeDiff.parse('<string>').values()
which returns an iterable but only with the Record
types.
For accessing the parents of a specific mutation you can use the parents
property available on each record:
let doc = GenomeDiff.parse('<string>'); // a genomediff string
let someMutation = doc[12]; // mutation with id '12'
someMutation.parents // this will lookup all the parents of the record with id `12` and return as an array of Records
If you want to get an attribute from a parent record then you can use the .get(<attribute>)
method available on the record to do so:
let doc = GenomeDiff.parse('<string>'); // a genomediff string
let someMutation = doc[12]; // mutation with id '12'
someMutation.get('coverage') // this will lookup all the parents of the record with id `12` and return the value of the attribute `coverage` if found on any of the parent records
If used with node, you can use the following:
var GenomeDiff = require('genomediff').GenomeDiff;
var fs = require('fs');
var file = fs.readFileSync('<path>', "utf8"); // path to your `.gd` file
var doc = GenomeDiff.parse(file);
If used in a browser, use:
import {GenomeDiff} from 'genomediff';
var doc = GenomeDiff.parse('<string>'); // a genomediff string
Note: Keep in mind that this package requires an ES6 environment in order to work.
This library adds an additional mutational type called MCDEL
(it is not found in the bacterial genome reseq GD spec). This type is computed from a MC
evidence type who's id is not referenced by any of the DEL
mutations. This custom mutation type means that the MC
evidence is interpreted as a DEL
mutation.
A full test suite can be run using npm test
. If you wish to run tests on file change, use jasmine-node dist/ --autotest --color --verbose
.
When developing, use tsc --watch
to build the .ts
files on change. Alternatively, you can use npm run build
if you do not wish to run the build on file change.
Note: If you add new files or remove files, make sure to edit the "files"
field in tsconfig.json
:
"files": [
"./tsd_typings/tsd.d.ts", // never remove this line
// add more files after this line
"./src/parser.ts",
"./src/parser.spec.ts",
"./src/records.ts",
"./src/records.spec.ts",
"./src/gd.ts",
"./src/gd.spec.ts"
]
FAQs
Parses strings from files in the GenomeDiff format generated by the breseq variant caller for haploid microbial organisms.
We found that genomediff demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.