How to get RID from blast rest api url using php
1
0
Entering edit mode
7.8 years ago

Iam working on blast api. I created program to get RID I don't know how to get that RID. Here another problem in NCBI blast common url documentation Format_type available for CMD=Put also but url not return the xml format. Here is the code.

https://blast.ncbi.nlm.nih.gov/Blast.cgi?CMD=Put&QUERY=SSWWAHVEMGPPDPILGVTEAYKRDTNSKK&PROGRAM=blastp&FILTER=L&DATABASE=nr&FORMAT_TYPE=XML";
$nblast = new BlastAPI();
$nblast->blastdata($url);
php blast ncbi • 3.1k views
ADD COMMENT
0
Entering edit mode
7.8 years ago

I don't know how to get that RID

you have to "grep" the RID in the BLAST output:

curl -sL "https://blast.ncbi.nlm.nih.gov/Blast.cgi?CMD=Put&QUERY=SSWWAHVEMGPPDPILGVTEAYKRDTNSKK&PROGRAM=blastp&FILTER=L&DATABASE=nr&FORMAT_TYPE=XML" | grep "RID = "
    RID = AGRY2BNM015

and reuse it to ping the blast server until you get the final XML.

ADD COMMENT
0
Entering edit mode

your solutions is worked in command line php environment but i need web environment solution. I used file_get_content method for retrive url content it gives output like this. http://prnt.sc/eac1cf

ADD REPLY
0
Entering edit mode

so , you are able to retrieve the RID. What's you're problem ?

ADD REPLY
0
Entering edit mode

I want to display rid. Here my problem is FORMAT_TYPE=XML not working it only showing default html. I have checked in this url: "https://ncbi.github.io/blast-cloud/dev/api.html" we can use format_type xml in cmd=put. I need xml out put.

ADD REPLY
0
Entering edit mode

I have the same issue, did you solve it? The response is always one long line of html. I want json which should be a valid FORMAT_TYPE yet I always get the same type of response back.

ADD REPLY
0
Entering edit mode

From what I can tell, NCBI ignores FORMAT_TYPE for the initial query to BLAST. it only respects it in the second stage of returning the results

ADD REPLY

Login before adding your answer.

Traffic: 1768 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6