End-to-end bulk RNA sequencing analysis from paired-end FASTQ files to differential gene expression and enrichment analyses, consisting of the following steps:
- Quality control
- FastQC metrics of all read files
- fastp trimming and quality control of read files
- MultiQC report of FastQC and fastp metrics
- Reference file preparation
- Download of a FASTA genome from Ensembl
- Download of a FASTA transcriptome from Ensembl
- Download of a .gtf annotation file from Ensembl
- Construction of a gene id to transcript id and gene name mapping table from the annotation file
- Salmon index building for alignment-free quantification
- Decoy preparation based on the genome and construction of a gentrome
- Index building based on the gentrome with salmon
- Salmon quantification-free alignment with bootstraps
- Gene-level summarization with pytximport
- Differential gene expression analysis with PyDESeq2
- Gene set enrichment analysis with decoupler-py
This workflow is based on the Snakemake cookiecutter template, the kallisto-sleuth example workflow from Johannes Köster and many available Snakemake wrappers maintained by different authors.
- Malte Kuehl (@maltekuehl)
If you use this workflow in a paper, don't forget to give credits to the authors by citing the URL of this repository and, if available, its DOI.
- Create a new github repository using this workflow as a template.
- Clone the newly created repository to your local system, into the place where you want to perform the data analysis.
Configure the workflow according to your needs via editing the files in the config/
folder. Adjust config.yaml
to configure the workflow execution, and samples.tsv
to specify your sample setup.
Install Snakemake using conda:
conda create -c bioconda -c conda-forge -n snakemake snakemake
For installation details, see the instructions in the Snakemake documentation.
Activate the conda environment:
conda activate snakemake
Test your configuration by performing a dry-run via
snakemake --use-conda -n
Execute the workflow locally via
snakemake --use-conda --cores $N
using $N
cores or run it in a cluster environment via
snakemake --use-conda --cluster qsub --jobs 100
or
snakemake --use-conda --drmaa --jobs 100
in combination with any of the modes above. See the Snakemake documentation for further details.
After successful execution, you can create a self-contained interactive HTML report with all results via:
snakemake --report report.html
This report can, e.g., be forwarded to your collaborators.
Whenever you change something, don't forget to commit the changes back to your github copy of the repository:
git commit -a
git push
Whenever you want to synchronize your workflow copy with new developments from upstream, do the following.
- Once, register the upstream repository in your local copy:
git remote add -f upstream git@github.com:complextissue/snakemake-bulk-rna-sequencing-workflow.git
orgit remote add -f upstream https://github.com/complextissue/snakemake-bulk-rna-sequencing-workflow.git
if you do not have setup ssh keys. - Update the upstream version:
git fetch upstream
. - Create a diff with the current version:
git diff HEAD upstream/master workflow > upstream-changes.diff
. - Investigate the changes:
vim upstream-changes.diff
. - Apply the modified diff via:
git apply upstream-changes.diff
. - Carefully check whether you need to update the config files:
git diff HEAD upstream/master config
. If so, do it manually, and only where necessary, since you would otherwise likely overwrite your settings and samples.
In case you have also changed or added steps, please consider contributing them back to the original repository:
- Fork the original repo to a personal or lab account.
- Clone the fork to your local system, to a different place than where you ran your analysis.
- Copy the modified files from your analysis to the clone of your fork, e.g.,
cp -r workflow path/to/fork
. Make sure to not accidentally copy config file contents or sample sheets. Instead, manually update the example config files if necessary. - Commit and push your changes to your fork.
- Create a pull request against the original repository.