Created
February 14, 2019 09:25
-
-
Save eseiler/0a54435754cd2dd289a2295f7328771d to your computer and use it in GitHub Desktop.
Download NCBI from accession list
This file contains hidden or 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
| i=0 | |
| j=0 | |
| s="" | |
| while read line | |
| do | |
| s=$s","$line | |
| ((i++)) | |
| if [ $i -eq 200 ] | |
| then | |
| echo "Getting batch $j" | |
| curl -s "https://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?db=nuccore&rettype=fasta&retmode=text&id=$s" > ref_$j.fasta | |
| ((j++)) | |
| i=0 | |
| s="" | |
| sleep 1.5m | |
| fi | |
| done<accession.list | |
| curl -s "https://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?db=nuccore&rettype=fasta&retmode=text&id=$s" > ref_$j.fasta |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment