Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: create independent environment files #111

Draft
wants to merge 26 commits into
base: dev
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
a538d30
build: set correct channel in `environment.root.yml`
deliaBlue Sep 19, 2023
e1906c8
docs: update installation steps
deliaBlue Sep 22, 2023
c3e867e
build: create dev environmwnt with singularity
deliaBlue Sep 22, 2023
d4ae82f
ci: update testest
deliaBlue Sep 22, 2023
3bd5f33
docs: move environemtn files
deliaBlue Sep 22, 2023
2bca799
ci: add environment display
deliaBlue Sep 22, 2023
70f1f0a
build: swap channels
deliaBlue Sep 22, 2023
9aca076
build: swap channels
deliaBlue Sep 22, 2023
a66e46c
build: pin versions
deliaBlue Sep 27, 2023
900d063
ci: fix environment files directory
deliaBlue Oct 3, 2023
5df8005
ci: split conda and singularity snakemake tests
deliaBlue Oct 3, 2023
0b257d3
build: update gffutils version
deliaBlue Oct 3, 2023
64e9143
build: disable channel
deliaBlue Oct 3, 2023
f64361d
build: disable 'defaults' channel
deliaBlue Oct 3, 2023
fb5576f
ci: update tests with mamba options
deliaBlue Oct 18, 2023
9791ed4
build remove nondefualts channel
deliaBlue Oct 18, 2023
66b9448
ci: specify installation channels
deliaBlue Oct 18, 2023
dd26a02
ci: include Mambaforge as an installer
deliaBlue Oct 19, 2023
abef37c
ci: fix static code analysis
deliaBlue Oct 20, 2023
4b46293
ci: fix static code analysis
deliaBlue Oct 20, 2023
bdc8758
refactor: fix variable types
deliaBlue Oct 25, 2023
e82a7c0
refactor: fix return type
deliaBlue Oct 25, 2023
a5a4380
build: upgrade and pin dependency versions
deliaBlue Oct 25, 2023
f5add74
merge with fix_static_code branch
deliaBlue Oct 25, 2023
2063c38
build: upgrade and pin dependecies versions
deliaBlue Oct 25, 2023
c178635
merge dev branch
deliaBlue Nov 16, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 42 additions & 17 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ jobs:
uses: conda-incubator/setup-miniconda@v2
with:
mamba-version: "*"
miniforge-variant: Mambaforge
channels: conda-forge,bioconda
channel-priority: true
activate-environment: mirflowz
environment-file: environment.yml
environment-file: install/environment.dev.yml
auto-activate-base: false

- name: Update mirflowz env with dev packages
run: mamba env update -n mirflowz -f environment.dev.yml

- name: display environment info
run: |
conda info -a
Expand Down Expand Up @@ -65,12 +65,9 @@ jobs:
with:
mamba-version: "*"
activate-environment: mirflowz
environment-file: environment.yml
environment-file: install/environment.dev.root.yml
auto-activate-base: false

- name: update mirflowz env with dev packages
run: mamba env update -n mirflowz -f environment.dev.yml

- name: display environment info
run: |
conda info -a
Expand All @@ -86,7 +83,7 @@ jobs:
run: bash test/test_rule_graph.sh


snakemake-integration-test:
snakemake-singularity-integration-test:
runs-on: ubuntu-latest
defaults:
run:
Expand All @@ -101,13 +98,13 @@ jobs:
uses: conda-incubator/setup-miniconda@v2
with:
mamba-version: "*"
miniforge-variant: Mambaforge
channels: conda-forge,bioconda
channel-priority: true
activate-environment: mirflowz
environment-file: environment.yml
environment-file: install/environment.root.yml
auto-activate-base: false

- name: update mirflowz env with root packages
run: mamba env update -n mirflowz -f environment.root.yml

- name: display environment info
run: |
conda info -a
Expand All @@ -116,6 +113,34 @@ jobs:
- name: run local test with Singularity
run: bash test/test_workflow_local_with_singularity.sh


snakemake-conda-integration-test:
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}

steps:

- name: check out repository
uses: actions/checkout@v4

- name: setup Conda/Mamba
uses: conda-incubator/setup-miniconda@v2
with:
mamba-version: "*"
miniforge-variant: Mambaforge
channels: conda-forge,bioconda
channel-priority: true
activate-environment: mirflowz
environment-file: install/environment.yml
auto-activate-base: false

- name: display environment info
run: |
conda info -a
conda list

- name: run local test with Conda
run: bash test/test_workflow_local_with_conda.sh

Expand All @@ -135,13 +160,13 @@ jobs:
uses: conda-incubator/setup-miniconda@v2
with:
mamba-version: "*"
miniforge-variant: Mambaforge
channels: conda-forge,bioconda
channel-priority: true
activate-environment: mirflowz
environment-file: environment.yml
environment-file: install/environment.dev.yml
auto-activate-base: false

- name: update mirflowz env with dev packages
run: mamba env update -n mirflowz -f environment.dev.yml

- name: display environment info
run: |
conda info -a
Expand Down
78 changes: 38 additions & 40 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ _MIRFLOWZ_ is a [Snakemake][snakemake] workflow for mapping miRNAs and isomiRs.
## Table of Contents

1. [Installation](#installation)
- [Requirements](#requirements)
- [Cloning the repository](#cloning-the-repository)
- [Dependencies](#dependencies)
- [Setting up the virtual environment](#setting-up-the-virtual-environment)
- [Testing your installation](#testing-your-installation)
2. [Usage](#usage)
Expand All @@ -23,17 +23,7 @@ _MIRFLOWZ_ is a [Snakemake][snakemake] workflow for mapping miRNAs and isomiRs.
The workflow lives inside this repository and will be available for you to run
after following the installation instructions laid out in this section.

### Cloning the repository

Traverse to the desired path on your file system, then clone the repository and
change into it with:

```bash
git clone https://github.com/zavolanlab/mirflowz.git
cd mirflowz
```

### Dependencies
### Requirements

For improved reproducibility and reusability of the workflow, as well as an
easy means to run it on a high performance computing (HPC) cluster managed,
Expand All @@ -43,50 +33,58 @@ environments). As a consequence, running this workflow has only a few individual
dependencies. These are managed by the package manager Conda, which
needs to be installed on your system before proceeding.

If you do not already have Conda installed globally on your system,
we recommend that you install [Miniconda][miniconda-installation]. For faster
creation of the environment (and Conda environments in general), you can also
install [Mamba][mamba] on top of Conda. In that case, replace `conda` with
`mamba` in the commands below (particularly in `conda env create`).
The installation requires the following:

### Setting up the virtual environment
- Linux (tested with Ubuntu `20.04` and `22.04`; macOS has not been tested yet)
- [Conda][conda] (tested with `conda 23.1.0`)
- [Mamba][mamba] (tested with `mamba 1.4.1`)

Create and activate the environment with necessary dependencies with Conda:
> Other versions, especially older ones, are not guaranteed to work.

```bash
conda env create -f environment.yml
conda activate mirflowz
```
### Cloning the repository

If you plan to run _MIRFLOWZ_ via Conda, we recommend using the following
command for a faster environment creation, specially if you will run it on an
HPC cluster.
Traverse to the desired path on your file system, then clone the repository and
change into it with:

```bash
conda config --set channel_priority strict
git clone https://github.com/zavolanlab/mirflowz.git
# or git clone [email protected]:zavolanlab/mirflowz
cd mirflowz
```

If you plan to run _MIRFLOWZ_ via Singularity and do not already
have it installed globally on your system, you must further update the Conda
environment using the `environment.root.yml` with the command below.
Mind that you must have the environment activated to update it.

### Setting up the virtual environment

You now need to create and activate the environment with necessary
dependencies. For that purpose, there exist four different environment files.
Use the decision matrix to pick the most suitable one for you:

| I have root privileges on the machine/ I want to run _MIRFLOWZ_ via Singularity | I want to run pre-packaged tests | Environment file to use              |
|:---:|:---:| --- |
| | | `install/environment.yml` |
| :check_mark: | | `install/environment.root.yml` |
| | :check_mark: | `install/environment.dev.yml` |
| :check_mark: | :check_mark: | `install/environment.dev.root.yml` |

To set up the environment, execute the call below, but do not forget to replace
the placeholder `ENVIRONMENT` with the appropriate file from the table above:

```bash
conda env update -f environment.root.yml
mamba env create -f ENVIRONMENT
```

> Note that you will need to have root permissions on your system to be able
> to install Singularity. If you want to run _MIRFLOWZ_ on an HPC cluster
> (recommended in almost all cases), ask your systems administrator about
> Singularity.

If you would like to contribute to _MIRFLOWZ_ development, you may find it
useful to further update your environment with the development dependencies:
Finally, activate the Conda environment with:

```bash
conda env update -f environment.dev.yml
mamba activate mirflowz
```
If you plan to run _MIRFLOWZ_ via Conda, we recommend using the following
command for a faster environment creation, specially if you will run it on an
HPC cluster.

```bash
conda config --set channel_priority strict
```
### Testing your installation

Several tests are provided to check the integrity of the installation. Follow
Expand Down
16 changes: 0 additions & 16 deletions environment.dev.yml

This file was deleted.

5 changes: 0 additions & 5 deletions environment.root.yml

This file was deleted.

19 changes: 19 additions & 0 deletions install/environment.dev.root.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: mirflowz
channels:
- conda-forge
- bioconda
dependencies:
- coverage==7.3
- flake8==6.1
- flake8-docstrings==1.7
- gffutils==0.12
- graphviz==7.1.0
- mypy==1.6
- pylint==3.0
- pysam==0.22
- pytest==7.4
- pytest-cov
- python==3.9.16
- singularity>=3.5.2
- snakefmt
- snakemake==7.24.0
17 changes: 17 additions & 0 deletions install/environment.dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: mirflowz
channels:
- conda-forge
- bioconda
dependencies:
- coverage==7.3
- flake8==6.1
- flake8-docstrings==1.7
- gffutils==0.12
- mypy==1.6
- pylint==3.0
- pysam==0.22
- pytest==7.4
- pytest-cov
- python==3.9.16
- snakefmt
- snakemake==7.24.0
9 changes: 9 additions & 0 deletions install/environment.root.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: mirflowz
channels:
- conda-forge
- bioconda
dependencies:
- graphviz==7.1.0
- python==3.9.16
- snakemake==7.24.0
- singularity>=3.5.2
6 changes: 3 additions & 3 deletions environment.yml → install/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ channels:
- conda-forge
- bioconda
dependencies:
- graphviz=7.1.0
- python=3.9.16
- snakemake=7.24.0
- graphviz==7.1.0
- python==3.9.16
- snakemake==7.24.0
2 changes: 1 addition & 1 deletion workflow/envs/samtools.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ channels:
- bioconda
dependencies:
- samtools=1.16.1
...
...
Loading