#!/bin/bash -l # tisha Melia # June 29, 2015 # All lines starting with "#$" are SGE qsub commands # qsub -N mergeCuffAll -P waxmanlab -pe single_node 2-8 cuffmerge.qsub prefix input_file output_folder #-N refer to name of output folder, prefix- name of your gtf file result, input:samples.txt, output_folder: /rest../../varsha/cufflinks/cuffmerg # 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 if [ $# -lt 3 ] ; then echo "Need at least 3 line arguments" echo "qsub -N name -P waxmanlab -pe single_node 2-8 cuffmerge.qsub [prefix] [input_file] [output_folder]" exit 0 fi # 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 python2/2.7.16 SAMPLE_PREFIX=$1 INPUT_FILE_LIST=$2 RESULT_CUFFMERGE_DIR=$3 IFS=$'\t' while read SAMPLE_NAME INPUT_FILE; do if [[ "$SAMPLE_NAME" =~ \#.* ]];then echo "skipped comment line" else echo $SAMPLE_NAME echo $INPUT_FILE echo "cp $INPUT_FILE ${SAMPLE_NAME}.gtf" cp $INPUT_FILE ${SAMPLE_NAME}.gtf echo "${SAMPLE_NAME}.gtf" >> assemblies.txt fi done < $INPUT_FILE_LIST #printing assemblies.txt cat assemblies.txt BASE_AUX_DIR="/net/waxman-server/mnt/data/waxmanlabvm_home/kkarri/varsha/cufflinks/cuffmerge_withkk/new" cp ${BASE_AUX_DIR}/genomeWithRandom.fa . #exactly the same as the previous one cp ${BASE_AUX_DIR}/genes.gtf . echo "Finished copying..." echo "Current dir:" pwd # run my commands echo echo "running commands..." echo ls OUTPUT_DIR="${SAMPLE_PREFIX}_cuffmerge" cuffmerge -o ${OUTPUT_DIR} -p $NSLOTS -g genes.gtf -s genomeWithRandom.fa assemblies.txt echo "cuffmerge -o ${OUTPUT_DIR} -p $NSLOTS -g genes.gtf -s genomeWithRandom.fa assemblies.txt" #Usage: # cuffmerge [Options] # #Options: # -h/--help Prints the help message and exits # -o Directory where merged assembly will be written [ default: ./merged_asm ] # -g/--ref-gtf An optional "reference" annotation GTF. # -s/--ref-sequence / Genomic DNA sequences for the reference. # --min-isoform-fraction <0-1.0> Discard isoforms with abundance below this [ default: 0.05 ] # -p/--num-threads Use this many threads to merge assemblies. [ default: 1 ] # --keep-tmp Keep all intermediate files during merge # copy the output files to users storage dir cp -r ${OUTPUT_DIR} ${RESULT_CUFFMERGE_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`