Page MenuHomec4science

slurm-submit-script-WITH-containers.sh
No OneTemporary

File Metadata

Created
Wed, Nov 6, 09:34

slurm-submit-script-WITH-containers.sh

#!/bin/bash
#SBATCH --job-name=pipeline2-containers
#SBATCH --partition=shi
#SBATCH --time=02:00:00
#SBATCH --cpus-per-task=4
#SBATCH --mem=10G
#SBATCH --output=containers.log
module load Singularity/2.3
# define the number of cpus to use
# you can use env vars provided by your scheduler or hardcode the number of cpus to use
export NUM_CPUS=${SLURM_CPUS_PER_TASK}
export SINGULARITY_CONTAINER="./pipeline2.img"
##########################################################
# YOU SHOULD NOT NEED TO CHANGE ANYTHING BELOW THIS LINE
##########################################################
# create output directories if they don't exist
[ -d output/bowtie2 ] || mkdir -p output/bowtie2
[ -d output/samtools ] || mkdir -p output/samtools
[ -d output/freebayes ] || mkdir -p output/freebayes
RefGenome='./scicore-pipeline2-input-data/RefGenome/igenomes/Saccharomyces_cerevisiae/Ensembl/R64-1-1/Sequence/'
echo 'aligning reads with bowtie2...'
singularity exec ${SINGULARITY_CONTAINER} bowtie2 -p ${NUM_CPUS} -x $RefGenome/Bowtie2Index/genome -q -1 scicore-pipeline2-input-data/fastq/SRR5511076_1.ds.fastq -2 scicore-pipeline2-input-data/fastq/SRR5511076_2.ds.fastq -S output/bowtie2/yeast_reseq_ds-bt2aln.sam
echo 'SAM to sorted BAM...'
singularity exec ${SINGULARITY_CONTAINER} samtools view -bS output/bowtie2/yeast_reseq_ds-bt2aln.sam | singularity exec ${SINGULARITY_CONTAINER} samtools sort - --threads ${NUM_CPUS} -o output/samtools/yeast_reseq_ds-bt2aln.s.bam
#rm output/bowtie2/yeast_reseq_ds-bt2aln.sam
echo 'calling variants with FreeBayes...'
singularity exec ${SINGULARITY_CONTAINER} freebayes -f $RefGenome/WholeGenomeFasta/genome.fa output/samtools/yeast_reseq_ds-bt2aln.s.bam > output/freebayes/yeast_reseq_ds-bt2aln.s.vcf

Event Timeline