Thanks, @whottel! I recreated the error you experienced by manually installing BioPython 1.65. I traced the issue back to a bug in BioPython’s alignment reader when it is run in Python 3.8. When I upgraded BioPython to TreeTime’s minimum version (1.66), I got the same error. When I upgraded to Augur’s minimum version (1.67), I did not get the error.
There are a couple different solutions to this problem that all involve upgrading BioPython.
To fix this problem, you can upgrade BioPython to the latest version Augur currently supports (1.76) with either Conda or pip like so:
# Upgrade with conda
conda install biopython==1.76
# Or upgrade with pip
python3 -m pip install biopython==1.76
Create a fresh Nextstrain environment from scratch
I’m a little worried though that your environment has the latest version of Augur and a version of BioPython from late 2014. If you wanted to make sure all of your software is installed with the latest versions, you can start from scratch with a fresh Conda environment like this:
# Remove the current Nextstrain environment.
conda activate base
conda env remove -n nextstrain
# Update Conda.
conda update conda
# Create a fresh Conda environment for Nextstrain.
conda create -n nextstrain -c conda-forge -c bioconda nextstrain
# Confirm your environment worked.
conda activate nextstrain
Let Snakemake manage your Conda environment automatically
Alternately, you can run the ncov workflow with Snakemake’s
--use-conda flag (
snakemake --use-conda [other arguments you normally provide]) and the workflow will automatically create a standalone Conda environment for you. Whenever that environment changes in our main repo and you pull down the changes, Snakemake will detect the change and update the environment for you.