#!/bin/bash

#SBATCH --job-name=star_index
#SBATCH --partition=super
#SBATCH --nodes=1
#SBATCH --time=0-24:00:00
#SBATCH --output=star_index.%j.out
#SBATCH --error=star_index.%j.err
#SBATCH --mail-user=venkat.malladi@utsouthwestern.edu
#SBATCH --mail-type=ALL


module load iGenomes/2013-03-25
module load star/2.4.2a

STAR --runMode genomeGenerate --genomeFastaFiles $iGENOMES_DB_DIR\/Homo_sapiens/UCSC/hg19/Sequence/WholeGenomeFasta/genome.fa --sjdbOverhang 100 --sjdbGTFfile /project/GCRB/shared/Gencode_human/release_19/gencode.v19.annotation.gtf --runThreadN 8 --genomeDir /project/GCRB/shared/Gencode_human/release_19/prep-star.sh-1.0.0 --outFileNamePrefix gencode.v19.annotation



#!/bin/bash

#SBATCH --job-name=rsem_index
#SBATCH --partition=super
#SBATCH --nodes=1
#SBATCH --time=0-24:00:00
#SBATCH --output=rsem_index.%j.out
#SBATCH --error=rsem_index.%j.err
#SBATCH --mail-user=venkat.malladi@utsouthwestern.edu
#SBATCH --mail-type=ALL

module load iGenomes/2013-03-25
module load RSEM/1.2.31

rsem-prepare-reference --gtf /project/GCRB/shared/Gencode_human/release_19/gencode.v19.annotation.gtf $iGENOMES_DB_DIR\/Homo_sapiens/UCSC/hg19/Sequence/WholeGenomeFasta/genome.fa /project/GCRB/shared/Gencode_human/release_19/prep-rsem.sh-1.0.0

#!/bin/bash

#SBATCH --job-name=star_align
#SBATCH --partition=super
#SBATCH --nodes=1
#SBATCH --time=0-24:00:00
#SBATCH --output=star_align.%j.out
#SBATCH --error=star_align.%j.err
#SBATCH --mail-user=venkat.malladi@utsouthwestern.edu
#SBATCH --mail-type=ALL

module load iGenomes/2013-03-25
module load star/2.4.2a

STAR --genomeDir /project/GCRB/shared/Gencode_human/release_19/prep-star.sh-1.0.0/ --readFilesIn /project/GCRB/Lee_Lab/s163035/Matrix_analysis_PMIT_25842977/RNA-seq/ES_D10/ERR266338.fastq.gz                           \
    --readFilesCommand zcat  --genomeLoad NoSharedMemory      \
    --outFilterMultimapNmax 20 --alignSJoverhangMin 8 --alignSJDBoverhangMin 1    \
    --outFilterMismatchNmax 999 --outFilterMismatchNoverReadLmax 0.04              \
    --alignIntronMin 20 --alignIntronMax 1000000 --alignMatesGapMax 1000000         \
    --outSAMheaderCommentFile COfile.txt --outSAMheaderHD @HD VN:1.4 SO:coordinate   \
    --outSAMunmapped Within --outFilterType BySJout --outSAMattributes NH HI AS NM MD \
    --outSAMstrandField intronMotif --outSAMtype BAM SortedByCoordinate                \
    --quantMode TranscriptomeSAM --sjdbScore 1 --limitBAMsortRAM 60000000000 --outFileNamePrefix /project/GCRB/Lee_Lab/s163035/Matrix_analysis_PMIT_25842977/RNA-seq/ES_D10/align-star.sh-1.0.0/ERR266338

STAR --genomeDir /project/GCRB/shared/Gencode_human/release_19/prep-star.sh-1.0.0/ --readFilesIn /project/GCRB/Lee_Lab/s163035/Matrix_analysis_PMIT_25842977/RNA-seq/ES_D10/ERR266344.fastq.gz                        \
    --readFilesCommand zcat  --genomeLoad NoSharedMemory      \
    --outFilterMultimapNmax 1000 --alignSJoverhangMin 8 --alignSJDBoverhangMin 1    \
    --outFilterMismatchNmax 999 --outFilterMismatchNoverReadLmax 0.04              \
    --alignIntronMin 20 --alignIntronMax 1000000 --alignMatesGapMax 1000000         \
    --outSAMheaderCommentFile COfile.txt --outSAMheaderHD @HD VN:1.4 SO:coordinate   \
    --outSAMunmapped Within --outFilterType BySJout --outSAMattributes NH HI AS NM MD \
    --outSAMstrandField intronMotif --outSAMtype BAM SortedByCoordinate                \
    --quantMode TranscriptomeSAM --sjdbScore 1 --limitBAMsortRAM 60000000000 --outFileNamePrefix /project/GCRB/Lee_Lab/s163035/Matrix_analysis_PMIT_25842977/RNA-seq/ES_D10/align-star.sh-1.0.0/ERR266344

STAR --genomeDir /project/GCRB/shared/Gencode_human/release_19/prep-star.sh-1.0.0/ --readFilesIn /project/GCRB/Lee_Lab/s163035/Matrix_analysis_PMIT_25842977/RNA-seq/ES_D2/ERR266349.fastq.gz                           \
    --readFilesCommand zcat  --genomeLoad NoSharedMemory      \
    --outFilterMultimapNmax 1000 --alignSJoverhangMin 8 --alignSJDBoverhangMin 1    \
    --outFilterMismatchNmax 999 --outFilterMismatchNoverReadLmax 0.04              \
    --alignIntronMin 20 --alignIntronMax 1000000 --alignMatesGapMax 1000000         \
    --outSAMheaderCommentFile COfile.txt --outSAMheaderHD @HD VN:1.4 SO:coordinate   \
    --outSAMunmapped Within --outFilterType BySJout --outSAMattributes NH HI AS NM MD \
    --outSAMstrandField intronMotif --outSAMtype BAM SortedByCoordinate                \
    --quantMode TranscriptomeSAM --sjdbScore 1 --limitBAMsortRAM 60000000000 --outFileNamePrefix /project/GCRB/Lee_Lab/s163035/Matrix_analysis_PMIT_25842977/RNA-seq/ES_D2/align-star.sh-1.0.0/ERR266349

STAR --genomeDir /project/GCRB/shared/Gencode_human/release_19/prep-star.sh-1.0.0/ --readFilesIn /project/GCRB/Lee_Lab/s163035/Matrix_analysis_PMIT_25842977/RNA-seq/ES_D2/ERR266333.fastq.gz                           \
    --readFilesCommand zcat  --genomeLoad NoSharedMemory      \
    --outFilterMultimapNmax 1000 --alignSJoverhangMin 8 --alignSJDBoverhangMin 1    \
    --outFilterMismatchNmax 999 --outFilterMismatchNoverReadLmax 0.04              \
    --alignIntronMin 20 --alignIntronMax 1000000 --alignMatesGapMax 1000000         \
    --outSAMheaderCommentFile COfile.txt --outSAMheaderHD @HD VN:1.4 SO:coordinate   \
    --outSAMunmapped Within --outFilterType BySJout --outSAMattributes NH HI AS NM MD \
    --outSAMstrandField intronMotif --outSAMtype BAM SortedByCoordinate                \
    --quantMode TranscriptomeSAM --sjdbScore 1 --limitBAMsortRAM 60000000000 --outFileNamePrefix /project/GCRB/Lee_Lab/s163035/Matrix_analysis_PMIT_25842977/RNA-seq/ES_D2/align-star.sh-1.0.0/ERR266333

STAR --genomeDir /project/GCRB/shared/Gencode_human/release_19/prep-star.sh-1.0.0/ --readFilesIn /project/GCRB/Lee_Lab/s163035/Matrix_analysis_PMIT_25842977/RNA-seq/ES_D0/ERR266335.fastq.gz                       \
    --readFilesCommand zcat  --genomeLoad NoSharedMemory      \
    --outFilterMultimapNmax 1000 --alignSJoverhangMin 8 --alignSJDBoverhangMin 1    \
    --outFilterMismatchNmax 999 --outFilterMismatchNoverReadLmax 0.04              \
    --alignIntronMin 20 --alignIntronMax 1000000 --alignMatesGapMax 1000000         \
    --outSAMheaderCommentFile COfile.txt --outSAMheaderHD @HD VN:1.4 SO:coordinate   \
    --outSAMunmapped Within --outFilterType BySJout --outSAMattributes NH HI AS NM MD \
    --outSAMstrandField intronMotif --outSAMtype BAM SortedByCoordinate                \
    --quantMode TranscriptomeSAM --sjdbScore 1 --limitBAMsortRAM 60000000000 --outFileNamePrefix /project/GCRB/Lee_Lab/s163035/Matrix_analysis_PMIT_25842977/RNA-seq/ES_D0/align-star.sh-1.0.0/ERR266335

STAR --genomeDir /project/GCRB/shared/Gencode_human/release_19/prep-star.sh-1.0.0/ --readFilesIn /project/GCRB/Lee_Lab/s163035/Matrix_analysis_PMIT_25842977/RNA-seq/ES_D0/ERR266342.fastq.gz                           \
    --readFilesCommand zcat  --genomeLoad NoSharedMemory      \
    --outFilterMultimapNmax 1000 --alignSJoverhangMin 8 --alignSJDBoverhangMin 1    \
    --outFilterMismatchNmax 999 --outFilterMismatchNoverReadLmax 0.04              \
    --alignIntronMin 20 --alignIntronMax 1000000 --alignMatesGapMax 1000000         \
    --outSAMheaderCommentFile COfile.txt --outSAMheaderHD @HD VN:1.4 SO:coordinate   \
    --outSAMunmapped Within --outFilterType BySJout --outSAMattributes NH HI AS NM MD \
    --outSAMstrandField intronMotif --outSAMtype BAM SortedByCoordinate                \
    --quantMode TranscriptomeSAM --sjdbScore 1 --limitBAMsortRAM 60000000000 --outFileNamePrefix /project/GCRB/Lee_Lab/s163035/Matrix_analysis_PMIT_25842977/RNA-seq/ES_D0/align-star.sh-1.0.0/ERR266342

STAR --genomeDir /project/GCRB/shared/Gencode_human/release_19/prep-star.sh-1.0.0/ --readFilesIn /project/GCRB/Lee_Lab/s163035/Matrix_analysis_PMIT_25842977/RNA-seq/ES_D7/ERR266351.fastq.gz                    \
    --readFilesCommand zcat  --genomeLoad NoSharedMemory      \
    --outFilterMultimapNmax 1000 --alignSJoverhangMin 8 --alignSJDBoverhangMin 1    \
    --outFilterMismatchNmax 999 --outFilterMismatchNoverReadLmax 0.04              \
    --alignIntronMin 20 --alignIntronMax 1000000 --alignMatesGapMax 1000000         \
    --outSAMheaderCommentFile COfile.txt --outSAMheaderHD @HD VN:1.4 SO:coordinate   \
    --outSAMunmapped Within --outFilterType BySJout --outSAMattributes NH HI AS NM MD \
    --outSAMstrandField intronMotif --outSAMtype BAM SortedByCoordinate                \
    --quantMode TranscriptomeSAM --sjdbScore 1 --limitBAMsortRAM 60000000000 --outFileNamePrefix /project/GCRB/Lee_Lab/s163035/Matrix_analysis_PMIT_25842977/RNA-seq/ES_D7/align-star.sh-1.0.0/ERR266351

STAR --genomeDir /project/GCRB/shared/Gencode_human/release_19/prep-star.sh-1.0.0/ --readFilesIn /project/GCRB/Lee_Lab/s163035/Matrix_analysis_PMIT_25842977/RNA-seq/ES_D7/ERR266346.fastq.gz                          \
    --readFilesCommand zcat  --genomeLoad NoSharedMemory      \
    --outFilterMultimapNmax 1000 --alignSJoverhangMin 8 --alignSJDBoverhangMin 1    \
    --outFilterMismatchNmax 999 --outFilterMismatchNoverReadLmax 0.04              \
    --alignIntronMin 20 --alignIntronMax 1000000 --alignMatesGapMax 1000000         \
    --outSAMheaderCommentFile COfile.txt --outSAMheaderHD @HD VN:1.4 SO:coordinate   \
    --outSAMunmapped Within --outFilterType BySJout --outSAMattributes NH HI AS NM MD \
    --outSAMstrandField intronMotif --outSAMtype BAM SortedByCoordinate                \
    --quantMode TranscriptomeSAM --sjdbScore 1 --limitBAMsortRAM 60000000000 --outFileNamePrefix /project/GCRB/Lee_Lab/s163035/Matrix_analysis_PMIT_25842977/RNA-seq/ES_D7/align-star.sh-1.0.0/ERR266346

STAR --genomeDir /project/GCRB/shared/Gencode_human/release_19/prep-star.sh-1.0.0/ --readFilesIn /project/GCRB/Lee_Lab/s163035/Matrix_analysis_PMIT_25842977/RNA-seq/ES_D5/ERR266341.fastq.gz                   \
    --readFilesCommand zcat  --genomeLoad NoSharedMemory      \
    --outFilterMultimapNmax 1000 --alignSJoverhangMin 8 --alignSJDBoverhangMin 1    \
    --outFilterMismatchNmax 999 --outFilterMismatchNoverReadLmax 0.04              \
    --alignIntronMin 20 --alignIntronMax 1000000 --alignMatesGapMax 1000000         \
    --outSAMheaderCommentFile COfile.txt --outSAMheaderHD @HD VN:1.4 SO:coordinate   \
    --outSAMunmapped Within --outFilterType BySJout --outSAMattributes NH HI AS NM MD \
    --outSAMstrandField intronMotif --outSAMtype BAM SortedByCoordinate                \
    --quantMode TranscriptomeSAM --sjdbScore 1 --limitBAMsortRAM 60000000000 --outFileNamePrefix /project/GCRB/Lee_Lab/s163035/Matrix_analysis_PMIT_25842977/RNA-seq/ES_D5/align-star.sh-1.0.0/ERR266341

STAR --genomeDir /project/GCRB/shared/Gencode_human/release_19/prep-star.sh-1.0.0/ --readFilesIn /project/GCRB/Lee_Lab/s163035/Matrix_analysis_PMIT_25842977/RNA-seq/ES_D5/ERR266337.fastq.gz                          \
    --readFilesCommand zcat  --genomeLoad NoSharedMemory      \
    --outFilterMultimapNmax 1000 --alignSJoverhangMin 8 --alignSJDBoverhangMin 1    \
    --outFilterMismatchNmax 999 --outFilterMismatchNoverReadLmax 0.04              \
    --alignIntronMin 20 --alignIntronMax 1000000 --alignMatesGapMax 1000000         \
    --outSAMheaderCommentFile COfile.txt --outSAMheaderHD @HD VN:1.4 SO:coordinate   \
    --outSAMunmapped Within --outFilterType BySJout --outSAMattributes NH HI AS NM MD \
    --outSAMstrandField intronMotif --outSAMtype BAM SortedByCoordinate                \
    --quantMode TranscriptomeSAM --sjdbScore 1 --limitBAMsortRAM 60000000000 --outFileNamePrefix /project/GCRB/Lee_Lab/s163035/Matrix_analysis_PMIT_25842977/RNA-seq/ES_D5/align-star.sh-1.0.0/ERR266337


#!/bin/bash

#SBATCH --job-name=rsem_quant
#SBATCH --partition=super
#SBATCH --nodes=1
#SBATCH --time=0-24:00:00
#SBATCH --output=rsem_quant.%j.out
#SBATCH --error=rsem_quant.%j.err
#SBATCH --mail-user=venkat.malladi@utsouthwestern.edu
#SBATCH --mail-type=ALL

module load RSEM/1.2.31


rsem-calculate-expression -p 32 --bam --estimate-rspd --calc-ci --seed 12345 --no-bam-output --ci-memory 30000 /project/GCRB/Lee_Lab/s163035/Matrix_analysis_PMIT_25842977/RNA-seq/ES_D10/align-star.sh-1.0.0/ERR266344Aligned.toTranscriptome.out.bam /project/GCRB/shared/Gencode_human/release_19/prep-rsem.sh-1.0.0/gencode.v19.annotation /project/GCRB/Lee_Lab/s163035/Matrix_analysis_PMIT_25842977/RNA-seq/ES_D10/quant-rsem.sh-1.0.0/ERR266344Aligned_rsem
rsem-calculate-expression -p 32 --bam --estimate-rspd --calc-ci --seed 12345 --no-bam-output --ci-memory 30000 /project/GCRB/Lee_Lab/s163035/Matrix_analysis_PMIT_25842977/RNA-seq/ES_D10/align-star.sh-1.0.0/ERR266338Aligned.toTranscriptome.out.bam /project/GCRB/shared/Gencode_human/release_19/prep-rsem.sh-1.0.0/gencode.v19.annotation /project/GCRB/Lee_Lab/s163035/Matrix_analysis_PMIT_25842977/RNA-seq/ES_D10/quant-rsem.sh-1.0.0/ERR266338Aligned_rsem
rsem-calculate-expression -p 32 --bam --estimate-rspd --calc-ci --seed 12345 --no-bam-output --ci-memory 30000 /project/GCRB/Lee_Lab/s163035/Matrix_analysis_PMIT_25842977/RNA-seq/ES_D2/align-star.sh-1.0.0/ERR266349Aligned.toTranscriptome.out.bam /project/GCRB/shared/Gencode_human/release_19/prep-rsem.sh-1.0.0/gencode.v19.annotation /project/GCRB/Lee_Lab/s163035/Matrix_analysis_PMIT_25842977/RNA-seq/ES_D2/quant-rsem.sh-1.0.0/ERR266349Aligned_rsem
rsem-calculate-expression -p 32 --bam --estimate-rspd --calc-ci --seed 12345 --no-bam-output --ci-memory 30000 /project/GCRB/Lee_Lab/s163035/Matrix_analysis_PMIT_25842977/RNA-seq/ES_D2/align-star.sh-1.0.0/ERR266333Aligned.toTranscriptome.out.bam /project/GCRB/shared/Gencode_human/release_19/prep-rsem.sh-1.0.0/gencode.v19.annotation /project/GCRB/Lee_Lab/s163035/Matrix_analysis_PMIT_25842977/RNA-seq/ES_D2/quant-rsem.sh-1.0.0/ERR266333Aligned_rsem
rsem-calculate-expression -p 32 --bam --estimate-rspd --calc-ci --seed 12345 --no-bam-output --ci-memory 30000 /project/GCRB/Lee_Lab/s163035/Matrix_analysis_PMIT_25842977/RNA-seq/ES_D0/align-star.sh-1.0.0/ERR266335Aligned.toTranscriptome.out.bam /project/GCRB/shared/Gencode_human/release_19/prep-rsem.sh-1.0.0/gencode.v19.annotation /project/GCRB/Lee_Lab/s163035/Matrix_analysis_PMIT_25842977/RNA-seq/ES_D0/quant-rsem.sh-1.0.0/ERR266335Aligned_rsem
rsem-calculate-expression -p 32 --bam --estimate-rspd --calc-ci --seed 12345 --no-bam-output --ci-memory 30000 /project/GCRB/Lee_Lab/s163035/Matrix_analysis_PMIT_25842977/RNA-seq/ES_D0/align-star.sh-1.0.0/ERR266342Aligned.toTranscriptome.out.bam /project/GCRB/shared/Gencode_human/release_19/prep-rsem.sh-1.0.0/gencode.v19.annotation /project/GCRB/Lee_Lab/s163035/Matrix_analysis_PMIT_25842977/RNA-seq/ES_D0/quant-rsem.sh-1.0.0/ERR266342Aligned_rsem
rsem-calculate-expression -p 32 --bam --estimate-rspd --calc-ci --seed 12345 --no-bam-output --ci-memory 30000 /project/GCRB/Lee_Lab/s163035/Matrix_analysis_PMIT_25842977/RNA-seq/ES_D7/align-star.sh-1.0.0/ERR266346Aligned.toTranscriptome.out.bam /project/GCRB/shared/Gencode_human/release_19/prep-rsem.sh-1.0.0/gencode.v19.annotation /project/GCRB/Lee_Lab/s163035/Matrix_analysis_PMIT_25842977/RNA-seq/ES_D7/quant-rsem.sh-1.0.0/ERR266346Aligned_rsem
rsem-calculate-expression -p 32 --bam --estimate-rspd --calc-ci --seed 12345 --no-bam-output --ci-memory 30000 /project/GCRB/Lee_Lab/s163035/Matrix_analysis_PMIT_25842977/RNA-seq/ES_D7/align-star.sh-1.0.0/ERR266351Aligned.toTranscriptome.out.bam /project/GCRB/shared/Gencode_human/release_19/prep-rsem.sh-1.0.0/gencode.v19.annotation /project/GCRB/Lee_Lab/s163035/Matrix_analysis_PMIT_25842977/RNA-seq/ES_D7/quant-rsem.sh-1.0.0/ERR266351Aligned_rsem
rsem-calculate-expression -p 32 --bam --estimate-rspd --calc-ci --seed 12345 --no-bam-output --ci-memory 30000 /project/GCRB/Lee_Lab/s163035/Matrix_analysis_PMIT_25842977/RNA-seq/ES_D5/align-star.sh-1.0.0/ERR266337Aligned.toTranscriptome.out.bam /project/GCRB/shared/Gencode_human/release_19/prep-rsem.sh-1.0.0/gencode.v19.annotation /project/GCRB/Lee_Lab/s163035/Matrix_analysis_PMIT_25842977/RNA-seq/ES_D5/quant-rsem.sh-1.0.0/ERR266337Aligned_rsem
rsem-calculate-expression -p 32 --bam --estimate-rspd --calc-ci --seed 12345 --no-bam-output --ci-memory 30000 /project/GCRB/Lee_Lab/s163035/Matrix_analysis_PMIT_25842977/RNA-seq/ES_D5/align-star.sh-1.0.0/ERR266341Aligned.toTranscriptome.out.bam /project/GCRB/shared/Gencode_human/release_19/prep-rsem.sh-1.0.0/gencode.v19.annotation /project/GCRB/Lee_Lab/s163035/Matrix_analysis_PMIT_25842977/RNA-seq/ES_D5/quant-rsem.sh-1.0.0/ERR266341Aligned_rsem
