Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [
- {
- "id": "9af32fed.bc7fb",
- "type": "http in",
- "z": "8f712d25.103e6",
- "name": "",
- "url": "/biosuitcase",
- "method": "get",
- "swaggerDoc": "",
- "x": 3124.0008697509766,
- "y": 129.28579711914062,
- "wires": [
- [
- "fa7f6c66.48355"
- ]
- ]
- },
- {
- "id": "9e1f4692.93f4f8",
- "type": "template",
- "z": "8f712d25.103e6",
- "name": "HTML",
- "field": "payload",
- "fieldType": "msg",
- "format": "handlebars",
- "syntax": "mustache",
- "template": "<!DOCTYPE html>\n<html lang=\"en\">\n\n<head>\n\n <meta charset=\"utf-8\">\n <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n <meta name=\"description\" content=\"\">\n <meta name=\"author\" content=\"\">\n\n <title>BioSuitcase - A maleta do bioinformata</title>\n\n <!-- Bootstrap Core CSS -->\n <link href=\"https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css\" rel=\"stylesheet\" integrity=\"sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u\" crossorigin=\"anonymous\">\n\n <!-- Custom CSS -->\n <style>{{{payload.style}}}</style>\n \n <script src=\"https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js\"></script>\n \n <script src=\"https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js\"></script>\n\n <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->\n <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->\n <!--[if lt IE 9]>\n <script src=\"https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js\"></script>\n <script src=\"https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js\"></script>\n <![endif]-->\n\n</head>\n\n<body>\n\n <!-- Navigation -->\n <nav class=\"navbar navbar-inverse navbar-fixed-top\" role=\"navigation\">\n <div class=\"container\">\n <!-- Brand and toggle get grouped for better mobile display -->\n <div class=\"navbar-header\">\n <button type=\"button\" class=\"navbar-toggle\" data-toggle=\"collapse\" data-target=\"#bs-example-navbar-collapse-1\">\n <span class=\"sr-only\">Toggle navigation</span>\n <span class=\"icon-bar\"></span>\n <span class=\"icon-bar\"></span>\n <span class=\"icon-bar\"></span>\n </button>\n <a class=\"navbar-brand\" href=\"#\">Start Bootstrap</a>\n </div>\n <!-- Collect the nav links, forms, and other content for toggling -->\n <div class=\"collapse navbar-collapse\" id=\"bs-example-navbar-collapse-1\">\n <ul class=\"nav navbar-nav\">\n <li>\n <a href=\"#\">About</a>\n </li>\n <li>\n <a href=\"#\">Services</a>\n </li>\n <li>\n <a href=\"#\">Contact</a>\n </li>\n </ul>\n </div>\n <!-- /.navbar-collapse -->\n </div>\n <!-- /.container -->\n </nav>\n\n <!-- Page Content -->\n <div class=\"container\">\n\n <!-- Portfolio Item Heading -->\n <div class=\"row\">\n <div class=\"col-lg-12\">\n <h1 class=\"page-header\">Busca</h1>\n </div>\n </div>\n <!-- /.row -->\n\n <!-- Portfolio Item Row -->\n <div class=\"row\">\n\n <div class=\"col-md-8\">\n <form method=\"post\" action=\"/biosuitcase/ncbi_search\" ajax=\"true\" id=\"form_idade\">\n <div class=\"form-group\">\n <label for=\"fterm\">Termo:</label>\n <input type=\"text\" id=\"fterm\" name=\"term\" placeholder=\"{{{term}}}\" class=\"form-control\"> \n </div>\n <div class=\"form-group\">\n <label for=\"db\">Banco</label>\n <select class=\"form-control\" id=\"db\" name=\"db\">\n <option value=\"pubmed\">Pubmed</option>\n <option value=\"nucleotide\">Nucleotide</option>\n <option value=\"structure\">Structure</option>\n </select>\n </div> \n <button type=\"submit\" class=\"btn btn-default\">Submit</button>\n </form>\n \n <h3>Resultados Encontrados</h3>\n \n <div id=\"results\">\n {{{payload.results}}}\n </div>\n </div>\n\n <div class=\"col-md-4\">\n {{{payload.result_details}}}\n </div>\n\n </div>\n <!-- /.row -->\n\n <hr>\n\n <!-- Footer -->\n <footer>\n <div class=\"row\">\n <div class=\"col-lg-12\">\n <p>BioSuitcase - A maleta do bioinformata</p>\n <p>By Inácio Medeiros</p>\n </div>\n </div>\n <!-- /.row -->\n </footer>\n\n </div>\n <!-- /.container -->\n</body>\n\n</html>\n",
- "x": 3465.857940673828,
- "y": 199.7143039703369,
- "wires": [
- [
- "b24f0da7.daf818"
- ]
- ]
- },
- {
- "id": "b24f0da7.daf818",
- "type": "http response",
- "z": "8f712d25.103e6",
- "name": "",
- "x": 3607.6436767578125,
- "y": 199.8571720123291,
- "wires": []
- },
- {
- "id": "fa7f6c66.48355",
- "type": "template",
- "z": "8f712d25.103e6",
- "name": "CSS",
- "field": "payload.style",
- "fieldType": "msg",
- "format": "css",
- "syntax": "mustache",
- "template": "/*!\n * Start Bootstrap - Portfolio Item (http://startbootstrap.com/)\n * Copyright 2013-2016 Start Bootstrap\n * Licensed under MIT (https://github.com/BlackrockDigital/startbootstrap/blob/gh-pages/LICENSE)\n */\n\nbody {\n padding-top: 70px; /* Required padding for .navbar-fixed-top. Remove if using .navbar-static-top. Change if height of navigation changes. */\n}\n\n.portfolio-item {\n margin-bottom: 25px;\n}\n\n.result_box {\n border-radius: 25px;\n border: 2px solid #73AD21;\n padding: 2pt;\n}\n\n.result_text {\n color: #0000FF;\n}\n\n.pub_title, .pub_authors {\n font-weight: bold;\n color: #00FF00;\n}\n\n.abstract {\n color: #00AA00;\n}\n\nfooter {\n margin: 50px 0;\n}",
- "x": 3324.2865600585938,
- "y": 199.57144355773926,
- "wires": [
- [
- "9e1f4692.93f4f8"
- ]
- ]
- },
- {
- "id": "18055fe.9d593a",
- "type": "http in",
- "z": "8f712d25.103e6",
- "name": "",
- "url": "/biosuitcase/ncbi_search",
- "method": "post",
- "swaggerDoc": "",
- "x": 145,
- "y": 55.14282703399658,
- "wires": [
- [
- "dfa21026.fb93b"
- ]
- ]
- },
- {
- "id": "3fb96b1c.5915cc",
- "type": "xml",
- "z": "8f712d25.103e6",
- "name": "",
- "attr": "",
- "chr": "",
- "x": 1386.4998893737793,
- "y": 57.14270305633545,
- "wires": [
- [
- "a114c5e.bed78b8"
- ]
- ]
- },
- {
- "id": "a114c5e.bed78b8",
- "type": "function",
- "z": "8f712d25.103e6",
- "name": "Extract ID List",
- "func": "msg.id_list = msg.payload.eSearchResult.IdList[0].Id;\nreturn msg;",
- "outputs": 1,
- "noerr": 0,
- "x": 1575.500144958496,
- "y": 145.14276444911957,
- "wires": [
- [
- "2ea17a0.1d53e86"
- ]
- ]
- },
- {
- "id": "1c38721f.59e7b6",
- "type": "function",
- "z": "8f712d25.103e6",
- "name": "Publications Search",
- "func": "msg.payload = \"db=pubmed&\";\nreturn msg;",
- "outputs": 1,
- "noerr": 0,
- "x": 768.0000114440918,
- "y": 20,
- "wires": [
- [
- "d74b1aa8.83d71"
- ]
- ]
- },
- {
- "id": "b769692a.62e0f",
- "type": "function",
- "z": "8f712d25.103e6",
- "name": "DNA-Seq Search",
- "func": "msg.payload = \"db=nucleotide&\";\nreturn msg;",
- "outputs": 1,
- "noerr": 0,
- "x": 758.0000114440918,
- "y": 56,
- "wires": [
- [
- "d74b1aa8.83d71"
- ]
- ]
- },
- {
- "id": "a5788c3e.c40e68",
- "type": "function",
- "z": "8f712d25.103e6",
- "name": "Structure Search",
- "func": "msg.payload = \"db=structure&\";\nreturn msg;",
- "outputs": 1,
- "noerr": 0,
- "x": 758.0000839233398,
- "y": 96.00000762939453,
- "wires": [
- [
- "d74b1aa8.83d71"
- ]
- ]
- },
- {
- "id": "dec1f4a5.614ec",
- "type": "switch",
- "z": "8f712d25.103e6",
- "name": "",
- "property": "db",
- "propertyType": "msg",
- "rules": [
- {
- "t": "eq",
- "v": "pubmed",
- "vt": "str"
- },
- {
- "t": "eq",
- "v": "nucleotide",
- "vt": "str"
- },
- {
- "t": "eq",
- "v": "structure",
- "vt": "str"
- }
- ],
- "checkall": "true",
- "outputs": 3,
- "x": 549.5000114440918,
- "y": 56,
- "wires": [
- [
- "1c38721f.59e7b6"
- ],
- [
- "b769692a.62e0f"
- ],
- [
- "a5788c3e.c40e68"
- ]
- ]
- },
- {
- "id": "dfa21026.fb93b",
- "type": "function",
- "z": "8f712d25.103e6",
- "name": "param config",
- "func": "msg.db = msg.payload.db;\nmsg.term = msg.payload.term;\nreturn msg;",
- "outputs": 1,
- "noerr": 0,
- "x": 387.50003814697266,
- "y": 56,
- "wires": [
- [
- "dec1f4a5.614ec"
- ]
- ]
- },
- {
- "id": "ed3c60a2.7cd1",
- "type": "http request",
- "z": "8f712d25.103e6",
- "name": "NCBI E-Search",
- "method": "GET",
- "ret": "txt",
- "url": "",
- "tls": "",
- "x": 1223.2858695983887,
- "y": 56.71429443359375,
- "wires": [
- [
- "3fb96b1c.5915cc"
- ]
- ]
- },
- {
- "id": "96c8005.f62928",
- "type": "http request",
- "z": "8f712d25.103e6",
- "name": "NCBI E-Summary",
- "method": "GET",
- "ret": "txt",
- "url": "",
- "tls": "",
- "x": 2049.250534057617,
- "y": 198.75011730194092,
- "wires": [
- [
- "70692f4.8670dd"
- ]
- ]
- },
- {
- "id": "d44455da.1157b8",
- "type": "switch",
- "z": "8f712d25.103e6",
- "name": "switch db",
- "property": "db",
- "propertyType": "msg",
- "rules": [
- {
- "t": "eq",
- "v": "pubmed",
- "vt": "str"
- },
- {
- "t": "eq",
- "v": "nucleotide",
- "vt": "str"
- },
- {
- "t": "eq",
- "v": "structure",
- "vt": "str"
- }
- ],
- "checkall": "true",
- "outputs": 3,
- "x": 2373.0003662109375,
- "y": 198.75012266635895,
- "wires": [
- [
- "f649dcef.7b4b68"
- ],
- [
- "dd2bc388.b125a8"
- ],
- [
- "e339317c.c971a8"
- ]
- ]
- },
- {
- "id": "f649dcef.7b4b68",
- "type": "function",
- "z": "8f712d25.103e6",
- "name": "Parse Pubmed Results",
- "func": "var publications = [];\n\nvar publication = null;\nvar pub_it = null;\nvar author_list = null;\n\nvar e_summary_results = msg.payload.eSummaryResult.DocSum;\n\nconst TITLE_INDEX = 5;\nconst AUTHOR_LIST_INDEX = 3;\nconst PUB_DATE_INDEX = 1;\n\nfor(var pub = 0; pub < e_summary_results.length; pub++){\n publication = {};\n pub_it = e_summary_results[pub];\n \n publication.id = pub_it.Id[0];\n publication.title = pub_it.Item[TITLE_INDEX]._;\n publication.pub_date = pub_it.Item[PUB_DATE_INDEX]._;\n \n publication.authors = [];\n \n author_list = pub_it.Item[AUTHOR_LIST_INDEX].Item;\n for(var i_author = 0; i_author < author_list.length; i_author++){\n publication.authors.push(author_list[i_author]._);\n }\n\n publications.push(publication);\n}\n\nmsg.pub_ids = [];\nmsg.pub_titles = [];\nmsg.pub_authors = [];\nmsg.pub_dates = [];\n\nfor(var pub = 0; pub < publications.length; pub++){\n msg.pub_ids.push(publications[pub].id);\n msg.pub_titles.push(publications[pub].title.replace(/[^a-zA-Z ]/g, \"\"));\n msg.pub_dates.push(publications[pub].pub_date);\n msg.pub_authors.push(publications[pub].authors[0]);\n}\n\nreturn msg;",
- "outputs": 1,
- "noerr": 0,
- "x": 2598.0004806518555,
- "y": 155.5001484155655,
- "wires": [
- [
- "60c8a7de.fce128"
- ]
- ]
- },
- {
- "id": "dd2bc388.b125a8",
- "type": "function",
- "z": "8f712d25.103e6",
- "name": "Parse Nucleotide Results",
- "func": "var gene = null;\nvar gene_it = null;\nvar author_list = null;\n\nmsg.gene_ids = [];\nmsg.gene_names = [];\nmsg.gene_bps = [];\n\nvar e_summary_results = msg.payload.eSummaryResult.DocSum;\n\nconst NAME_INDEX = 1;\nconst BP_INDEX = 8;\n\nfor(var gen = 0; gen < e_summary_results.length; gen++){\n gene = {};\n gene_it = e_summary_results[gen];\n \n msg.gene_ids.push(gene_it.Id[0]);\n msg.gene_names.push(gene_it.Item[NAME_INDEX]._.replace(/[^a-zA-Z ]/g, \"\"));\n msg.gene_bps.push(gene_it.Item[BP_INDEX]._);\n}\n\nreturn msg;",
- "outputs": 1,
- "noerr": 0,
- "x": 2608.0005416870117,
- "y": 198.50010359287262,
- "wires": [
- [
- "d83da379.80172"
- ]
- ]
- },
- {
- "id": "e339317c.c971a8",
- "type": "function",
- "z": "8f712d25.103e6",
- "name": "Parse Structure Results",
- "func": "var structure = null;\nvar structure_it = null;\nvar author_list = null;\n\nvar e_summary_results = msg.payload.eSummaryResult.DocSum;\n\nconst PDB_INDEX = 0;\nconst DESCRIPTION_INDEX = 1;\nconst CLASS_INDEX = 5;\n\nmsg.struct_ids = [];\nmsg.struct_pdbs = [];\nmsg.struct_descrs = [];\nmsg.struct_classes = [];\n\nfor(var struct = 0; struct < e_summary_results.length; struct++){\n structure = {};\n structure_it = e_summary_results[struct];\n \n msg.struct_ids.push(structure_it.Id[0]);\n msg.struct_pdbs.push(structure_it.Item[PDB_INDEX]._);\n msg.struct_descrs.push(structure_it.Item[DESCRIPTION_INDEX]._.replace(/[^a-zA-Z ]/g, \"\"));\n msg.struct_classes.push(structure_it.Item[CLASS_INDEX]._.replace(/[^a-zA-Z ]/g, \"\"));\n}\n\nreturn msg;",
- "outputs": 1,
- "noerr": 0,
- "x": 2607.0005111694336,
- "y": 241.50011885166168,
- "wires": [
- [
- "6800a188.5f209"
- ]
- ]
- },
- {
- "id": "d74b1aa8.83d71",
- "type": "function",
- "z": "8f712d25.103e6",
- "name": "NCBI E-Search URL",
- "func": "var base_url = \"https://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?\";\n\nvar db = msg.payload;\nvar term = \"&term=\" + msg.term;\n\nmsg.payload = base_url + db + term;\n\nmsg.url = msg.payload;\n\nreturn msg;",
- "outputs": 1,
- "noerr": 0,
- "x": 1008.5000114440918,
- "y": 56,
- "wires": [
- [
- "ed3c60a2.7cd1"
- ]
- ]
- },
- {
- "id": "2ea17a0.1d53e86",
- "type": "function",
- "z": "8f712d25.103e6",
- "name": "NCBI E-Summary URL",
- "func": "var esummary_url = \"https://eutils.ncbi.nlm.nih.gov/entrez/eutils/esummary.fcgi?\";\n\nvar ids = \"id=\";\n\nfor(var i = 0; i < msg.id_list.length-1; i++){\n ids += msg.id_list[i] + \",\";\n}\n\nids += msg.id_list[msg.id_list.length-1];\n\nmsg.url = esummary_url + \"db=\" + msg.db + \"&\" + ids + \"&retmode=xml\";\n\nreturn msg;",
- "outputs": 1,
- "noerr": 0,
- "x": 1804.7583465576172,
- "y": 198.88680934906006,
- "wires": [
- [
- "96c8005.f62928"
- ]
- ]
- },
- {
- "id": "70692f4.8670dd",
- "type": "xml",
- "z": "8f712d25.103e6",
- "name": "",
- "attr": "",
- "chr": "",
- "x": 2227.762233734131,
- "y": 198.8828535079956,
- "wires": [
- [
- "d44455da.1157b8"
- ]
- ]
- },
- {
- "id": "3999846f.57f98c",
- "type": "change",
- "z": "8f712d25.103e6",
- "name": "HTML Content-Type",
- "rules": [
- {
- "t": "set",
- "p": "headers",
- "pt": "msg",
- "to": "{}",
- "tot": "str"
- },
- {
- "t": "set",
- "p": "headers.content-type",
- "pt": "msg",
- "to": "text/html; charset=utf-8",
- "tot": "str"
- }
- ],
- "action": "",
- "property": "",
- "from": "",
- "to": "",
- "reg": false,
- "x": 3109.7664947509766,
- "y": 198.75004386901855,
- "wires": [
- [
- "fa7f6c66.48355"
- ]
- ]
- },
- {
- "id": "60c8a7de.fce128",
- "type": "template",
- "z": "8f712d25.103e6",
- "name": "Pubmed Template",
- "field": "payload.results",
- "fieldType": "msg",
- "format": "handlebars",
- "syntax": "mustache",
- "template": "<script>\n var results_html = \"\";\n \n var ids = \"{{{pub_ids}}}\".split(\",\");\n var titles = \"{{{pub_titles}}}\".split(\",\");\n var authors = \"{{{pub_authors}}}\".split(\",\");\n var dates = \"{{{pub_dates}}}\".split(\",\");\n \n var number_of_publications = titles.length;\n\n for (var i = 0; i < number_of_publications; i++) {\n results_html += \"<div class=\\\"result_box\\\">\";\n results_html += \"<h3 class=\\\"result_text\\\"><a href=/biosuitcase/ncbi_search/pubmed/\"+ids[i]+\">\"+titles[i]+\"</a></h3>\";\n results_html += \"<p class=\\\"result_text\\\">First Author: \"+authors[i]+\"</p>\";\n results_html += \"<p class=\\\"result_text\\\">Publication Date: \"+dates[i]+\"</p>\";\n results_html += \"</div>\";\n }\n \n $(\"#results\").html(results_html);\n</script>",
- "x": 2852.0078125,
- "y": 155.1328125,
- "wires": [
- [
- "3999846f.57f98c"
- ]
- ]
- },
- {
- "id": "d83da379.80172",
- "type": "template",
- "z": "8f712d25.103e6",
- "name": "Nucleotide Template",
- "field": "payload.results",
- "fieldType": "msg",
- "format": "handlebars",
- "syntax": "mustache",
- "template": "<script>\n var results_html = \"\";\n \n var ids = \"{{{gene_ids}}}\".split(\",\");\n var names = \"{{{gene_names}}}\".split(\",\");\n var bps = \"{{{gene_bps}}}\".split(\",\");\n \n var number_of_genes = ids.length;\n\n for (var i = 0; i < number_of_genes; i++) {\n results_html += \"<div class=\\\"result_box\\\">\";\n results_html += \"<h3 class=\\\"result_text\\\"><a href=/biosuitcase/ncbi_search/nucleotide/\"+ids[i]+\">\"+names[i]+\"</a></h3>\";\n results_html += \"<p class=\\\"result_text\\\">\"+bps[i]+\" base pairs</p>\";\n results_html += \"</div>\";\n }\n \n $(\"#results\").html(results_html);\n</script>",
- "x": 2862.765884399414,
- "y": 198.75000953674316,
- "wires": [
- [
- "3999846f.57f98c"
- ]
- ]
- },
- {
- "id": "6800a188.5f209",
- "type": "template",
- "z": "8f712d25.103e6",
- "name": "Structure Template",
- "field": "payload.results",
- "fieldType": "msg",
- "format": "handlebars",
- "syntax": "mustache",
- "template": "<script>\n var results_html = \"\";\n \n var ids = \"{{{struct_ids}}}\".split(\",\");\n var pdbs = \"{{{struct_pdbs}}}\".split(\",\");\n var descrs = \"{{{struct_descrs}}}\".split(\",\");\n var classes = \"{{{struct_classes}}}\".split(\",\");\n \n var number_of_structs = ids.length;\n\n for (var i = 0; i < number_of_structs; i++) {\n results_html += \"<div class=\\\"result_box\\\">\";\n results_html += \"<h3 class=\\\"result_text\\\"><a href=/biosuitcase/ncbi_search/structure/\"+ids[i]+\">\"+pdbs[i]+\"</a></h3>\";\n results_html += \"<p class=\\\"result_text\\\">\"+descrs[i]+\"</p>\";\n results_html += \"<p class=\\\"result_text\\\"><strong>Class: </strong>\"+classes[i]+\"</p>\";\n results_html += \"</div>\";\n }\n \n $(\"#results\").html(results_html);\n</script>\n\n<!-- \n\nmsg.struct_ids = [];\nmsg.struct_pdbs = [];\nmsg.struct_descrs = [];\nmsg.struct_classes = [];\n\n-->",
- "x": 2852.7657012939453,
- "y": 241.75001430511475,
- "wires": [
- [
- "3999846f.57f98c"
- ]
- ]
- },
- {
- "id": "cae1f491.7260e8",
- "type": "http request",
- "z": "8f712d25.103e6",
- "name": "NCBI E-Fetch",
- "method": "GET",
- "ret": "txt",
- "url": "",
- "tls": "",
- "x": 2953.451858520508,
- "y": 425.88893270492554,
- "wires": [
- [
- "e5083011.ebdd"
- ]
- ]
- },
- {
- "id": "242bbad.4cd3446",
- "type": "switch",
- "z": "8f712d25.103e6",
- "name": "switch db",
- "property": "db",
- "propertyType": "msg",
- "rules": [
- {
- "t": "eq",
- "v": "pubmed",
- "vt": "str"
- },
- {
- "t": "eq",
- "v": "nucleotide",
- "vt": "str"
- },
- {
- "t": "eq",
- "v": "structure",
- "vt": "str"
- }
- ],
- "checkall": "true",
- "outputs": 3,
- "x": 3258.201690673828,
- "y": 425.88893806934357,
- "wires": [
- [
- "d0f1c4c8.5c7788"
- ],
- [
- "7a2d035f.025d1c"
- ],
- [
- "73a99e62.b01e3"
- ]
- ]
- },
- {
- "id": "d0f1c4c8.5c7788",
- "type": "function",
- "z": "8f712d25.103e6",
- "name": "Parse Pubmed Results",
- "func": "var publication = msg.payload.PubmedArticleSet.PubmedArticle[0].MedlineCitation[0];\nvar pub_details = publication.Article[0];\n\nmsg.pmid = publication.PMID[0]._;\nmsg.pub_journal = pub_details.Journal[0].Title[0];\nmsg.pub_title = pub_details.ArticleTitle[0];\nmsg.abstract = pub_details.Abstract[0].AbstractText;\nmsg.authors = [];\n\nvar authors_list = pub_details.AuthorList[0].Author;\nvar author_name = \"\";\nfor(var i = 0; i < authors_list.length; i++){\n author_name = authors_list[i].ForeName + \" \" + authors_list[i].LastName;\n msg.authors.push(author_name);\n}\n\nreturn msg;",
- "outputs": 1,
- "noerr": 0,
- "x": 3483.201805114746,
- "y": 382.6389638185501,
- "wires": [
- [
- "92190818.6a2ba8"
- ]
- ]
- },
- {
- "id": "7a2d035f.025d1c",
- "type": "function",
- "z": "8f712d25.103e6",
- "name": "Parse Nucleotide Results",
- "func": "return msg;",
- "outputs": 1,
- "noerr": 0,
- "x": 3493.2018661499023,
- "y": 425.63891899585724,
- "wires": [
- [
- "2632512b.7a19de"
- ]
- ]
- },
- {
- "id": "73a99e62.b01e3",
- "type": "function",
- "z": "8f712d25.103e6",
- "name": "Parse Structure Results",
- "func": "return msg;",
- "outputs": 1,
- "noerr": 0,
- "x": 3492.201835632324,
- "y": 468.6389342546463,
- "wires": [
- [
- "47f8d556.fdecec"
- ]
- ]
- },
- {
- "id": "5f534156.1daee",
- "type": "function",
- "z": "8f712d25.103e6",
- "name": "NCBI E-Fetch URL",
- "func": "var efetch_url = \"https://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?\";\n\nmsg.url = efetch_url + \"db=\" + msg.req.params.db + \"&\" + \"id=\" + msg.req.params.id + \"&retmode=xml\";\n\nreturn msg;",
- "outputs": 1,
- "noerr": 0,
- "x": 2749.959671020508,
- "y": 426.0256247520447,
- "wires": [
- [
- "cae1f491.7260e8"
- ]
- ]
- },
- {
- "id": "e5083011.ebdd",
- "type": "xml",
- "z": "8f712d25.103e6",
- "name": "",
- "attr": "",
- "chr": "",
- "x": 3112.9635581970215,
- "y": 426.0216689109802,
- "wires": [
- [
- "242bbad.4cd3446"
- ]
- ]
- },
- {
- "id": "92190818.6a2ba8",
- "type": "template",
- "z": "8f712d25.103e6",
- "name": "Pubmed Template",
- "field": "payload.result_details",
- "fieldType": "msg",
- "format": "handlebars",
- "syntax": "mustache",
- "template": "<h1 class=\"pub_title\">{{{pub_title}}}</h1>\n<h2 class=\"pub_authors\">{{{authors}}}</h2>\n<p>Published on: {{{pub_journal}}}. PMID: {{{pmid}}}</p>\n<p class=\"abstract\">{{{abstract}}}</p>",
- "x": 3739.0006256103516,
- "y": 382.0000567436218,
- "wires": [
- [
- "d2670d1f.9e9a3"
- ]
- ]
- },
- {
- "id": "2632512b.7a19de",
- "type": "template",
- "z": "8f712d25.103e6",
- "name": "Nucleotide Template",
- "field": "payload.result_details",
- "fieldType": "msg",
- "format": "handlebars",
- "syntax": "mustache",
- "template": "{{{payload}}} ",
- "x": 3749.7586975097656,
- "y": 425.617253780365,
- "wires": [
- [
- "d2670d1f.9e9a3"
- ]
- ]
- },
- {
- "id": "47f8d556.fdecec",
- "type": "template",
- "z": "8f712d25.103e6",
- "name": "Structure Template",
- "field": "payload.result_details",
- "fieldType": "msg",
- "format": "handlebars",
- "syntax": "mustache",
- "template": "{{{payload}}} ",
- "x": 3739.758514404297,
- "y": 468.6172585487366,
- "wires": [
- [
- "d2670d1f.9e9a3"
- ]
- ]
- },
- {
- "id": "d2670d1f.9e9a3",
- "type": "change",
- "z": "8f712d25.103e6",
- "name": "HTML Content-Type",
- "rules": [
- {
- "t": "set",
- "p": "headers",
- "pt": "msg",
- "to": "{}",
- "tot": "str"
- },
- {
- "t": "set",
- "p": "headers.content-type",
- "pt": "msg",
- "to": "text/html; charset=utf-8",
- "tot": "str"
- }
- ],
- "action": "",
- "property": "",
- "from": "",
- "to": "",
- "reg": false,
- "x": 4063.0079956054688,
- "y": 426.52345085144043,
- "wires": [
- [
- "fa7f6c66.48355"
- ]
- ]
- },
- {
- "id": "4ccfdb83.1fc9a4",
- "type": "http in",
- "z": "8f712d25.103e6",
- "name": "",
- "url": "/biosuitcase/ncbi_search/:db/:id",
- "method": "get",
- "swaggerDoc": "",
- "x": 3077.500442504883,
- "y": 653.0000133514404,
- "wires": [
- [
- "5f534156.1daee"
- ]
- ]
- }
- ]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement