Skip to content

Instantly share code, notes, and snippets.

@dflock
Created December 31, 2015 06:55
Show Gist options
  • Save dflock/57132fb5fae86162398f to your computer and use it in GitHub Desktop.
Save dflock/57132fb5fae86162398f to your computer and use it in GitHub Desktop.
Returns the Definition from Nucleotide (http://www.ncbi.nlm.nih.gov/), given the accession number.
#!/bin/bash
if [ -z "$1" ]; then
echo "Returns the Definition from Nucleotide (http://www.ncbi.nlm.nih.gov/), given the accession number."
echo "Usage:"
echo " $0 <accession_number>"
echo "eg: $0 U49845"
echo "Returns the definition/name string"
echo "eg: Saccharomyces cerevisiae TCP1-beta gene, partial cds; and Axl2p (AXL2) and Rev7p (REV7) genes, complete cds"
exit
fi
ACCESSION=$1
echo `curl -s -m4 'www.ncbi.nlm.nih.gov/nuccore/'{$ACCESSION} | grep '<title>' | sed 's/<\/\?title>//g' | sed 's/^ *//g'`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment