Created
December 31, 2015 06:55
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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