Skip to content

Commit c7f5570

Browse files
committed
update conda docs
1 parent 828a11f commit c7f5570

File tree

1 file changed

+26
-2
lines changed

1 file changed

+26
-2
lines changed

docs/conda.rst

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,16 @@ root privileges.
1616
If you don't already have conda installed and the Bioconda channel set up, see
1717
the `Bioconda docs <https://bioconda.github.io>`_ for details.
1818

19+
If you don't already have `mamba <https://github.com/mamba-org/mamba>`_, you
20+
can install it into your base conda environment with:
21+
22+
.. code-block:: bash
23+
24+
conda install -c conda-forge mamba
25+
26+
Mamba is a drop-in replacement for conda that is faster and more robust. In
27+
fact, it is now the default conda front-end for Snakemake.
28+
1929
**It is recommended that you create a separate environment directory for
2030
each project**. That way you can update packages in each project
2131
independently of any others, and yet the environment will always be close at
@@ -32,6 +42,7 @@ need older versions, but you may want newer versions for more recent projects.
3242
Conda environments handle all of this. Each project has its own isolated set of
3343
software that is independent of other projects.
3444

45+
3546
However, given all of the software used across all of lcdb-wf, the environments
3647
can take a lot of time to build. Conda has to solve the entire dependency tree
3748
and come up with a solution that works to satisfy the entire set of specified
@@ -53,6 +64,16 @@ The **main** environment's requirements are stored in
5364
downstream work, like ``workflows/rnaseq/downstream/rnaseq.Rmd`` and
5465
``workflows/chipseq/downstream/diffbind.Rmd``.
5566

67+
Note that one model for using conda envs with Snakemake workflows is to only have
68+
Snakemake in the top-level env, and any other dependencies are handled by
69+
smaller environments created for each rule using the ``conda:`` directive.
70+
Another model is to have everything installed into one large environment. We
71+
currently prefer the latter, because it allows us to activate a single
72+
environment to give us access to all the tools used. This streamlines
73+
troubleshooting because we don't have to dig through the ``.snakemake/conda``
74+
directory to figure out which hash corresponds to which file, but comes with
75+
the up-front cost of creating the environment initially.
76+
5677
Building the environments
5778
-------------------------
5879
If you use the ``--build-envs`` argument when deploying lcdb-wf to a project
@@ -63,5 +84,8 @@ Otherwise, do the following in the top-level directory of the deployment:
6384

6485
.. code-block:: bash
6586
66-
conda create -p ./env --file requirements-non-r.txt
67-
conda create -p ./env-r --file requirements-r.txt
87+
# if you don't already have mamba:
88+
conda install mamba -c conda-forge
89+
90+
mamba create -p ./env --file requirements-non-r.txt
91+
mamba create -p ./env-r --file requirements-r.txt

0 commit comments

Comments
 (0)