Home

Awesome

Nextflow Implementation of the Dowell Lab Steady State (RNA-seq) Pipeline

Usage

Download and Installation

Clone this repository in your home directory:

$ git clone git@github.com:Dowell-Lab/RNAseq-Flow.git

Install Nextflow:

$ curl -s https://get.nextflow.io | bash

Slurm-Specific Usage Requirements

Primary Run Settings

If you are using Linux, this will install nextflow to your home directory. As such, to run Nextflow, you will need add your user home directory to your PATH. Use the following command to set your home directory to your PATH as a variable so you can still access other paths on your cluster without conflict:

$export PATH=~:$PATH

Secondly, edit the appropriate config file, e.g. conf/slurm_grch38.config, to ensure the proper paths are set for genome reference files and other executables (look for all mentions of COMPLETE_*). Variable names should hopefully be self-explanatory. An example run with the required arguments is as follows:

    $ nextflow run main.nf -profile slurm_grch38 --workdir '</nextflow/work/temp/>'  --outdir '</my/project/>' --email <john.doe@themailplace.com> --sras '</dir/to/sras/*>'
    

Directory paths for sras/fastqs must be enclosed in quotes. Notice the name of the configuration file. It's generally a good idea to keep separate configuration files for samples using different reference genomes, and different organisms. The pipeline runs paired-end by default. The --singleEnd flag must be added for all single-end data. While most nascent data is single-end, Groovy configurations make paired-end processing an easier default.

If anything went wrong, you don't need to restart the pipeline from scratch. Instead...

$ nextflow run main.nf -profile slurm_grch38 -resume

To see a full list of options and pipeline version, enter:

$ nextflow run main.nf -profile slurm_grch38 --help
Python Package Requirements

IMPORTANT: For individual users, we highly recommend installing all python packages in a virtual environment

This pipeline requires a number of optional python packages for qc and analysis. To install RSeQC and MultiQC, you can run the following:

$ pip3 install MultiQC --user
$ pip3 install RSeQC --user

Note that all packages are Python3.

Running Nextflow Using an sbatch script

The best way to run Nextflow is using an sbatch script using the same command specified above. It's advisable to execute the workflow at least in a screen session, so you can log out of your cluster and check the progress and any errors in standard output more easily. Nextflow does a great job at keeping logs of every transaction, anyway, should you lose access to the console. The memory requirements do not exceed 8GB, so you do not need to request more RAM than this. SRAs must be downloaded prior to running the pipeline.

Arguments

Required Arguments

ArugmentUsageDescription
-profile<base,slurm>Configuration profile to use.
--fastqs</project/*_{R1,R2}*.fastq.gz>Directory pattern for fastq files (gzipped).
--sras</project/*.sra>Directory pattern for sra files.
--workdir</project/tmp/>Nextflow working directory where all intermediate files are saved.
--email<EMAIL>Where to send workflow report email.

Save Options

ArgumentsUsageDescription
--outdir</project/>Specifies where to save the output from the nextflow run.
--savefqCompresses and saves raw fastq reads.
--saveTrimCompresses and saves trimmed fastq reads.
--saveAllCompresses and saves all fastq reads.
--skipBAMSkips saving BAM files (only save CRAM). Default=False

Input File Options

ArgumentsUsageDescription
--singleEndSpecifies that the input files are not paired reads (default is paired-end).
--flipReverse complements each strand. Necessary for some library preps.
--flipR2Reverse complements R2 only (will not work in singleEnd mode).

Strandness Options

ArgumentsUsageDescription
--unStrandedInput data will be procssed in HISAT2 as unstranded (default).
--forwardStrandedIndicates data is forward first-stranded.
--reverseStrandedIndicates data is reverse first-stranded.

Performance Options

ArgumentsUsageDescription
--threadfqdumpRuns multi-threading for fastq-dump for sra processing.

QC Options

ArgumentsUsageDescription
--skipMultiQCSkip running MultiQC.
--skipRSeQCSkip running RSeQC.

Analysis Options

ArgumentsUsageDescription
--countCount reads (FPKM normalized) over RefSeq gene file. Should not be used as stand-alone analysis! Only to be used as a quick first pass.

Credits