#!/bin/csh -f #(ie run the cshell on this but don't read the .cshrc) echo version = 1.09 of wgetac 2011 Jun 02 # 2011 Jun 02, 1.09: update link to source of wget # 2007 Nov 05, 1.08: use rettype=gbwithparts # 1.07, 2003 July 17: upgrade successful! cleanup # 1.06, 2003 July 17: upgrade to new pubmed tools # 1.05, 2003 July 16: upgrade to new pubmed tools (broken) # 1.02, 2001: &tool=yourname # origin 1999May03.16:03:54 if ($#argv != 1) then echo 'usage: wgetac [accession number]' echo 'This program uses wget to grab a GenBank sequence file.' echo 'Wget grabs web pages or files. It is available from:' echo "http://www.gnu.org/software/wget/" cat << EOF This program depends on web tools at the National Libarary of Medicine which give entries from GenBank. From time to time they change and break this script. 2003 July 17 Reference for the method: http://eutils.ncbi.nlm.nih.gov/entrez/query/static/eutils_help.html Notification that the extraction method changed: http://www.nlm.nih.gov/pubs/techbull/ma03/ma03_technote.html#eutil PubMedŽ to Complete Transition to E-Utilities and Manually Constructed URLs April 03, 2003 [posted] In July 2002, NCBI announced the availability of new programming for the Entrez Utilities (E-Utilities) and informed utility users that they should convert URLs to the new format by the end of 2002. NCBI will phase out the old utilities completely in June 2003. This may affect customers of some products such as EndNoteŽ, ProCiteŽ, and Reference ManagerŽ. Please contact user support for your respective product if you have questions. Questions concerning the use of E-Utilities can be sent to: eutilities@ncbi.nlm.nih.gov. If you have manually created links to PubMed that contain the string: /htbin-post/, these should be changed to follow the specifications provided on the page, Linking to PubMed and other Entrez Databases. These changes must be in place prior to June 2003. Entrez Utilities (E-Utilities) http://www.ncbi.nlm.nih.gov/entrez/query/static/eutils_help.html Linking to PubMed and other Entrez Databases. http://www.ncbi.nlm.nih.gov/entrez/query/static/linking.html Retrieve Use Retrieve to search using unique identifiers (UIDs). UIDs include the PubMed identifier (PMID), MEDLINE identifier (UI), and the molecular biology database identifier (GI). Accession numbers are not UIDs and cannot be retrieved via cmd=Retrieve. Use cmd=Search to search by accession number. ---- Change on 2007 Nov 05: By using rettype=gbwithparts, the sequence is always given. Reference: http://eutils.ncbi.nlm.nih.gov/entrez/query/static/efetchseq_help.html#rettypeparam EOF exit # end of documentation endif echo using wget to obtain GenBank entry $1 set uid = $1 set query1 = $uid # set request = "http://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?db=nucleotide&id=$uid&rettype=gb" set request = "http://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?db=nucleotide&id=$uid&rettype=gbwithparts" wget -O $query1 "$request" # for testing: #head $query1 #tail $query1