This is a test version of Biostars. For the public version, visit https://www.biostars.org.
what is the problem with seqinr query function ?

I am trying to use seqnir to retrieve a sequence. Based on a tutorial , I should first open the data based then query and then close the data base

choosebank("genbank") 
naturepaper <- query('naturepaper', 'R=Nature/460/352')
closebank()

But i get this error ,

Error in query("naturepaper", "R=Nature/460/352") : 
  invalid request:"unknown reference at (^): \"R

I tried to understand the problem but I could not find it, ?query is this , so I am using the correct syntax as input

R=refcode

seqs from reference specified such as in jcode/volume/page (e.g., JMB/13/5432)

Any comment ?

r software error

It seems like I'm doing the same tutorial ... Little Book of R for Bioinformatics? Yea, I'm getting the same error.

Did you end up figuring this out?

1 answer

This is actually an error from the server. Try this:

naturepaper <- query('naturepaper', 'r=JMB/13/5432', verbose = TRUE)

Output:

I'm checking the arguments...
... and everything is OK up to now.
I'm checking the status of the socket connection...
... and everything is OK up to now.
I'm sending query to server...
... answer from server is: code=7&message="unknown reference at (^): \"r=(^)JMB/13/5432\"" 
I'm trying to analyse answer from server...
... and I was able to detect an error.
Error in query("naturepaper", "r=JMB/13/5432", verbose = TRUE) : 
  invalid request:"unknown reference at (^): \"r
In addition: Warning message:
In while (codeCount + newLen > length(codeBuf)) { :
closing unused connection 3 (->pbil.univ-lyon1.fr:5558)

Digging a bit deeper, it looks like Sequin database is being phased out, and the SeqinR package was originally designed to be a CLI for Sequin.

My guess is that NCBI has updated it's API but seqinr has not followed, causing the error. I would suggest using a different package (and a different tutorial). I like the rentrez package.

Good tutorial here: https://cran.r-project.org/web/packages/rentrez/vignettes/rentrez_tutorial.html

Another one that's highly utitlised is Biomart: https://www.ncbi.nlm.nih.gov/pmc/articles/PMC5408848/

Log in to answer this question.