{"_id":"_design/basic","_rev":"122-6aa34fcc95d41bdfa7e42e8bf30437b9","ignore-validate_doc_update":"function(newDoc, oldDoc, userCtx) {\r\n function forbidden(message) {\r\n\tthrow({forbidden : message}); // 403\r\n };\r\n function unauthorized(message) {\r\n\tthrow({unauthorized : message}); //401\r\n };\r\n if (userCtx.roles.indexOf('_admin') == -1) {\r\n\tforbidden(\"You may not create or edit documents.\")\r\n }\r\n}","language":"javascript","views":{"all":{"map":"function(doc) {\n emit(doc._id, doc);\n};"},"by_cytoband":{"map":"function(doc) {\n if (doc.Cytoband) {\n\temit(doc.Cytoband, doc._id);\n }\n};"},"get_probes":{"map":"function(doc) {\n if (doc.Probes) {\n\tfor (i = 0; i < doc.Probes.length; i++) {\n\t m = doc.Probes[i];\n\t emit([doc._id, m.Manufacturer, m.Platform], \n\t\t [m.Manufacturer, m.Platform, m.ProbeID]);\n\t}\n }\n};"},"by_probe2":{"map":"function(doc) {\n if (doc.Probes) {\n\tfor (i = 0; i < doc.Probes.length; i++) {\n\t m = doc.Probes[i];\n\t emit([m.Manufacturer, m.ProbeID, m.Platform], doc._id);\n\t}\n }\n};"},"by_ensembl":{"map":"function(doc) {\n if (doc.dbXrefs && doc.dbXrefs.Ensembl) {\n\temit(doc.dbXrefs.Ensembl, doc._id);\n }\n};"},"minlength":{"map":"function(doc) {\n if (doc.Maps) {\n\tfor (i = 0; i < doc.Maps.length; i++) {\n\t m = doc.Maps[i];\n\t emit([m.Chromosome, doc._id], \n\t\t m.TranscriptionEnd - m.TranscriptionStart + 1);\n\t}\n }\n};","reduce":"function(keys, values) {\r\n var c = null;\r\n for (i = 0; i < values.length; i++) {\r\n\tvar a = parseInt(values[i]);\r\n\tif (a == null) break;\r\n\tif (c == null) c = a;\r\n\tif (a < c) c = a;\r\n }\r\n return(c);\r\n}"},"by_mir":{"map":"function(doc) {\n if (doc.Maps) {\n\tfor (m =0; m < doc.Maps.length; m++) {\n\t n = doc.Maps[m];\n\t if (n.miRbase) {\n\t\temit(n.miRbase, doc._id);\n\t\tbreak;\n\t }\n\t}\n }\n};"},"by_alias":{"map":"function(doc) {\n if (doc.Symbol) {\n\temit(doc.Symbol, doc._id);\n }\n for each (a in doc.Aliases) {\n\temit(a, doc._id)\n }\n};"},"by_probe":{"map":"function(doc) {\n if (doc.Probes) {\n\tfor (i = 0; i < doc.Probes.length; i++) {\n\t m = doc.Probes[i];\n\t emit([m.Manufacturer, m.Platform, m.ProbeID], 1);\n\t}\n }\n};","reduce":"_sum"},"by_unigene":{"map":"function(doc) {\n if (doc.UniGene) {\n\temit(doc.UniGene, doc._id);\n }\n};"},"gene_location":{"map":"function(doc) {\n if (doc.Maps) {\n\tfor (i = 0; i < doc.Maps.length; i++) {\n\t m = doc.Maps[i];\n\t if (m.UCSC) {\n\t\temit([doc._id, \"UCSC-\" + m.UCSC, m.Chromosome], \n\t\t [m.Chromosome, \n\t\t parseInt(m.TranscriptionStart), \n\t\t parseInt(m.TranscriptionEnd)]);\n\t }\n\t if (m.MIRB) {\n\t\temit([doc._id, \"miRbase-\" + m.MIRB, m.Chromosome], \n\t\t [m.Chromosome, \n\t\t parseInt(m.TranscriptionStart), \n\t\t parseInt(m.TranscriptionEnd)]);\n\t }\n\t}\n }\n};","reduce":"function(keys, values) {\r\n var curs = null;\r\n var cure = null;\r\n for (i = 0; i < values.length; i++) {\r\n\tvar a = values[i][1]; \r\n\tvar b = values[i][2];\r\n\tif (a == null) break;\r\n\tif (b == null) break;\r\n\tif (curs == null) curs = a;\r\n\tif (cure == null) cure = b;\r\n\tif (a < curs) curs = a;\r\n\tif (b > cure) cure = b;\r\n }\r\n return([values[0][0], curs, cure]);\r\n}"},"by_symbol":{"map":"function(doc) {\n if (doc.Symbol) {\n\temit(doc.Symbol, doc._id);\n }\n};"},"by_location":{"map":"function(doc) {\n if (doc.Maps) {\n\tfor (i = 0; i < doc.Maps.length; i++) {\n\t m = doc.Maps[i];\n\t var build = null;\n\t if (m.UCSC) build = \"UCSC-\" + m.UCSC;\n\t if (m.MIRB) build = \"miRbase-\" + m.MIRB;\n\t emit([build, m.Chromosome, \n\t\t parseInt(m.TranscriptionStart), \n\t\t parseInt(m.TranscriptionEnd)],\n\t\t [doc._id, i]);\n\t}\n }\n};"},"maxlength":{"map":"function(doc) {\n if (doc.Maps) {\n\tfor (i = 0; i < doc.Maps.length; i++) {\n\t m = doc.Maps[i];\n\t emit([m.Chromosome, doc._id], \n\t\t m.TranscriptionEnd - m.TranscriptionStart + 1);\n\t}\n }\n};","reduce":"function(keys, values) {\r\n var c = null;\r\n for (i = 0; i < values.length; i++) {\r\n\tvar a = parseInt(values[i]);\r\n\tif (a == null) break;\r\n\tif (c == null) c = a;\r\n\tif (a > c) c = a;\r\n }\r\n return(c);\r\n}"}},"lists":{"htmlUnique":"function(head, req) {\n var row;\n var p = req.path;\n var view = p[p.length-1];\n var sk = req.query.startkey;\n var ek = req.query.endkey;\n var skn = null;\n var ekn = null;\n if (sk[3]) {\n \tskn = sk[3];\n }else{\n \tskn=sk[2];\n }\n if (ek[2]) {\n \tekn = ek[2];\n }else{\n \tekn=ek[3];\n }\n var build=sk[0]\n var chr=sk[1]\n var seen = new Object;\n start({ \"headers\": { \"Content-Type\": \"text/html\" }});\n while (row = getRow()) {\n\t\tif (row.doc) {\n\t\t var doc = row.doc;\n\t\t var sym = doc.Symbol;\n\t\t if (seen[sym]) continue;\n\t\t seen[sym] = 1;\n\t\t var y = '';\n\t\t // if (doc.Maps && view == 'by_location') {\n\t\t\t\t// var v = row.value[1];\n\t\t\t\t// var m = doc.Maps[v];\n\t\t\t\t// if (skn && m.TranscriptionEnd < skn) {\n\t\t\t\t// continue;\n\t\t\t\t// } else if (ekn && m. TranscriptionStart > ekn) {\n\t\t\t\t// continue;\n\t\t\t\t// } else {\n\t\t\t\t// y = '

Mapped to chromosome ' + m.Chromosome + \n\t\t\t\t// \t'. Transcription starts at '+ m.TranscriptionStart + \n\t\t\t\t// \t' and ends at ' + m.TranscriptionEnd + '

\\n';\n\t\t\t\t// // }\n\t\t\t\t \n\t\t // }\n\t\t if (doc.Maps && view == 'by_location'){\n\t\t \t\n\t\t \tfor (var i=0;i= parseInt(ekn)) {\n\t\t\t\t\t continue;\n\t\t\t\t\t} \n\t\t\t \t\tif (\"UCSC-\"+m.UCSC==build || \"miRbase=\"+m.MIRB==build){\n\t\t\t\t \t\t\ty = '

Build :'+m.UCSC+'. Mapped to chromosome ' + m.Chromosome + \n\t\t\t\t\t\t \t'. Transcription starts at '+ m.TranscriptionStart + \n\t\t\t\t\t\t \t' and ends at ' + m.TranscriptionEnd + '

\\n';\n\t\t\t\t\t\t \t\tx = '

' + doc.Symbol + '

\\n

' +\n\t\t\t\t\t\t\t\tdoc.Description + '

\\n';\n\t\t\t\t\t\t\t x += '

Entrez gene:' + doc._id + '. ';\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t \tx += '

check:' + chr+ '.' + skn+ '.'+ekn +'. ';\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t if (doc.Cytoband) {\n\t\t\t\t\t\t\t\t\tx += '

Located at cytoband ' + doc.Cytoband + '

\\n';\n\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t x += y;\n\t\t\t\t\t\t\t if (m.GenBank) {\n\t\t\t\t\t\t\t\t\tx += 'GenBank reference sequence: ' + m.GenBank;\n\t\t\t\t\t\t\t\t\tif (doc.dbXrefs && doc.dbXrefs.Ensembl) {\n\t\t\t\t\t\t\t\t\t x += '. Ensembl ID: ' + doc.dbXrefs.Ensembl;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t if (doc.UniGene) {\n\t\t\t\t\t\t\t\t\tx += '\\n

UniGene cluster: ' + doc.UniGene;\n\t\t\t\t\t\t\t }\t \n\t\t\t\t\t\t\t x += '

\\n';\n\t\t\t\t\t\t\t x += '';\n\t\t\t\t\t\t\t send(x);\n\t\t\t\t\t \t}\n\t\t \t\t}\n\n\t\t \t}\n\t\t} else {\n\t\t send(row.value + \"\\n\");\n\t\t}\n }\n};","includeProbes":"function(head, req) {\n var row;\n start({ \"headers\": { \"Content-Type\": \"text/html\" }});\n while (row = getRow()) {\n\tif (row.doc) {\n\t var y = '';\n\t var doc = row.doc;\n\t var a = Infinity;\n\t var b = -Infinity;\n\t if (doc.Maps) {\n\t\tfor (v = 0; v < doc.Maps.length; v++) {\n\t\t var m = doc.Maps[v];\n\t\t if (m.NCBI == \"v37\") {\n\t\t\ta = Math.min(a, parseInt(m.TranscriptionStart));\n\t\t\tb = Math.max(a, parseInt(m.TranscriptionEnd));\n\t\t }\n\t\t}\n\t\ty += '

Mapped to chromosome ' + m.Chromosome + \n\t\t '. Transcription starts at '+ a + \n\t\t ' and ends at ' + b + '

\\n';\n\t }\n\t x = '

' + doc.Symbol + '

\\n

' +\n\t\tdoc.Description + '

\\n';\n\t if (doc.Cytoband) {\n\t\tx += '

Located at cytoband ' + doc.Cytoband + '

\\n';\n\t }\n\t x += y;\n\t x += '

Entrez gene:' + doc._id + '. ';\n\t if (doc.GenBank) {\n\t\tx += 'GenBank reference sequence: ' + doc.GenBank;\n\t\tif (doc.dbXrefs && doc.dbXrefs.Ensembl) {\n\t\t x += '. Ensembl ID: ' + doc.dbXrefs.Ensembl;\n\t\t}\n\t }\n\t if (doc.UniGene) {\n\t\tx += '\\n

UniGene cluster: ' + doc.UniGene;\n\t }\t \n\t x += '

\\n';\n\t if (doc.Probes) {\n\t\tvar z = '

Probes

\\n';\n\t\tx += z;\n\t }\n\t x += '

Links

';\n\t send(x);\n\t} else {\n\t send(row.value + \"\\n\");\n\t}\n }\n};","html":"function(head, req) {\n var row;\n start({ \"headers\": { \"Content-Type\": \"text/html\" }});\n var build=req.query.build.toString().replace(\"UCSC-\",\"\").replace(/\\\"/g,'');\n var NCBI;\n while (row = getRow()) {\n\t\tif (row.doc) {\n\t\t var y = '';\n\t\t var doc = row.doc;\n\t\t var a = Infinity;\n\t\t var b = -Infinity;\n\t\t var m,UCSC;\n\t\t if (doc.Maps) {\n\n\t\t\t\tfor (v = 0; v < doc.Maps.length; v++) {\n\t\t\t\t\tm = doc.Maps[v];\n\t\t\t\t\tif (m.UCSC==build){\n\t\t\t\t\t// if (m.NCBI == \"v37\" || m.NCBI== \"GRCh37\") {\n\t\t\t\t\t\t\ta = Math.min(a, parseInt(m.TranscriptionStart));\n\t\t\t\t\t\t\tb = Math.max(a, parseInt(m.TranscriptionEnd));\t\n\t\t\t\t\t\t\tNCBI=m.NCBI\t\t\t\t\n\t\t\t\t\t// }\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\ty += '

Mapped to chromosome ' + m.Chromosome + \n\t\t\t\t '. Transcription starts at '+ a + \n\t\t\t \t ' and ends at ' + b + ' (UCSC '+build+' NCBI '+NCBI+')

\\n';\n\t\t\t// if (NCBI == \"v37\"){\n\t\t\t// \ty += '

Mapped to chromosome ' + m.Chromosome + \n\t\t\t// \t '. Transcription starts at '+ a + \n\t\t\t// \t ' and ends at ' + b + ' (UCSC hg19)

\\n';\n\n\t\t\t// }else if(NCBI == \"GRCh37\"){\n\t\t\t// \ty += '

Mapped to chromosome ' + m.Chromosome + \n\t\t\t// \t '. Transcription starts at '+ a + \n\t\t\t// \t ' and ends at ' + b + ' (GENCODE GRCh37)

\\n';\n\t\t\t// }else {\n\t\t\t// \ty += '

Mapped to chromosome ' + m.Chromosome + \n\t\t\t// '.

\\n';\n\t\t // }\n\t\t\t// y += '

Mapped to chromosome ' + m.Chromosome + \n\t\t\t// '. Transcription starts at '+ a + \n\t\t\t// ' and ends at ' + b + '

\\n';\n\t\t // }\n\t\t x = '

' + doc.Symbol + '

\\n

' +\n\t\t\tdoc.Description + '

\\n';\n\t\t if (doc.Cytoband) {\n\t\t\t\tx += '

Located at cytoband ' + doc.Cytoband + '

\\n';\n\t\t }\n\t\t x += y;\n\t\t x += '

Entrez gene:' + doc._id + '. ';\n\t\t if (doc.GenBank) {\n\t\t\t\tx += 'GenBank reference sequence: ' + doc.GenBank;\n\t\t\t\tif (doc.dbXrefs && doc.dbXrefs.Ensembl) {\n\t\t\t\t x += '. Ensembl ID: ' + doc.dbXrefs.Ensembl;\n\t\t\t\t}\n\t\t }\n\t\t if (doc.UniGene) {\n\t\t\t\tx += '\\n

UniGene cluster: ' + doc.UniGene;\n\t\t }\t \n\t\t x += '

\\n';\n\t\t x += '';\n\t\t send(x);\n\t\t} else {\n\t\t send(row.value + \"\\n\");\n\t\t}\n }\n};","open":"function (head, req) {\r\n\r\n var row;\r\n var ii = 0;\r\n\r\n start({'headers': {\r\n 'Content-Type': 'application/json',\r\n\t\"Access-Control-Allow-Origin\": \"*\"\r\n }});\r\n\r\n send (\"[\");\r\n while ((row = getRow()) !== null) {\r\n\tsend ((ii > 0 ? \",\":\"\") + JSON.stringify(row.doc));\r\n\tii++;\r\n }\r\n send (\"]\");\r\n}"},"updates":{},"shows":{"ucsc":"function(doc, req) {\r\n x = '' + doc.Symbol +\r\n\t'

' + doc.Symbol + '

\\n

' +\r\n\tdoc.Description + '

'\r\n if (doc.Cytoband) {\r\n\tx += '

Located at cytoband ' + doc.Cytoband + '

\\n'\r\n }\r\n if (doc.GenBank) {\r\n\tx += '

GenBank reference sequence: ' + doc.GenBank+ '

\\n'\r\n }\r\n x += ''\r\n return { 'body': x };\r\n}","probes":"function(doc, req) {\r\n var y = '';\r\n var a = Infinity;\r\n var b = -Infinity;\r\n if (doc.Maps) {\r\n\tfor (v = 0; v < doc.Maps.length; v++) {\r\n\t var m = doc.Maps[v];\r\n\t if (m.NCBI == \"v37\") {\r\n\t\ta = Math.min(a, parseInt(m.TranscriptionStart));\r\n\t\tb = Math.max(a, parseInt(m.TranscriptionEnd));\r\n\t }\r\n\t}\r\n\ty += '

Mapped to chromosome ' + m.Chromosome + \r\n\t '. Transcription starts at '+ a + \r\n\t ' and ends at ' + b + '

\\n';\r\n }\r\n x = '' + doc.Symbol +\r\n\t'

' + doc.Symbol + '

\\n

' +\r\n\tdoc.Description + '

'\r\n if (doc.Cytoband) {\r\n\tx += '

Located at cytoband ' + doc.Cytoband + '

\\n'\r\n }\r\n x += y;\r\n x += '

Entrez gene: ' + doc._id + '. ';\r\n if (doc.GenBank) {\r\n\tx += '

GenBank reference sequence: ' + doc.GenBank+ '

\\n'\r\n }\r\n if (doc.UniGene) {\r\n\tx += '\\n

UniGene cluster: ' + doc.UniGene;\r\n }\r\n x += '

';\r\n if (doc.Probes) {\r\n\tvar z = '

Probes

\\n';\r\n\tx += z;\r\n }\r\n x += '

Links

'\r\n return { 'body': x };\r\n}"},"couchapp":{"manifest":["couchapp.json","ignore-validate_doc_update.js","language","lists/","lists/html.js","lists/htmlUnique.js","lists/includeProbes.js","lists/open.js","shows/","shows/probes.js","shows/ucsc.js","updates/","views/","views/all/","views/all/map.js","views/by_alias/","views/by_alias/map.js","views/by_cytoband/","views/by_cytoband/map.js","views/by_ensembl/","views/by_ensembl/map.js","views/by_location/","views/by_location/map.js","views/by_mir/","views/by_mir/map.js","views/by_probe/","views/by_probe/map.js","views/by_probe/reduce.js","views/by_probe2/","views/by_probe2/map.js","views/by_symbol/","views/by_symbol/map.js","views/by_unigene/","views/by_unigene/map.js","views/gene_location/","views/gene_location/map.js","views/gene_location/reduce.js","views/get_probes/","views/get_probes/map.js","views/maxlength/","views/maxlength/map.js","views/maxlength/reduce.js","views/minlength/","views/minlength/map.js","views/minlength/reduce.js"],"signatures":{"jquery.js":"b25b0460d7ddea993dad32005f56d255","index.html":"62a2bc3a4c581871bfbf9e551199e6aa","genesmash.js":"fba84603474cf706e8043e6c2d9c8d42","api.html":"0ca9858b11948816a676e20e2d532a54","images/genesmash.eps":"d85ccfb978bdc82a81174753956a6688","suggestions.js":"6ec926dd06f831516f5d5bf672149ac3","json2.js":"fad58c0e6e585ed34ac740ea15dcf60c","jquery.suggest.js":"b689c925c75eca1d3a549ad355a63f72","jquery.couch.js":"996ad4cee507c62664513d2d1724a659","images/MDACC_RGB_TC_tag_V.png":"5dcd88884a1a8c3fbe63da090ce8bc53","style/layout.css":"99914c43c7aafbc445612b2731eb5777","couch.js":"f0aaedc350bfccdf1ca18cda2cd66957",".DS_Store":"7396e106d8ff7c34082be25c2436413e","docs.html":"422786fc31df73261dc0550d3973bd9f","images/MDACC_RGB_TC_tag_V.jpg":"12c3ddf43c1e391378845ab19762accc","images/genesmash.png":"b2a9805d27e3b5b3390963ededcf9e49"},"name":"geneSmash: Human Gene Information Mash-Up","objects":{},"description":"A relaxed way to get information about genes"},"_attachments":{"jquery.js":{"content_type":"application/javascript","revpos":87,"digest":"md5-XxWPVAp/cZPPiOAKhG5WHQ==","length":267739,"stub":true},"index.html":{"content_type":"text/html","revpos":89,"digest":"md5-yRw3YdpzDfQG257T0aVFUw==","length":7207,"stub":true},"genesmash.js":{"content_type":"application/javascript","revpos":122,"digest":"md5-jHs6yC/rVtdTek1BPQccvw==","length":9279,"stub":true},"api.html":{"content_type":"text/html","revpos":1,"digest":"md5-Ic5MBa+05c1sc57vACYQOQ==","length":6608,"stub":true},"docs.html":{"content_type":"text/html","revpos":1,"digest":"md5-/7gZFdOOkbQfLza5PoHLEw==","length":13585,"stub":true},"suggestions.js":{"content_type":"application/javascript","revpos":1,"digest":"md5-G6nzG/xNoTw1EZtzSx+ZiQ==","length":1131,"stub":true},"images/MDACC_RGB_TC_tag_V.jpg":{"content_type":"image/jpeg","revpos":1,"digest":"md5-EsPd9DweORN4hFqxl2KszA==","length":133041,"stub":true},"jquery.suggest.js":{"content_type":"application/javascript","revpos":89,"digest":"md5-uroAzFq329SpqC1r9U0nBQ==","length":5070,"stub":true},"jquery.couch.js":{"content_type":"application/javascript","revpos":85,"digest":"md5-v1/gp3sEc7WZ7tbdRt4/8g==","length":39480,"stub":true},"images/MDACC_RGB_TC_tag_V.png":{"content_type":"image/png","revpos":1,"digest":"md5-Xc2IiEoajD++Y9oJDOi8Uw==","length":38203,"stub":true},"style/layout.css":{"content_type":"text/css","revpos":1,"digest":"md5-UB80YeoQiZivmk6S415FOw==","length":1475,"stub":true},"images/genesmash.png":{"content_type":"image/png","revpos":1,"digest":"md5-sqmAXSfjtbM5CWPt7c+eSQ==","length":5704,"stub":true},".DS_Store":{"content_type":"","revpos":8,"digest":"md5-c5bhBtj/fDQIK+JcJDZBPg==","length":6148,"stub":true},"json2.js":{"content_type":"application/javascript","revpos":85,"digest":"md5-SgEF8n18akQYKV4z1JmfWw==","length":17382,"stub":true},"images/genesmash.eps":{"content_type":"application/postscript","revpos":1,"digest":"md5-2FzPuXi9yCqBF0dTlWpmiA==","length":1145,"stub":true},"couch.js":{"content_type":"application/javascript","revpos":73,"digest":"md5-IjG0pEEtfGrdAHWhvWHNKA==","length":16368,"stub":true}}}