zavolanlab/mirflowz

Snakemake workflow for the mapping and quantification of miRNAs and isomiRs from miRNA-Seq libraries.

Overview

Topics: bioinformatics isomirs mirna snakemake workflow

Latest release: None, Last update: 2024-08-19

Linting: linting: passed, Formatting:formatting: passed

Deployment

Step 1: Install Snakemake and Snakedeploy

Snakemake and Snakedeploy are best installed via the Mamba package manager (a drop-in replacement for conda). If you have neither Conda nor Mamba, it is recommended to install Miniforge. More details regarding Mamba can be found here.

When using Mamba, run

mamba create -c conda-forge -c bioconda --name snakemake snakemake snakedeploy

to install both Snakemake and Snakedeploy in an isolated environment. For all following commands ensure that this environment is activated via

conda activate snakemake

Step 2: Deploy workflow

With Snakemake and Snakedeploy installed, the workflow can be deployed as follows. First, create an appropriate project working directory on your system and enter it:

mkdir -p path/to/project-workdir
cd path/to/project-workdir

In all following steps, we will assume that you are inside of that directory. Then run

snakedeploy deploy-workflow https://github.com/zavolanlab/mirflowz . --tag None

Snakedeploy will create two folders, workflow and config. The former contains the deployment of the chosen workflow as a Snakemake module, the latter contains configuration files which will be modified in the next step in order to configure the workflow to your needs.

Step 3: Configure workflow

To configure the workflow, adapt config/config.yml to your needs following the instructions below.

Step 4: Run workflow

The deployment method is controlled using the --software-deployment-method (short --sdm) argument.

To run the workflow with automatic deployment of all required software via conda/mamba, use

snakemake --cores all --sdm conda

To run the workflow using apptainer/singularity, use

snakemake --cores all --sdm apptainer

Snakemake will automatically detect the main Snakefile in the workflow subfolder and execute the workflow module that has been defined by the deployment in step 2.

For further options such as cluster and cloud execution, see the docs.

Step 5: Generate report

After finalizing your data analysis, you can automatically generate an interactive visual HTML report for inspection of results together with parameters and code inside of the browser using

snakemake --report report.zip

Configuration

The following section is imported from the workflow’s config/README.md.

Dependencies installation

Create and activate the virtual environment with the required dependencies with Conda:

conda env create -f environment.yml
conda 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.

conda config --set channel_priority strict

For a faster creation of the environment (and Conda environments in general), you can also install Mamba on top of Conda. In that case, replace conda with mamba in the commands above (particularly in conda env create).

Running MIRFLOWZ with Singularity

If you want to run MIRFLOWZ via Singularity and do not already have it installed globally on your system, you must further update the Conda environment with:

conda env update -f environment.root.yml

Mind that you must have the environment activated and root permissions on your system to install Singularity. If you want to run MIRFLOWZ on an HPC cluster (recommended in almost all cases), ask your system administrator about Singularity.

Run the workflow on your own samples

In order to run MIRFLOWZ on your own samples, we recommend having all the input files inside a dedicated directory. This way, it is easier to keep the data together and reproduce an analysis. Assuming that your current directory is the repository's root directory, create a directory to store all your data and traverse to it with:

mkdir path/to/your_run
cd path/to/your_run

1. Prepare the sample table

Create an empty sample table. Refer to the sample.tsv test file to see what the table must look like or use it as a template.

touch samples.tsv

Fill the sample table according to the following requirements:

  • sample. Arbitrary name for the miRNA sequencing library.
  • sample_file. Path to the miRNA sequencing library file. The path must be relative to the directory where the workflow will be run.
  • adapter. Sequence of the 3'-end adapter used during library preparation.
  • format. One of fa/fasta or fq/fastq, if the library file is in FASTA or FASTQ format, respectively.

2. Prepare the genome resources

There are 4 files you must provide:

  1. A gzipped FASTA file containing reference sequences, typically the genome of the source/organism from which the library was extracted.

  2. A gzipped GTF file with matching gene annotations for the reference sequences above.

MIRFLOWZ expects both the reference sequence and gene annotation files to follow Ensembl style/formatting. If you obtained these files from a source other than Ensembl, you must ensure that they adhere to the expected format by converting them, if necessary.

  1. An uncompressed GFF3 file with microRNA annotations for the reference sequences above.

MIRFLOWZ expects the miRNA annotations to follow miRBase style/formatting. If you obtained this file from a source other than miRBase, you must ensure that it adheres to the expected format by converting it, if necessary.

  1. An uncompressed tab-separated file with a mapping between the reference names used in the miRNA annotation file (column 1; "UCSC style") and in the gene annotations and reference sequence files (column 2; "Ensembl style"). Values in column 1 are expected to be unique, no header is expected, and any additional columns will be ignored. This resource provides such files for various organisms, and in the expected format.

  2. OPTIONAL: A BED6 file with regions for which to produce ASCII-style alignment pileups. If not provided, no pileups will be generated. See here for the expected format.

General note: If you want to process the genome resources before use (e.g., filtering), you can do that, but make sure the formats of any modified resource files meet the formatting expectations outlined above!

3. Prepare the configuration file

We recommend creating a copy of the configuration file template.

cp ../config/config_template.yaml config.yaml

Open the new copy in your editor of choice and adjust the configuration parameters to your liking. The template explains what each of the parameters mean and how you can meaningfully adjust them.

Linting and formatting

Linting results

None

Formatting results

None