Conda
I feel like I’m always explaining to someone the magic incantations performed to get a Conda environment to work. That person is usually myself.
Installation
Miniforge
Easiest way I’ve found to consistently install conda:
That’s for “Unix-like platforms (Mac OS & Linux)“.
If you’re using windows and not using WSL2, first what are you doing with your life? Second, follow the official docs.
Setting up Bioconda
Official Docs. Follow them.
Opinions
Mamba
It’s a drop-in replacement for Conda.
Creating environments
Use an environment.yml
file.
Bioconda Docs on environment files
mamba create
in the project directory should create environment for you.
environment.yml
Tutorial
So now that we’ve gotten familiar with some tools it’s time to get some
computations running! But we don’t have admin access to the system we’re on so how do we install software? Enter conda
Create an env file
Let’s create an environment file to share with our collaborators, so they can rebuild our conda environment from scratch.1
Open up env.yaml
and poke around.
Commit the env.yaml
file.
Update the README
Our collaborators need to know how to build the enviroment from scratch. In the README update the “Getting Started” commands to
Commit the changes to the README.
Add a new make rule to build the conda environment
We can refactor our project to make the initial setup even cleaner, and future proof it if we wanted to change the way we install the conda env.
Let’s add a new make rule
And update the “Getting Started” commands.
Commit the changes to those as well.