Giter Club home page Giter Club logo

gql's People

Contributors

kevincol54 avatar mathiasbynens avatar yocontra 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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gql's Issues

Offer .json format export.

Hey,

right now it's not possible to really export the query to maybe use it with other modules.

I imagine the format like this:

{
   "needs": 2,
    "query": [
       {"exact": ["rs2032611": "D"]},
       {"has": "rs2032623"},
        {"or": [
           {"exact": ["rs2023651": "D"]},
           {"has": "rs20334341"}
         ]}
   ]
}

Having this would probably mean to also use this format internally, because converting those nested functions wouldn't work otherwise.

What do you think about it? I could create a PR for it.

naming conventions

I've started putting together a curated collection of interesting genosets and SNPs (located here). If possible, I'd like to make this useful for others in the community.

SNPedia uses the 'genoset' nomenclature for combinations of SNPs. It seems like this is usually used for gql queries, naming them 'gs103', 'gs159', etc. Are there any conventions in the genomeJS community for naming gql queries that refer to a single SNP? There are many interesting ones, such as the much-discussed "warrior vs. worrier" SNP, rs4680. This simply checks for hetero- or homozygosity at a single location. So far I've just been naming these according to their dbSNP number. But is there a better way?

Another (hopefully related) question: some of these tests would really be conveniently suited for some sort of trinary output (there might be distinct 'meanings' for homozygous A, homozygous G, or heterozygous). Has anyone discussed alternative output formats compared to simple boolean? Or is the best approach to have three separate boolean-output gql queries--i.e. 'rs4680AA', 'rs4680GG', and 'rs4680AG'?

Thanks for bearing with my pedantic questions!

Beginner-level issue implementing gql

Hi, first off I want to say thanks for all the amazing work that has gone into these projects (specifically gql and dna2json). I'm just starting to learn JavaScript and NodeJS. I'd like to see if I can implement a simple app using these tools. If so, then down the road (as I learn more) I hope to put together a genoset-checking and SNP-mapping tool for a project I'm working on.

That was a long introduction -- TLDR; please forgive the neophyte-level questions.

I'm doing something wrong, in trying to follow along with the examples, because nodemon is logging 'TypeError: gql.query is not a function,' where I invoke it in a 'genoset' file.

checkSNPs.js

`const fs = require('fs');
const path = require('path');
const es = require('event-stream');
const JSONStream = require('JSONStream');

exports.forGenotype = (genosetFile, jsonFile) => {
let genosetDefinition = require(./queries/${genosetFile})
let query = genosetDefinition();
let jsonReadStream = fs.createReadStream(jsonFile)
let genoStream = query.stream();

jsonReadStream
.pipe(JSONStream.parse('*'))
.pipe(genoStream);

let count = 0;

genoStream.on('data'),
function(snp) {
console.log('Analyzed ', ++count, ' SNPs')
}

genoStream.on('end', function() {
console.log("There are", query.matches().length, "matches for genoset 228");
console.log("There is a", query.percentage(), "percent chance that genoset matches");
});
}`

And here's my 'genoset definition' file, isSickleCellAffected.js

`const gql = require('gql');

module.exports = function() {
let query = gql.query();
query.needs(0);
query.or(query.exact('rs334', 'TT'), query.exact('i3003137', 'AA'));
return query;
};`

Testing for deletions

What would the appropriate gql method be for testing for a deletion? Forgive me if I just missed this, but I didn't see it in the documentation. From browsing dna2json, it appears that a deletion returns a null value for the rsid?

Thanks!

Non-boolean results e.g. percentages

http://www.snpedia.com/index.php/Gs122/criteria (I’m working on a repo for this one btw) is an example of a genoset for which each criterium has a certain weight that contributes to the end result.

# gs122 looks for increased risk of baldness based on
# 
# rs6625163(A;A) 1.2 (increased risk of baldness)
# rs1160312(A;A) 2 (1.6x increased risk of Male Pattern Baldness.)
# rs1160312(A;G) 2 (1.6x increased risk of Male Pattern Baldness.)
# rs201571(T;T) 2 (more likely to go bald)
# rs6036025(G;G) 1.2 (more likely to go bald)

The number e.g. the 1.2 following rs6625163(A;A) is the magnitude value as provided by SNPedia.

Should there be a way to give each criterium a weight in gql queries? If so, any ideas on what the API should look like? Discuss.

Meaning of `-` in gs syntax

I assume rs2032651(-;-) translates to exists(…), and rs2032651(-;A) to has(…, 'A'). Would be nice to have this confirmed fo sho/documented somehow.

TODO: document what these translate to

  • (;)
  • (;-;)
  • (;-A)
  • (A;-)
  • (D;D)

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.