Franco / [rMATS]
Script LINK
This a script used to run a rMATS analysis. rMATS is used detect differential alternative splicing events from RNA-Seq data.
For a tutorial see link.
UCI uses the SLURM scheduler so you must use slurm headers to specify how and where you want the job to run. You must also name the script SCRIPT_NAME.sub and then run the script using "Sbatch SCRIPT_NAME.sub", while you are in the working directory of the script location.
For a more in depth view on a SLURM job script headers see https://rcic.uci.edu/slurm/examples.html.
Make note that this script uses the free partition but you can use your free 1000 core hours of the lab's core hours by changing the header. Otherwise your job can be killed in the free partition.
#!/bin/bash
#SBATCH --job-name=rMATS ## Name of the job.
#SBATCH -p free ## partition/queue name
#SBATCH --nodes=8 ##(-N) number of nodes to use
#SBATCH --mem=100G ## request 100GB of memory
#SBATCH -e /dfs3b/hertel-lab/fcarranz/project_name/rMATS_analysis/rmats.err ##Error_log
#SBATCH -o /dfs3b/hertel-lab/fcarranz/project_name/rMATS_analysis/rmats.out ##outputfile_log
#SBATCH --mail-user fcarranz@uci.edu
#SBATCH --mail-type=ALLmodule load rMATS/4.1.2
module load python/Perferable use the same gtf file you used in your alignment
GTF=data/homezvol2/fcarranz/GTF/v45/gencode.v45.primary_assembly.basic.annotation.gtfBAM_DIR=/dfs3b/hertel-lab/fcarranz/project_name/bam_filesOUTDIR=/dfs3b/hertel-lab/fcarranz/project_name/rMATS_analysisBam file used in these examples.
Note this example is a comparison between two conditions with 3 replicates.
rMATS allows you run with no replicates or multiple replicates. See documentation for more info.
1=MB_0_1.bam
2=MB_0_2.bam
3=MB_0_3.bam
4=MB_720_1.bam
5=MB_720_2.bam
6=MB_720_3.bam Prior to running this script you first must make a text file name b1.txt and b2.txt with the path to the bam_files in replicate separated by only by a comma.
For example b1.txt will be a text file with the following line: /path/to/MB_0_1.bam,/path/to/MB_0_2.bam,/path/to/MB_0_3.bam
As well as a b2.txt file with the following line: /path/to/MB_720_1.bam,/path/to/MB_720_2.bam,/path/to/MB_720_3.bam
/path/to refers to the bam file location, so in this example /dfs3b/hertel-lab/fcarranz/project_name/bam_files/example.bam
#name of output folder with rMATS comparison description
SAMPLE_OUTDIR=${OUTDIR}/${1}_${2}_${3}_v_${4}_${5}_${6}mkdir -p ${OUTDIR}
mkdir -p ${SAMPLE_OUTDIR}TXT=/dfs3b/hertel-lab/fcarranz/project_name/rmats.py \
--b1 ${TXT}/b1.txt \
--b2 ${TXT}/b2.txt \
-t single \
--readLength 100 \
--gtf ${GTF} \
--od ${SAMPLE_OUTDIR} \
--nthread 8--b1 A text file containing a comma separated list of the BAM files for sample 1.
--b2 A text file containing a comma separated list of the BAM files for sample 2.
-t single Type of read used in the analysis.
--readLength The length of each read.
--gtf Annotation file.
--od The directory for final output.
--nthread 8 The number of threads used.
See rMATS Documentation for more info
