#!/bin/bash #SBATCH --dependency=afterany:4873:4874:4875:4876:4877 set -e set -o pipefail umask 0002 #### SET THE STAGE SCRATCH_DIR=/scratch/DNABamStats_2024-11-01--10-45-40_NA12891_chr10_temp$$ GSTORE_DIR=/srv/GT/analysis/course_sushi/public/gstore/projects INPUT_DATASET=/srv/GT/analysis/course_sushi/public/gstore/projects/p1007/DNABamStats_2024-11-01--10-45-40/input_dataset.tsv LAST_JOB=FALSE echo "Job runs on `hostname`" echo "at $SCRATCH_DIR" mkdir $SCRATCH_DIR || exit 1 cd $SCRATCH_DIR || exit 1 source /usr/local/ngseq/etc/lmod_profile module add Dev/R/4.4.0 Tools/Picard/3.2.0 QC/Qualimap/2.3.0 QC/SAMStat/1.5.1 Tools/samtools/1.20 #### NOW THE ACTUAL JOBS STARTS #echo Display=$DISPLAY set -x REF=/srv/GT/reference/Homo_sapiens/Ensembl/GRCh37.p13/Annotation/Version-2015-03-05/../../Sequence/WholeGenomeFasta/genome.fa BAM_FILE=/srv/GT/analysis/course_sushi/public/gstore/projects/p1007/Bowtie2_myPre_WES_all_2024-11-01--10-41-52/NA12891_chr10.bam FN=$(basename $BAM_FILE) ###samstat cp -a $BAM_FILE . samstat $FN mv {$FN,NA12891_chr10}.samstat.html ###qualimap unset DISPLAY ; qualimap bamqc -bam $FN -c -nt 8 --java-mem-size=30G -outdir NA12891_chr10 > qualimap.out ###picard /usr/local/ngseq/packages/Dev/jdk/21/bin/java -Xmx30g -jar $Picard_jar CollectGcBiasMetrics OUTPUT=NA12891_chr10.gc.dat SUMMARY_OUTPUT=NA12891_chr10.gc.sum.dat INPUT=$FN CHART_OUTPUT=NA12891_chr10.picard.pdf ASSUME_SORTED=true REFERENCE_SEQUENCE=$REF VALIDATION_STRINGENCY=LENIENT > picard.out 2> picard.err #### JOB IS DONE WE PUT THINGS IN PLACE AND CLEAN AUP rsync -r NA12891_chr10.samstat.html /srv/GT/analysis/course_sushi/public/gstore/projects/p1007/DNABamStats_2024-11-01--10-45-40/ rsync -r NA12891_chr10 /srv/GT/analysis/course_sushi/public/gstore/projects/p1007/DNABamStats_2024-11-01--10-45-40/ rsync -r NA12891_chr10.picard.pdf /srv/GT/analysis/course_sushi/public/gstore/projects/p1007/DNABamStats_2024-11-01--10-45-40/ cd /scratch rm -rf /scratch/DNABamStats_2024-11-01--10-45-40_NA12891_chr10_temp$$ || exit 1 echo __SCRIPT END__