IMS-Bio2Core-Facility/polya_liftover

A Snakemake Workflow for using PolyA_DB and UCSC LiftOver with CellRanger

Overview

Topics: bioinformatics-pipeline snakemake cellranger liftover workflow single-cell-rna-seq reproducibility python shell transcriptomics fastqc multiqc

Latest release: v2.0.1, Last update: 2022-02-20

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/IMS-Bio2Core-Facility/polya_liftover . --tag v2.0.1

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

To run the workflow using a combination of conda and apptainer/singularity for software deployment, use

snakemake --cores all --sdm conda 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.

Configuration

The configuration keys that are expected are given below. Don't worry about typos, etc. These are all enforced with Snakemake's brilliant schema validation.

samples.yaml

The top level keys are the lanes from the sequencer. The second level keys are the samples from that lane. The third level keys are the paths to the R1 and R2 data.

lift.yaml

Top level keys are gene names. Each gene must have 3 values:

  1. chr - the chromosome
  2. start - the feature start coordinate
  3. end - the feature end coordinate

Coordinates should be exactly as given by PolyA_DB

config.yaml

samplesheet

Path to the samplesheet. This defaults to config/samples.yaml.

lift

Path to the "lift sheet" - the PolyA-DB outputs. This defaults to config/lift.yaml.

get_cellranger

  • url: str, required. Url to retrive the CellRanger binary.

get_gtf

  • url: str, required. Url to retrieve the reference GTF.

get_fa

  • url: str, required. Url to retrieve the reference primary assembly.

get_9_to_10

  • url: str, required. Url to retrieve the mm9 to mm10 over.chain for LiftOver

get_10_to_39

  • url: str, required. Url to retrieve the mm10 to mm39 over.chain for LiftOver

cellranger

  • introns: bool, required. Whether or not to include introns in the allignment. Essentially specifies if the data is single-nucleus or single cell.
  • n_cells: int, required. The number of cells to expect in the sample.
  • mem: int, required. The local memory, in Gb, available to CellRanger.

Linting and formatting

Linting results

None

Formatting results

None