npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

genometojson

v1.1.0

Published

Formats your commercial genome file as JSON

Downloads

25

Readme

genometojson

npm version

Build Status

Information

Terminology

SNP

A SNP (Single-Nucleotide Polymorphism - pronounced snip) is a variation of a single nucleotide (A, G, C or T) at some location in your genome. The presense of particular variants, or groups thereof, can tell you a lot about yourself (hair color, height, muscle type, allergies, response to disease, response to pharmaceuticals, heritage, etc.).

Commercial genome vendors will typically produce an analysis that covers some of these attributes - but will also provide you with 'raw' data, should you wish to investigate further.Your 'raw' data from any vendor will be a list of several hundred thousand SNPs, located across the autosomes (chromosomes 1-22), the sex chromosomes (X and Y), and possibly the mitochondrial chromosome. Given that your genome contains two copies of each autosome, and either XX (female) or XY (male), the data contains a 'genotype' composed of the two variants at each location.

Vendors

| Name | Supported | Price | Sample | Autosomal SNPs | Y SNPs | X SNPs | MT SNPs | Raw Data | |------|-----------|-------|--------|----------------|--------|--------|---------|----------| | 23andMe | Yes | 199/99 USD* | Saliva | 967,000 | 3,089 | 26,087 | 2,737 | Yes | | ancestryDNA | Yes | 99 USD | Saliva | 682,549 | 885 | 17,604 | 0 | Yes | | FamilyTree | Yes | 99 USD | Cheek Swab | 708,092 | 0 | 18,091 | 0 | Yes |

* 23andMe picing is 199 USD in the US and 99 USD abroad (the abroad test does not include Health Information).

CLI Usage

Use this if you just want to convert your data to the correct format so you can start querying your genome.

$ npm install genometojson -g
$ genometojson
Usage: genometojson <input file> <output file>
$ genometojson dna.txt dna.json
This will take a while...

Module Usage

var dna = require('genometojson');
var fs = require('fs');

var txt = fs.readFileSync('dna.txt');
dna.parse(txt, function(err, snps){
  // snps = the object with your mutations
});

SNP-JSON

Every vendor has their own format for your DNA. I decided to make a standard format called SNP-JSON. This library will convert custom formats to this standard.

SNP-JSON looks like this

{
  "rs4477212": {
    "chromosome": 1,
    "genotype": "AA"
  },
  "rs3094315": {
    "chromosome": 1,
    "genotype": "AA"
  },
  "rs3131972": {
    "chromosome": 1,
    "genotype": "GG"
  },
  "rs12124819": {
    "chromosome": 1,
    "genotype": "AA"
  },
  "rs11240777": {
    "chromosome": 1,
    "genotype": "GG"
  },
  "rs6681049": {
    "chromosome": 1,
    "genotype": "CC"
  },
  ...
}

Explanation:

  • The key is the RSID or vendor ID.
  • Chromosome is which chromosome the data came from (1-22, X, Y, or MT).
  • Genotype is the value for the RSID.

Differences between formats

SNP-JSON, SNPedia and vendor formats use different notations to indicate indels and no-calls.

| Format | Insertion | Deletion | No Call | Reference | |---------------|----------------------|----------|---------|-------------| | 23AndMe | I | D | - | https://customercare.23andme.com/hc/en-us/articles/212196888-What-does-not-determined-or-not-genotyped-mean- | | AncestryDNA | I | D | 0 | https://www.ancestry.com/dna/en/legal/us/faq#raw-6 | | FamilyTreeDNA | I | D | - | https://www.familytreedna.com/learn/autosomal-ancestry/universal-dna-matching/read-family-finder-raw-data-file/ | | SNP-JSON | I | - | ? | | | SNPedia | (the actual letters) | - | N/A | https://www.snpedia.com/index.php/Talk:Rs5030655 |

Using your SNP-JSON

Show me the code!!

In this example we will determine if you are immune to norovirus (Data from SNPedia):

var dna = require('./dna.json');

if (dna.rs601338.genotype == 'AA') {
  // congrats you are immune!
}

Example Files

The Folder Examples has a code example to use the module

The Folder Samples contains sample Genome files from different vendors and their JSON converted versions

LICENSE

Coming Soon..