Question: Retrieving Genbank Xml Through Efetchseq (Or Another Entrez Web Service?)
gravatar for edwardbeaty
7.0 years ago by
edwardbeaty0 wrote:

Hello! I have a question about using the Entrez Utility Web Service to retrieve records in genbank XML format.

I’m using C# to access the eFetchSeq service at like so:

 eFetchSeq.eUtilsServiceSoapClient serv = new eFetchSeq.eUtilsServiceSoapClient();
 eFetchSeq.eFetchRequest req = new eFetchSeq.eFetchRequest();
 req.db = "nuccore"; = "HV982480.1";
eFetchSeq.eFetchResult res = serv.run_eFetch(req);

…which is giving me the eFetchResult. However, I would like to dump the entire record and all its fields directly as an xml file in the genbank .gb format. Is there a way to do this from an eFetchResult? Or is there a different service I should use to retrieve my results in that format?

Thanks for your help.

entrez • 1.7k views
ADD COMMENTlink modified 7.0 years ago by Pierre Lindenbaum126k • written 7.0 years ago by edwardbeaty0

"as an xml file in the genbank .gb format" does not make sense. The output file is either XML or Genbank format.

ADD REPLYlink written 7.0 years ago by Neilfws48k
gravatar for Pierre Lindenbaum
7.0 years ago by
France/Nantes/Institut du Thorax - INSERM UMR1087
Pierre Lindenbaum126k wrote:

I don't see the retmode param in the XSD for efetch, so I'm not sure the following solution will run.

req.rettype = "gb";
req.retmode = "txt";

But you can always use REST based service instead of SOAP:

 curl -s ""

LOCUS       HV982480                  19 bp    DNA     linear   PAT 13-FEB-2013
VERSION     HV982480.1  GI:449784475
KEYWORDS    JP 2011201887-A/6577.
SOURCE      Hepatitis C virus
  ORGANISM  Hepatitis C virus
            Viruses; ssRNA positive-strand viruses, no DNA stage; Flaviviridae;
REFERENCE   1  (bases 1 to 19)
  AUTHORS   Harborth,J., Manoharan,M. and Elbashir,S.
  JOURNAL   Patent: JP 2011201887-A 6577 13-OCT-2011;
            Alnylam Pharmaceuticals Inc
COMMENT     OS   Human hepatitis C virus
            PN   JP 2011201887-A/6577
            PD   13-OCT-2011
            PF   21-APR-2011 JP 2011095517
            PR   10-OCT-2003 US    60/510318,09-OCT-2003 US    60/510246, PR
            26-SEP-2003 US    60/506341,11-AUG-2003 US    60/494597, PR
ADD COMMENTlink written 7.0 years ago by Pierre Lindenbaum126k

Thanks, I might try the REST service. I didn't see a "retmode" parameter either; also there wasn't an obvious way to pull the results from the eFetchResult object that gets returned.

ADD REPLYlink written 7.0 years ago by edwardbeaty0

You can always transform the XML to genbank using xslt but that would be excessive...

ADD REPLYlink written 7.0 years ago by Pierre Lindenbaum126k
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1660 users visited in the last hour