# Stop on error set -uex # Use the metadata from the previous chapter # Download the existing file. wget -nc http://data.biostarhandbook.com/books/corona/data/meta.txt.gz # Unzip the file. gunzip meta.txt.gz # Create a random subset of 10 sequences echo NC_045512 > ids cat meta.txt | shuf | head | csvcut -c 1 >> ids # Fetch the data cat ids | bio fetch > genomes.gb # Rename samples by isolate and date cat genomes.gb | bio fasta --rename '{country}|{date}|{id}' > genomes.fa # Align the sequences mafft --preservecase --auto genomes.fa > aligned.fa # Generate a tree iqtree2 -s aligned.fa --redo --prefix.genome