High-Performance Computing at the NIH
GitHub YouTube @nih_hpc RSS Feed
zUMIs on Biowulf

zUMIs is a fast and flexible pipeline to process RNA-seq data with UMIs.

References:

Documentation
Important Notes

Interactive job
Interactive jobs should be used for debugging, graphics, or applications that cannot be run as batch jobs.

Allocate an interactive session and run the program. Sample session:

[user@biowulf]$ sinteractive -c 8 --mem=20g
salloc.exe: Pending job allocation 46116226
salloc.exe: job 46116226 queued and waiting for resources
salloc.exe: job 46116226 has been allocated resources
salloc.exe: Granted job allocation 46116226
salloc.exe: Waiting for resource configuration
salloc.exe: Nodes cn3144 are ready for job

[user@cn3144 ~]$ module load zumis
[+] Loading zumis  0.0.6  on cn0166 
[+] Loading samtools 1.8  ... 
[+] Loading STAR  2.5.4a 
[+] Loading gcc  7.2.0  ... 
[+] Loading GSL 2.4 for GCC 7.2.0 ... 
[+] Loading openmpi 3.0.0  for GCC 7.2.0 
[+] Loading R 3.5.0_build2 

[user@cn3144 ~]$ mkdir -p /data/$USER/zumis && cd /data/$USER/zumis

[user@cn3144 ~]$ cp $ZUMIS_HOME/ExampleData/* .

[user@cn3144 ~]$ zUMIs-master.sh

  USAGE: /usr/local/apps/zumis/0.0.6/zUMIs-master.sh [options]
	-h  Print the usage info.

Make sure you have 3-4 times more disk space to your input fastq files.

## Required parameters ##

	-f   : Path to Barcode reads fastq file (preferably gzipped). Required.
				   In case of InDrops mode, path to first gel-barcode reads fastq file. Required.
	-r      : Path to cDNA reads fastq file (preferably gzipped). Required.
	-n            : Name of the study/sample in use. Required.
	-g            : Directory of STAR genome directory.  Required.
	-a       : Path to GTF file. Required.
	-c         : Base range for cell/sample barcode in -f Barcode read(e.g. 1-6).  Required.
				   For STRT-seq give this as 1-n where n is your first cell barcode(-f) length.
				   For InDrops give this as 1-n where n is the total length of cell barcode(e.g. 1-22).
	-m         : Base range for UMI barcode in -f Barcode read(e.g. 7-16).  Required.
				   For STRT-seq/InDrops give this as 1-n where n is your UMI length.
	-l           : Read length of -r cDNA reads (e.g. 50).  Required.
				   For STRT-seq give this as a total length of your umicdna read.

## Default parameters ##
	-z           : Cell barcodes with (-z)number of bases under the base quality(-q) is filtered out.  Default: 1.
	-u            : Molecular(UMI) barcodes with (-u)number of bases under the base quality(-q) is filtered out.  Default: 1.
	-q         : Minimum base quality required for cell barcode to be accepted.  Default: 20.
	-Q          : Minimum base quality required for molecular barcode to be accepted.  Default: 20.
	-p           : Number of processors to use. Default: 1
	-s  	 : Is the library stranded? 0 = unstranded, 1 = positively stranded, 2 = negatively stranded Default: 0
	-b             : Either number of cell/sample barcodes to output (e.g. 100) or
				   defined barcodes as a text file with a list of barcodes without headers (e.g. ATGCCAAT). Default: Adaptive cell barcode selection
				   We highly reccomend to provide expected number of barcodes for Drop-seq protocol.
	-N  	 : Keep the cell barcodes with atleast "-N " number of reads. Default: 100
				   Cells with less than "-N " number of total reads are removed. Only considered in automatic cell barcode selection.
	-d  	 : Number of reads to downsample to. This value can be a fixed number of reads (e.g. 10000) or a desired range (e.g. 10000-20000).
				   Barcodes with less than  will not be reported. 0 means adaptive downsampling. Default: 0.
	-x  	 : Additional STAR mapping parameters. Optional. e.g. "--outFilterMismatchNoverLmax 0.2 --quantMode TranscriptomeSAM".
					This pipeline works based on one hit per read. Therefore, please do not report more multimapping hits. Default: "".
	-H      : Hamming distance collapsing of UMI sequences. Default: 0.
	-B       : Hamming distance binning of close cell barcode sequences. Default: 0.
        -T        : Fastq file for plate barcode read. Default: NA
        -U        : Barcode range for plate barcode read (e.g. 1-8). Default: NA

## Program paths ##
	-o            : Where to write output bam. Default: working directory.
	-R  		 : Do you have "SLURM" workload manger? yes/no. Default: no.
	-S  		 : Do you want to produce summary stats? yes/no. Default: yes.
	-e  	 : path to STAR executable in your system. Default: STAR
	-t  : path to samtools executable in your system. Default: samtools
  	-P  	 : path to pigz executable in your system. Default: pigz
  	-V   : path to Rscript executable in your system. Default: Rscript
	-i     	 : Directory containing zUMIs scripts.  Default: path to this script.

## zUMIs from any stage ##
	-A  	 : yes/no. Start zUMIs from Mapping stage with your own FASTQ files if you don't want to use zUMIs filter.
					Only works with -w Mapping.
					Make sure to provide the Required parameters. Default: no.
	-X  	 : Mapped BAM file. Start zUMIs from Counting stage with your own BAM file if you don't want to use STAR.
					Only works with -w Counting.
					Make sure to provide the Required parameters. Default: NA.
	-w     	 : Start zUMIs from <-w TEXT> stage. Possible TEXT(Filtering, Mapping, Counting, Summarising). Default: Filtering.
					Make sure to give the same  (-o) and  (-n) if you start from the middle stage.
					zUMIs has a defined directory structure.

## STRT-seq mode ##
	-y  		 : Do you have STRT-seq data? yes/no Default: no.
	-F   : In case dual index is used, provide the second cell barcode index read <-F> here. Default: NA.
	-C   	 : Base range for cell/sample barcode in -F Barcode read(e.g. 1-5). Required if -F is given.  Default: 0-0.
	-j  		 : <-j INT> fixed number of bases(G) will be trimmed between UMI and cDNA read for STRT-seq. Default: 3.

## InDrops mode ##
	-Y  		 : Do you have InDrops data? yes/no Default: no.
	-F   : Provide the second half of gel barcode + UMI read <-F> here. Default: NA.
	-L   : Provide the library barcode read here. Default: NA

[user@cn3144 ~]$ zUMIs-master.sh -f barcoderead_HEK.1mio.fq.gz \
-r cDNAread_HEK.1mio.fq.gz -c 1-6 -m 7-16 -l 50 \
-g $ZUMIS_HOME/ExampleData/reference/hg38_chr22/ \
-a $ZUMIS_HOME/ExampleData/reference/GRCh38.84.chr22.gtf \
-n chr22test -p $SLURM_CPUS_PER_TASK -o /data/$USER/zumis
Your jobs will run on this machine. 

Make sure you have more than 1.9G RAM and 8 processors available. 

Your jobs will be started from filtering. 
[...]

[user@cn3144 ~]$ exit
salloc.exe: Relinquishing job allocation 46116226
[user@biowulf ~]$

Batch job
Most jobs should be run as batch jobs.

Create a batch input file (e.g. zumis.sh). For example:

#!/bin/bash

module load zumis
zUMIs-master.sh -f barcoderead_HEK.1mio.fq.gz -r cDNAread_HEK.1mio.fq.gz \
-c 1-6 -m 7-16 -l 50 -g $ZUMIS_HOME/ExampleData/reference/hg38_chr22/ \
-a $ZUMIS_HOME/ExampleData/reference/GRCh38.84.chr22.gtf \
-n chr22test -p $SLURM_CPUS_PER_TASK -o ./

Submit this job using the Slurm sbatch command.

sbatch --cpus-per-task=8 --mem=20g zumis.sh
Swarm of Jobs
A swarm of jobs is an easy way to submit a set of independent commands requiring identical resources.

Create a swarmfile (e.g. zumis.swarm). For example:

zUMIs-master.sh -f barcode1.fq.gz -r cDNAread_1.fq.gz [...] -n test1 -p $SLURM_CPUS_PER_TASK -o /data/$USER/zumis
zUMIs-master.sh -f barcode2.fq.gz -r cDNAread_2.fq.gz [...] -n test2 -p $SLURM_CPUS_PER_TASK -o /data/$USER/zumis
zUMIs-master.sh -f barcode3.fq.gz -r cDNAread_3.fq.gz [...] -n test3 -p $SLURM_CPUS_PER_TASK -o /data/$USER/zumis

Submit this job using the swarm command.

swarm -f zumis.swarm -g 20 -t 8 --module zumis
where
-g # Number of Gigabytes of memory required for each process (1 line in the swarm command file)
-t # Number of threads/CPUs required for each process (1 line in the swarm command file).
--module zumis Loads the zumis module for each subjob in the swarm