@@ -16,6 +16,16 @@ root privileges.
16
16
If you don't already have conda installed and the Bioconda channel set up, see
17
17
the `Bioconda docs <https://bioconda.github.io >`_ for details.
18
18
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
+
19
29
**It is recommended that you create a separate environment directory for
20
30
each project **. That way you can update packages in each project
21
31
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.
32
42
Conda environments handle all of this. Each project has its own isolated set of
33
43
software that is independent of other projects.
34
44
45
+
35
46
However, given all of the software used across all of lcdb-wf, the environments
36
47
can take a lot of time to build. Conda has to solve the entire dependency tree
37
48
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
53
64
downstream work, like ``workflows/rnaseq/downstream/rnaseq.Rmd `` and
54
65
``workflows/chipseq/downstream/diffbind.Rmd ``.
55
66
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
+
56
77
Building the environments
57
78
-------------------------
58
79
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:
63
84
64
85
.. code-block :: bash
65
86
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