zhaofengli / snappy Goto Github PK
View Code? Open in Web Editor NEWHelps you browse through and interpret your genotype data
Home Page: https://snappy.zhaofeng.li
License: BSD 2-Clause "Simplified" License
Helps you browse through and interpret your genotype data
Home Page: https://snappy.zhaofeng.li
License: BSD 2-Clause "Simplified" License
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.
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('')) }
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.