#!/bin/bash #PBS -N {Name_of_run_remove_spaces} #PBS -q add #PBS -l walltime=48:00:00 #PBS -l nodes=1:ppn=16:gpus=2 #PBS -l pmem=16gb #PBS -m n #PBS -o {name_of_job}.output #PBS -e {name_of_job}.error ##Notes on what to change in the PBS section above ## Change -N by replacing {Name_of_run_remove_spaces} with something like guppy_job_1 ## Change -o by replacing {name_of_job} with the job name you chose above ## Change -e by replacing {name_of_job} with the job name you chose above #Specify version of ont-guppy gpu to run (do not change) GUPPY_VERSION=6.0.1 #Specify guppy location - DO NOT CHANGE GUPPY_DIR="/soft/sl7/gen5/ont-guppy-gpu/$GUPPY_VERSION/data" ####################################################################### ## ONT-Guppy for GPU input parameters ## ####################################################################### ####################################################################### ## input_files ## ####################################################################### ## Path to the input fast5 files ## ####################################################################### INPUT_FILES=fast5/ ####################################################################### ## output_dir ## ####################################################################### ## Path to a directory that will store the results ## ####################################################################### OUTPUT_DIR=guppy_test_out ####################################################################### ## config file ## ####################################################################### ## Guppy can be executed with config file or a flowcell/kit combo ## ## ## ## To use a config file: ## ## ## ## 1. Set USE_CONFIG_FILE equal to yes ## ## 2. Set CONFIG_FILE equal to the config file to use ## ## ## ## ## ## To view list of config files, execute: ## ## ## ## guppy_basecaller --print_workflows ## ## ## ####################################################################### USE_CONFIG_FILE=yes CONFIG_FILE=dna_r9.4.1_450bps_sup.cfg ####################################################################### ## flowcell / kit combination ## ####################################################################### ## Guppy can be executed with config file or a flowcell/kit combo ## ## ## ## To use a flowcell/kit combination: ## ## ## ## 1. Set USE_COMBO equal to yes ## ## 2. Set FLOWCELL equal to the flowcell to use ## ## 3. Set KIT equal to the git to use ## ## ## ## ## ## To view list of avaible kits and flowcells, execute: ## ## ## ## guppy_basecaller --print_workflows ## ## ## ####################################################################### USE_COMBO=no FLOWCELL=SQK-DCS108 KIT=FLO-MIN107 ####################################################################### ## Extra parameters (not usually necessary to change these values) ## ####################################################################### ####################################################################### ## Compress the fastq output flag ## ####################################################################### COMPRESS_FASTQ=no #The base run command - now add options RUN_CMD="guppy_basecaller -i $INPUT_FILES -r -s $OUTPUT_DIR" ####################################################################### ## Beyond this area user editing is not required ## ####################################################################### ##Check to add compress_fastq flag if [ "$COMPRESS_FASTQ" = yes ] then RUN_CMD="$RUN_CMD --compress_fastq" fi ##Check to add config file as input if [ "$USE_CONFIG_FILE" = yes ] then echo $USE_CONFIG_FILE RUN_CMD="$RUN_CMD -c $GUPPY_DIR/$CONFIG_FILE" fi #Check to add flow cell and kit as input configuration if [ "$USE_COMBO" = yes ] then RUN_CMD="$RUN_CMD --flowcell $FLOWCELL --kit $KIT" fi ###################################################################### ## Set the environment ## ###################################################################### CUDA_VER=11.6 #Set-up the module loads module load hpc &>/dev/null #Use new cuda #module unload cuda &>/dev/null #module load cuda/$cuda_version #Load the guppy basecaller module module load "life-sciences/ont-guppy-gpu/$GUPPY_VERSION" &>/dev/null ##################################################################### ## Job Specific Files and directory structures ## ##################################################################### WORK_DIR=$PBS_O_WORKDIR DATE=$(date +%Y-%m-%d-%H.%M.%S) DATE_START=$(date +"%s") SCRATCH=$HPC_SCRATCH NodesFile="$WORK_DIR/hpc.nodes" DebugFile="$WORK_DIR/hpc.debug" cd $PBS_O_WORKDIR cat $PBS_NODEFILE| sort > $NodesFile #setup gpus [ -e $PBS_GPUFILE ] && export CUDA_VISIBLE_DEVICES=$(cat $PBS_GPUFILE|sed "s|.*gpu||g"|tr '\n' ','|sed "s|,$||g") #write gpu definitions in guppy's format #GPU_DEF="" #for i in ${CUDA_VISIBLE_DEVICES//,/ } #do # GPU_DEF="$GPU_DEF cuda:$i" #done #GPU_DEF=$(echo "$GPU_DEF" | xargs) #Add to run command RUN_CMD="$RUN_CMD -x cuda:$CUDA_VISIBLE_DEVICES" echo $RUN_CMD ################################################################# ###################################################################### ## Prepare the Scratch Directory ## ###################################################################### [ -e $SCRATCH ] || mkdir -p $SCRATCH cd $PBS_O_WORKDIR /bin/cp -pr * $SCRATCH/ sleep 5 ################################################################# ################################################################# ### Execute the application ### ################################################################# cd $SCRATCH $RUN_CMD EXIT_CODE=$? DATE_END=$(date +"%s") sleep 5 ################################################################# ################################################################# ### Update Debug Information ### ################################################################# echo >> $DebugFile echo >> $DebugFile diff=$(($DATE_END-$DATE_START)) echo "Exited with code : $EXIT_CODE" >> $DebugFile echo "Finished : $(date +%Y-%m-%d-%H.%M.%S)" >> $DebugFile echo >> $DebugFile echo >> $DebugFile diff_h=$(( $diff /60/60 )) diff_m=$(( ( $diff - ( $diff_h * 60 * 60 ) ) / 60 )) diff_s=$(( $diff - ( ($diff_h * 60 * 60) + ( $diff_m * 60 ) ) )) printf "Elapsed Time : %02d:%02d:%02d\n" $diff_h $diff_m $diff_s >> $DebugFile echo >> $DebugFile echo >> $DebugFile echo "DONE" >> $DebugFile ################################################################# ################################################################# ### Move files back from scratch ### ################################################################# /bin/mv -f $SCRATCH/* "$WORK_DIR/" && rm -rf $SCRATCH ################################################################# exit $EXIT_CODE