Skip to content

Instantly share code, notes, and snippets.

@AlexSartori
Last active April 7, 2026 10:01
Show Gist options
  • Select an option

  • Save AlexSartori/ca9540d8d6503ca9fdf6aa8e34830262 to your computer and use it in GitHub Desktop.

Select an option

Save AlexSartori/ca9540d8d6503ca9fdf6aa8e34830262 to your computer and use it in GitHub Desktop.
Alternative accession data download script for Krona for when NCBI FTP breaks
#!/bin/bash
# Alternative download script for Krona (https://github.com/marbl/Krona) for when (always) NCBI FTP breaks.
# Built for krona 2.8.1
pushd [...]/opt/krona/taxonomy/accession2taxid
FILES="dead_nucl.accession2taxid dead_prot.accession2taxid dead_wgs.accession2taxid nucl_gb.accession2taxid nucl_wgs.accession2taxid prot.accession2taxid"
for f in $FILES; do
wget -c https://ftp.ncbi.nih.gov/pub/taxonomy/accession2taxid/$f.gz
wget -c https://ftp.ncbi.nih.gov/pub/taxonomy/accession2taxid/$f.gz.md5
s1=$(cat $f.gz.md5 | cut -f1)
s2=$(md5sum $f.gz | cut -f1)
echo $f $s1 $s2 >> md5
done;
[...]/opt/krona/updateAccessions.sh --only-build --preserve
popd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment