what is the problem with seqinr query function ?
Entering edit mode
7.0 years ago
Learner ▴ 260

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

naturepaper <- query('naturepaper', 'R=Nature/460/352')

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


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

Any comment ?

r software error • 2.9k views
Entering edit mode

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?

Entering edit mode
4.8 years ago
Mark ★ 1.2k

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

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


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/


Login before adding your answer.

Traffic: 2691 users visited in the last hour
Help About
Access RSS

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

Powered by the version 2.3.6