Giter VIP home page Giter VIP logo

snappy's Introduction

Snappy

Travis FOSSA Status

Screenshot

Snappy helps you browse through and interpret your genotype data, right on your browser. It accepts raw genotype files from 23andMe, AncestryDNA and FamilyTreeDNA. All processing is done on the browser, without sending sensitive data over the wire.

This is a prototype, and many things don't work right now. Expect crappy code and frequent crashes caused by high memory use. But you can help make it better!

If you haven't tested yet, SNPedia has a good outline of genetic testing services, including cost and SNP coverage. Snappy also has an option to use 23andMe's sample data if you'd like to play around.

Getting started

You need Yarn to install dependencies. Simply run yarn then yarn run dev to fire up the dev server. To build for production, run yarn run build.

npm will work, but it's not recommended. Cats love yarn, and you will love it, too.

(Optional) Download latest data from SNPedia

Snappy depends on data from SNPedia to work. A copy is included in the repo but may be out-of-date. To generate an updated copy, you need Python 3:

cd scripts
pip3 install -r < requirements.txt
make

The scripts will download and parse SNPedia, finally generating JSON files Snappy can consume. Copy those files to data.

Hacking

Snappy follows the Airbnb style guide with a few restrictions removed, as defined in .eslintrc.js. Most of the interesting stuff happen in src/snappy, which you can import elsewhere with import MyModule from '@/snappy/MyModule';. By the way, you are more than welcome to suggest large, breaking changes! Have fun :)

Licensing

Snappy is licensed under the BSD 2-Clause License. See LICENSE.md for details.

This project depends on certain third-party packages. Run yarn licenses ls to show their respective licenses.

This repository includes third-party materials. See THIRDPARTY.md for details.

Acknowledgments

Snappy is inspired by Promethease, GENOtation and other tools aiming to help people understand their genetic information.

This project would not be possible without:

snappy's People

Contributors

fossabot avatar zhaofengli avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

snappy's Issues

Hangs when generating report with recent data

As explained in the README, I have updated the data/ files. I had to modify a couple of dependencies in the requirements.txt file but the update went well.
I replaced the json files in the data directory and re-run snappy. Since then, when clicking Generate Report, it would hang forever with the waiting in progress circle.
waiting

Edit

The javascript console says the following:

"SyntaxError: Expected "#", ")", ",", "<!--", or [ \t\r\n] but "T" found.
    at peg$buildStructuredError (webpack-internal:///246:317:14)
    at Object.peg$parse [as parse] (webpack-internal:///246:1033:13)
    at Function.parseGenosetCriteria (webpack-internal:///100:174:48)
    at Function.getRawQuery (webpack-internal:///100:712:34)
    at Object.eval [as match] (webpack-internal:///100:727:27)
    at eval (webpack-internal:///100:1111:26)"

So I assume there's malformed / unexpected data in genosets.json

All 5 json files are valid (successfully parsed by json_pp).

Edit

When disabling Enable genosets the report is correctly generated, so it confirms the error occurs when reading genosets.json.

Edit

I have successfully reproduced the bug and fixed it in a standalone Javascript code, this is what's failing:

{ c: 'and(\nor(rs73885319(A;G),rs60910145(G;T)),\nor(rs71785313(-;TTATAA),rs71785313(D;I))\n)',
  m: 5.5,
  r: 'Bad',
  s: '~6x higher risk for end-stage renal disease' }
ERROR: Parsing Failure:
ERROR: line 3 (column 18): ),\nor(rs71785313(-;TTATAA),rs71785313(D;
ERROR: -----------------------------------------^
ERROR: Expected "#", ")", ",", "<!--", or [ \t\r\n] but "T" found.

Changing [AGCTDI-] to [AGCTDI-]+ in my standalone code does the trick, but makes snappy fail with this error:

Error evaluating async computed property: TypeError: fn is not a function

Fix

Probably not the cleanest fix ever, but here's a patch for gs-criteria.pegjs that makes genosets work:

diff --git a/src/snappy/gs-criteria.pegjs b/src/snappy/gs-criteria.pegjs
index da7483b..79d3bee 100644
--- a/src/snappy/gs-criteria.pegjs
+++ b/src/snappy/gs-criteria.pegjs
@@ -23,7 +23,7 @@ Base
   = [AGCTDI-]
 
 Genotype
-  = allele1:Base ';' allele2:Base { return { type: 'Genotype', allele1, allele2 } }
+  = allele1:Base ';' allele2:Base Base* { return { type: 'Genotype', allele1, allele2 } }
 
 Number
   = n:[0-9]+ { return parseInt(n.join('')) }

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.