{"_id":"56735913f79ca90d00ad2eba","__v":1,"category":{"_id":"5673512458c4890d00bb54a5","version":"5505855aae827939002fca6e","__v":12,"pages":["56735538f79ca90d00ad2eb6","567358274b2a680d00524e17","56735913f79ca90d00ad2eba","56735b4b4b2a680d00524e1d","56735b6b58c4890d00bb54af","56735b8d4b2a680d00524e22","56735ba358c4890d00bb54b1","56735bbff79ca90d00ad2ebd","56735bfd4b2a680d00524e25","56735c188565060d009a8667","56735ca54b2a680d00524e27","56735cbbf65d9c0d002e3cae"],"project":"55058559ae827939002fca6b","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-12-18T00:19:48.195Z","from_sync":false,"order":3,"slug":"gql","title":"GQL"},"project":"55058559ae827939002fca6b","user":"54ee2c053749bf0d00c7653c","version":{"_id":"5505855aae827939002fca6e","project":"55058559ae827939002fca6b","__v":4,"createdAt":"2015-03-15T13:12:58.366Z","releaseDate":"2015-03-15T13:12:58.366Z","categories":["5505855aae827939002fca6f","5673511f8565060d009a8659","5673512458c4890d00bb54a5","56736118f65d9c0d002e3cb2"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-12-18T00:53:39.633Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":2,"body":"This was translated from [GS144 on SNPedia](http://snpedia.com/index.php/Gs144/criteria)\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"var gql = require('gql');\\nvar dna = require('./your-dna.json');\\n\\nvar isMale = gql.atLeast(2, [\\n  gql.exact('rs2032651', 'D'),\\n  gql.has('rs2032651', 'A'),\\n  gql.has('rs9341296', 'C'),\\n  gql.has('rs9341296', 'T'),\\n  gql.has('rs13304168', 'C'),\\n  gql.has('rs13304168', 'T'),\\n  gql.has('rs1118473', 'A'),\\n  gql.has('rs1118473', 'G'),\\n  gql.has('rs150173', 'A'),\\n  gql.has('rs150173', 'C'),\\n  gql.has('rs16980426', 'G'),\\n  gql.has('rs16980426', 'T'),\\n  gql.or([\\n    gql.exact('rs1558843', 'C'),\\n    gql.exact('rs1558843', 'A')\\n  ]),\\n  gql.or([\\n    gql.exact('rs17222419', 'C'),\\n    gql.exact('rs17222419', 'T')\\n  ])\\n]);\\n\\nisMale(dna); // true or false\",\n      \"language\": \"javascript\"\n    },\n    {\n      \"code\": \"g = require 'gql'\\ndna = require './your-dna.json'\\n\\nisMale = g.atLeast 2, [\\n  g.exact 'rs2032651', 'D'\\n  g.has 'rs2032651', 'A'\\n  g.has 'rs9341296', 'C'\\n  g.has 'rs9341296', 'T'\\n  g.has 'rs13304168', 'C'\\n  g.has 'rs13304168', 'T'\\n  g.has 'rs1118473', 'A'\\n  g.has 'rs1118473', 'G'\\n  g.has 'rs150173', 'A'\\n  g.has 'rs150173', 'C'\\n  g.has 'rs16980426', 'G'\\n  g.has 'rs16980426', 'T'\\n  g.or [\\n    g.exact 'rs1558843', 'C'\\n    g.exact 'rs1558843', 'A'\\n  ]\\n  g.or [\\n    g.exact 'rs17222419', 'C'\\n    g.exact 'rs17222419', 'T'\\n  ]\\n]\\nisMale dna # true or false\",\n      \"language\": \"coffeescript\"\n    }\n  ]\n}\n[/block]\nThis is a good example of when GQL really helps out. Here's the whole project published as a module [if you want to check it out](https://github.com/genomejs/genoset-male).","excerpt":"","slug":"example-genoset-male","type":"basic","title":"Example: genoset-male"}

Example: genoset-male


This was translated from [GS144 on SNPedia](http://snpedia.com/index.php/Gs144/criteria) [block:code] { "codes": [ { "code": "var gql = require('gql');\nvar dna = require('./your-dna.json');\n\nvar isMale = gql.atLeast(2, [\n gql.exact('rs2032651', 'D'),\n gql.has('rs2032651', 'A'),\n gql.has('rs9341296', 'C'),\n gql.has('rs9341296', 'T'),\n gql.has('rs13304168', 'C'),\n gql.has('rs13304168', 'T'),\n gql.has('rs1118473', 'A'),\n gql.has('rs1118473', 'G'),\n gql.has('rs150173', 'A'),\n gql.has('rs150173', 'C'),\n gql.has('rs16980426', 'G'),\n gql.has('rs16980426', 'T'),\n gql.or([\n gql.exact('rs1558843', 'C'),\n gql.exact('rs1558843', 'A')\n ]),\n gql.or([\n gql.exact('rs17222419', 'C'),\n gql.exact('rs17222419', 'T')\n ])\n]);\n\nisMale(dna); // true or false", "language": "javascript" }, { "code": "g = require 'gql'\ndna = require './your-dna.json'\n\nisMale = g.atLeast 2, [\n g.exact 'rs2032651', 'D'\n g.has 'rs2032651', 'A'\n g.has 'rs9341296', 'C'\n g.has 'rs9341296', 'T'\n g.has 'rs13304168', 'C'\n g.has 'rs13304168', 'T'\n g.has 'rs1118473', 'A'\n g.has 'rs1118473', 'G'\n g.has 'rs150173', 'A'\n g.has 'rs150173', 'C'\n g.has 'rs16980426', 'G'\n g.has 'rs16980426', 'T'\n g.or [\n g.exact 'rs1558843', 'C'\n g.exact 'rs1558843', 'A'\n ]\n g.or [\n g.exact 'rs17222419', 'C'\n g.exact 'rs17222419', 'T'\n ]\n]\nisMale dna # true or false", "language": "coffeescript" } ] } [/block] This is a good example of when GQL really helps out. Here's the whole project published as a module [if you want to check it out](https://github.com/genomejs/genoset-male).