How do I install additional packages in the nextstrain conda environment?

Hi, I am trying to use mmseqs as part of my nextstrain pipeline. I make added a rule in the Snakefile that uses mmseqs directly but when running nextstrain build I get:

/Users/vlad/.nextstrain/runtimes/conda/env/bin/bash: line 2: mmseqs: command not found

So while I have it installed on my machine it is not installed in the conda environment that nextstrain uses. Is there a way to install it in nextstrain? I am not sure how to manage its conda enviroment properly. My hacky shortcut was creating a symbolic link to the binary in the ~/.nextstrain/runtimes/conda/env/bin but that is not portable.

Hi @vbadelita,

Nextstrain’s Conda runtime manages its own Conda environment under the hood which works for most, but not all, use cases of Nextstrain. If you want to run additional software in the same workflow, you should create your own Conda environment with Nextstrain packages + additional packages, activate it, and use it as the ambient runtime with nextstrain build --ambient.

– Victor

Thanks, I didn’t know about the ambient runtime. Will start using it from now on.

1 Like