BLAST-Protein-Fasta-Sequence-webservice

Executes a BLAST based on the incoming Protein Fasta sequence that is sent in a RAW post.

[{"id":"313d502b.bae7c","type":"http request","z":"4614d8fd.5974b8","name":"Get BLAST result","method":"GET","ret":"txt","url":"","x":1959.6363677978516,"y":138.7272777557373,"wires":[["c40cf566.4526f8"]]},{"id":"d1d7218d.0bca88","type":"function","z":"4614d8fd.5974b8","name":"Create BLAST params","func":"msg.headers = {\n    \"content-type\": \"application/x-www-form-urlencoded\"\n};\nmsg.payload = {\n\t\"email\": \"[email protected]\",\n\t\"title\": \"WAP_RAT BLAST\",\n\t\"program\": \"blastp\",\n\t\"matrix\": \"BLOSUM62\",\n\t\"alignments\": 1000,\n\t\"scores\": 1000,\n\t\"exp\": 1000,\n\t\"match_scores\": \"2,-7\",\n\t\"stype\": \"protein\",\n\t\"sequence\": msg.payload,\n\t\"database\": \"uniprotkb\"\n};\nreturn msg;","outputs":1,"noerr":0,"x":676,"y":164.4545440673828,"wires":[["7b58c2a0.998344"]]},{"id":"7b58c2a0.998344","type":"http request","z":"4614d8fd.5974b8","name":"BLAST Fasta sequence","method":"POST","ret":"txt","url":"http://www.ebi.ac.uk/Tools/services/rest/ncbiblast/run/","x":927.9090423583984,"y":163.6363763809204,"wires":[["bdb19921.67b668"]]},{"id":"ead3a1d2.cffe08","type":"http request","z":"4614d8fd.5974b8","name":"Verify Blast Status","method":"GET","ret":"txt","url":"","x":1359,"y":401.4545440673828,"wires":[["e770ca39.b74818"]]},{"id":"bdb19921.67b668","type":"function","z":"4614d8fd.5974b8","name":"prepare BLAST Status Check","func":"msg.url = \"http://www.ebi.ac.uk/Tools/services/rest/ncbiblast/status/\"+msg.payload;\nmsg.reqid = msg.payload;\nreturn msg;","outputs":1,"noerr":0,"x":1060.6364364624023,"y":280.09090423583984,"wires":[["ead3a1d2.cffe08"]]},{"id":"e770ca39.b74818","type":"switch","z":"4614d8fd.5974b8","name":"Check if FINISHED","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"FINISHED","vt":"str"},{"t":"eq","v":"RUNNING","vt":"str"},{"t":"eq","v":"ERROR","vt":"str"},{"t":"eq","v":"FAILURE","vt":"str"},{"t":"eq","v":"NOT_FOUND","vt":"str"}],"checkall":"true","outputs":5,"x":1350,"y":160.4545440673828,"wires":[["ed542b84.1dd96"],["c35890a9.0fd55"],["bb3b0309.55d2e8"],["bb3b0309.55d2e8"],["bb3b0309.55d2e8"]]},{"id":"c35890a9.0fd55","type":"delay","z":"4614d8fd.5974b8","name":"","pauseType":"delay","timeout":"30","timeoutUnits":"seconds","rate":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":1576,"y":195.4545440673828,"wires":[["ead3a1d2.cffe08"]]},{"id":"bb3b0309.55d2e8","type":"debug","z":"4614d8fd.5974b8","name":"","active":true,"console":"false","complete":"false","x":1546,"y":252.9545440673828,"wires":[]},{"id":"ed542b84.1dd96","type":"function","z":"4614d8fd.5974b8","name":"Prepare BLAST Results check","func":"msg.url = \"http://www.ebi.ac.uk/Tools/services/rest/ncbiblast/result/\"+msg.reqid+\"/out\";\nreturn msg;","outputs":1,"noerr":0,"x":1708,"y":140.4545440673828,"wires":[["313d502b.bae7c"]]},{"id":"c40cf566.4526f8","type":"debug","z":"4614d8fd.5974b8","name":"","active":true,"console":"false","complete":"false","x":2193.4544677734375,"y":138.3181667327881,"wires":[]},{"id":"9ae9d0f2.56f628","type":"http in","z":"4614d8fd.5974b8","name":"Receive Protein","url":"/blastProt","method":"post","swaggerDoc":"","x":85.45462036132812,"y":162.2727336883545,"wires":[["4532412c.830a4"]]},{"id":"4532412c.830a4","type":"function","z":"4614d8fd.5974b8","name":"Parse Fasta into sequence and data.","func":"fastasplit = msg.payload.replace(\"\\r\",\"\").split(\"\\n\");\nfastaid = fastasplit[0];\nfastasplit.shift();\nmsg.payload = fastasplit.join(\"\");\nreturn msg;","outputs":1,"noerr":0,"x":367.27281188964844,"y":163.6363468170166,"wires":[["d1d7218d.0bca88","5d6c5b3f.ffa244"]]},{"id":"6b49a4a6.a074e4","type":"http response","z":"4614d8fd.5974b8","name":"Return message to user","x":590.9091262817383,"y":287.7272243499756,"wires":[]},{"id":"5d6c5b3f.ffa244","type":"template","z":"4614d8fd.5974b8","name":"Add more info for user","field":"payload","fieldType":"msg","format":"json","syntax":"mustache","template":"{\n    \"data\": {{payload}}, \n    \"success\": true,\n    \"message\": \"Job Created\"\n}","x":297.27278900146484,"y":287.2727298736572,"wires":[["6b49a4a6.a074e4"]]}]

Flow Info

Created 8 years, 7 months ago
Rating: not yet rated

Owner

Actions

Rate:

Node Types

Core
  • debug (x2)
  • delay (x1)
  • function (x4)
  • http in (x1)
  • http request (x3)
  • http response (x1)
  • switch (x1)
  • template (x1)

Tags

  • BLAST
  • bio-informatics
  • Fasta
  • Protein
Copy this flow JSON to your clipboard and then import into Node-RED using the Import From > Clipboard (Ctrl-I) menu option