#!/bin/bash -l # Tisha Melia # June 23, 2015 # # Create cufflinks reconstruction for each sample # All lines starting with "#$" are SGE qsub commands # It accepts 4 command line arguments with of files to run # # qsub -N name -P waxmanlab -pe single_node 2-8 -l h_rt=72:00:00 cufflinks.qsub [SAMPLE_NAME] [STRANDEDNESS] [BASE_INPUT_FILE] [BASE_OUTPUT_DIR] # Specify which shell to use #$ -S /bin/bash # Run on the current working directory #$ -cwd # Join standard output and error to a single file #$ -j y # Send an email when the job begins and when it ends running # Whom to send the email to #checking the command line arg if [ $# -lt 4 ] ; then echo "Need 4 command line arguments to run" echo "qsub -N name -P waxmanlab -pe single_node 2-8 -l h_rt=72:00:00 cufflinks.qsub [SAMPLE_NAME] [STRANDEDNESS] [BASE_INPUT_FILE] [BASE_OUTPUT_DIR]" exit 0 fi # SAMPLE_NAME=$1 STRANDEDNESS=$2 BASE_INPUT_FILE=$3 BASE_OUTPUT_DIR=$4 BASE_AUX_DIR="/restricted/projectnb/waxmanlab/varsha/cufflinks" # Now let's keep track of some information just in case anything goes wrong echo "==========================================================" echo "Starting on : $(date)" echo "Running on node : $(hostname)" echo "Current directory : $(pwd)" echo "Current job ID : $JOB_ID" echo "Current job name : $JOB_NAME" echo "Task index number : $TASK_ID" echo "==========================================================" # Go to local scratch directory cd ${TMPDIR} ls echo $TMPDIR # print out some diagnostic stuff echo Running on host `hostname` echo echo Directory is `pwd` echo echo Start time is `date` echo module load boost/1.69.0 module load samtools/0.1.19 module load bowtie2/2.3.4.1 module load cufflinks/2.2.1 module load python3 echo "copying..." # copy user input date files to scratch cp $BASE_INPUT_FILE mapped.bam cp ${BASE_AUX_DIR}/genomeWithRandom.fa . #exactly the same as the previous one cp ${BASE_AUX_DIR}/genes.gtf . echo "Current dir:" pwd # run my commands echo echo "running commands..." echo ls * OUTPUT_DIR="${SAMPLE_NAME}_cufflinks" cufflinks -o ${OUTPUT_DIR} -p $NSLOTS -g genes.gtf -b genomeWithRandom.fa -u --library-type $STRANDEDNESS mapped.bam echo "cufflinks -o ${OUTPUT_DIR} -p $NSLOTS -g genes.gtf -b genomeWithRandom.fa -u --library-type $STRANDEDNESS mapped.bam" #cufflinks -o ${OUTPUT_DIR} -p $NSLOTS -g genes.gtf --library-type $STRANDEDNESS mapped.bam #echo "cufflinks -o ${OUTPUT_DIR} -p $NSLOTS -g genes.gtf --library-type $STRANDEDNESS mapped.bam" #Usage: cufflinks [options] #General Options: # -o/--output-dir write all output files to this directory [ default: ./ ] # -p/--num-threads number of threads used during analysis [ default: 1 ] # --seed value of random number generator seed [ default: 0 ] # -G/--GTF quantitate against reference transcript annotations # -g/--GTF-guide use reference transcript annotation to guide assembly # -M/--mask-file ignore all alignment within transcripts in this file # -b/--frag-bias-correct use bias correction - reference fasta required [ default: NULL ] # -u/--multi-read-correct use 'rescue method' for multi-reads (more accurate) [ default: FALSE ] # --library-type library prep used for input reads [ default: below ] # copy the output files to users storage dir cp -r ${OUTPUT_DIR} ${BASE_OUTPUT_DIR}/. echo "done running. copying..." #Just list everything in scratch dir (Don't know what output files I need) echo "List of files in scratch" ls * #Also want the file size of everything echo "Size of files in scratch" du -ch * # print out some diagnostic stuff echo Stop time is `date`