Start tophat by submitting to lonestar

Start tophat-cufflinks by submitting to lonestar

Step 0. Make sure all the required modules are loaded.

module load bowtie
module load tophat
module load cufflinks/2.0.2

Step 1. Copy over the directory $BI/ngs_course/tophat_cufflinks_enrichment to $SCRATCH and cd into that directory.

  How do I do this?
cp -r $BI/ngs_course/tophat_cufflinks_enrichment/ $SCRATCH
cd $SCRATCH/tophat_cufflinks_enrichment
ls


Step 2. Create a file called tophat.commands with tophat commands. You can use your favorite editor (like nano or emacs) to open and edit a file.

  How do I use nano to create and edit a file
nano tophat.commands

Use ctrl+o to write out the data then ctrl+x to quit. Say yes when asked whether you want to save the modifications.

tophat -p 8 -G reference/genes.gtf -o C1_R1_thout reference/genome data/GSM794483_C1_R1_1.fq data/GSM794483_C1_R1_2.fq
tophat -p 8 -G reference/genes.gtf -o C1_R2_thout reference/genome data/GSM794484_C1_R2_1.fq data/GSM794484_C1_R2_2.fq
tophat -p 8 -G reference/genes.gtf -o C1_R3_thout reference/genome data/GSM794485_C1_R3_1.fq data/GSM794485_C1_R3_2.fq
tophat -p 8 -G reference/genes.gtf -o C2_R1_thout reference/genome data/GSM794486_C2_R1_1.fq data/GSM794486_C2_R1_2.fq
tophat -p 8 -G reference/genes.gtf -o C2_R2_thout reference/genome data/GSM794487_C2_R2_1.fq data/GSM794487_C2_R2_2.fq
tophat -p 8 -G reference/genes.gtf -o C2_R3_thout reference/genome data/GSM794488_C2_R3_1.fq data/GSM794488_C2_R3_2.fq

Step 3. Create a file called cufflinks.commands with cufflinks commands. You can use your favorite editor (like nano or emacs) to open and edit a file.

cufflinks -p 8 -o C1_R1_clout C1_R1_thout/accepted_hits.bam
cufflinks -p 8 -o C1_R2_clout C1_R2_thout/accepted_hits.bam
cufflinks -p 8 -o C1_R3_clout C1_R3_thout/accepted_hits.bam
cufflinks -p 8 -o C2_R1_clout C2_R1_thout/accepted_hits.bam
cufflinks -p 8 -o C2_R2_clout C2_R2_thout/accepted_hits.bam
cufflinks -p 8 -o C2_R3_clout C2_R3_thout/accepted_hits.bam

Step 4. Alternatively, lets put tophat and cufflinks in one command file and make sure they run sequentially. Lets call this file tc.commands

Be careful in nano – it has an unfortunate tendency to add line breaks, and there must be exactly one command per line in a commands file.

tophat -p 8 -G reference/genes.gtf -o C1_R1_thout reference/genome data/GSM794483_C1_R1_1.fq data/GSM794483_C1_R1_2.fq && cufflinks -p 8 -o C1_R1_clout C1_R1_thout/accepted_hits.bam
tophat -p 8 -G reference/genes.gtf -o C1_R2_thout reference/genome data/GSM794484_C1_R2_1.fq data/GSM794484_C1_R2_2.fq && cufflinks -p 8 -o C1_R2_clout C1_R2_thout/accepted_hits.bam
tophat -p 8 -G reference/genes.gtf -o C1_R3_thout reference/genome data/GSM794485_C1_R3_1.fq data/GSM794485_C1_R3_2.fq && cufflinks -p 8 -o C1_R3_clout C1_R3_thout/accepted_hits.bam
tophat -p 8 -G reference/genes.gtf -o C2_R1_thout reference/genome data/GSM794486_C2_R1_1.fq data/GSM794486_C2_R1_2.fq && cufflinks -p 8 -o C2_R1_clout C2_R1_thout/accepted_hits.bam
tophat -p 8 -G reference/genes.gtf -o C2_R2_thout reference/genome data/GSM794487_C2_R2_1.fq data/GSM794487_C2_R2_2.fq && cufflinks -p 8 -o C2_R2_clout C2_R2_thout/accepted_hits.bam
tophat -p 8 -G reference/genes.gtf -o C2_R3_thout reference/genome data/GSM794488_C2_R3_1.fq data/GSM794488_C2_R3_2.fq && cufflinks -p 8 -o C2_R3_clout C2_R3_thout/accepted_hits.bam

Step 5. We have a commands file. We need a launcher file to submit this to the lonestar queue. Use launcher_creator.py to create a launcher file.

  Remind me how to use launcher_creator.py for this task
launcher_creator.py -n tophat_cufflinks -q normal -t 12:00:00 -j tc.commands -l tc_launcher.sge

Step 6. Submit this job to the queue.

  Remind me how to submit jobs to the lonestar queue
qsub tc_launcher.sge
Use qstat to find the jobId for this job
qstat

Step 7. Create a file called cuffmerge.commands to run cuffmerge on results from step 6.

nano cuffmerge.commands
cuffmerge -g reference/genes.gtf -s reference/genome.fa -p 8 assembly_list.txt

Step 8. Use launcher_creator to create a launcher for this cuffmerge job and submit it to the queue such that it runs after the previous job completes.

launcher_creator.py -n cuffmerge -q normal -t 6:00:00 -j cuffmerge.commands -l cuffmerge_launcher.sge
qstat 
qsub -hold_jid <jobid> cuffmerge_launcher.sge

Step 9. Create a file called cuffdiff.commands to run cuffdiff on results from step 7.

nano cuffdiff.commands
cuffdiff -o diff_out -b reference/genome.fa -p 8 -L C1,C2 -u merged_asm/merged.gtf C1_R1_thout/accepted_hits.bam,C1_R2_thout/accepted_hits.bam,C1_R3_thout/accepted_hits.bam C2_R1_thout/accepted_hits.bam,C2_R2_thout/accepted_hits.bam,C2_R3_thout/accepted_hits.bam

Step 10. Use launcher_creator to create a launcher for this cuffdiff job and submit it to the queue such that it runs after the previous job completes.

launcher_creator.py -n cuffdiff -q normal -t 6:00:00 -j cuffdiff.commands -l cuffdiff_launcher.sge
qsub -hold_jid <jobid> cuffdiff_launcher.sge