[Seqinr-forum] querying genbank to get the sequence for an accession

Jean lobry lobry at biomserv.univ-lyon1.fr
Mon Nov 9 17:22:40 CET 2009


>  Dear Colleagues,
>
>  I am just learning how to use SeqinR and it looks extremely
>  useful.
>
>  I am trying to figure out how I can use SeqinR to query the
>  genbank database to get the sequence corresponding to a
>  particular accession number, but am having a problem.
>
>  For example, the accession number corresponding to the
>  Bacteriophage lambda genome is NC_001416. I tried to get
>  this sequence by typing in R:
>
>  Ø  library("seqinr")
>
>  Ø  choosebank("genbank")
>
>
>  Ø  query("lambda","AC=NC_001416")
>
>  The first two commands work fine, however, I get this error
>  message from the query command: Error in query("lambda",
>  "AC=NC_000907") :  invalid request:"unknown accession number
>  at (^): \"AC
>
>  I am not sure what I am doing wrong, as other requests are
>  working fine for me, eg. the command
>
>  Ø  query("lambda","AC=CP001252")
>
>  works fine for me.
>
>  Does anyone know what I am doing wrong? I will be very
>  grateful for any advice you can give.
>
>  Regards, Avril
>
>  Avril Coghlan Department of Microbiology University College
>  Cork Ireland

Dear Avril,

the message just means that there is no sequence with the corresponding
accession number in the last opened database. In your case this is
because complete genome sequences are stored on different ACNUC databases
at pbil. What you want is:

#######
library(seqinr)
choosebank("refseqViruses")
query("lambda", "AC=NC_001416")
#######

Best,

Jean

P.S. I wonder if we shouldn't provide a function where.is.this.acc() that would
loop over all available databases to locate the databases where a given
accession number is present.
-- 
Jean R. Lobry            (lobry at biomserv.univ-lyon1.fr)
Laboratoire BBE-CNRS-UMR-5558, Univ. C. Bernard - LYON I,
43 Bd 11/11/1918, F-69622 VILLEURBANNE CEDEX, FRANCE
allo  : +33 472 43 27 56     fax    : +33 472 43 13 88
http://pbil.univ-lyon1.fr/members/lobry/




More information about the Seqinr-forum mailing list