I'm posting the following in the hope that someone
will find it useful. The new NCBI server is quite powerful,
but often too much so. Many routine queries yield far more
entries than desired, due to the failure to remember to
properly restrict the search. I have come up with the following
two shell scripts to reduce this problem in my daily work.
To use them, make the listed addition to your .mailrc file and
then follow the instructions in the header of each script.
Execute a "chmod +x" command on each script, put
them on your $path, and you will be ready to go. If you often
retrieve GenBank entries by accession number, just adapt fetch2 --
change [LOC] to [ACC].
Keith Robison
Harvard University
Department of Cellular & Developmental Biology
Department of Genetics / HHMI
robison at ribo.harvard.edu
# First, add the following line to your .mailrc file
alias ncbifetch retrieve at ncbi.nlm.nih.gov
#fetch -- general retrieval script
# first argument is database name
#Usage: fetch database locus1 locus2...
set $*
rm -f gpf
touch gpf
echo "DATALIB " $1 >>gpf
echo "BEGIN" >>gpf
while [ $# -gt 0 ]
do
echo '"' $1 '" [LOC]' >>gpf
shift
done
mail ncbifetch <gpf
rm gpf
#fetch2 -- retriever for specific database
# create one version for each database (i.e. gpfetch, swfetch)
# replace !!!! with correct database name
#Usage: gpfetch locus1 locus2...
set $*
rm -f gpf
touch gpf
echo "DATALIB !!!!" >>gpf
echo "BEGIN" >>gpf
while [ $# -gt 0 ]
do
echo '"' $1 '" [LOC]' >>gpf
shift
done
mail ncbifetch <gpf
rm gpf