Skip to content

Instantly share code, notes, and snippets.

Created January 31, 2023 08:34
What would you like to do?
Example of SLURM array job for Everlyn
#!/usr/bin/bash -l
#SBATCH -p batch
#SBATCH -n 8
#SBATCH -J prank
# Start a job array with eight CPUs total where we iterate over 1,000+ FASTA
# files and start a prank command for each one. SLURM ensures that there are
# no more than eight running at the same time within the same allocation.
# See:
# Location of input files
# Location to write output files in node's scratch space
# Create scratch directory and move into it
mkdir -p $SCRATCH_DIR
# Load a specific version of prank
module load prank/170427
# Change to directory of input files
# Iterate over all FASTA files
for file in Hircus-*.fas; do
# Run prank with 1 CPU, output to scratch directory
srun -n1 --exclusive prank -d=$file -o=$SCRATCH_DIR/${file%.fas} -codon -F -f=paml &
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment