This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Running python script on a directory of FASTA files with SLURM

Hi,

I'm attempting to run a python script on multiple files in a directory. When I submitted the job, the output was the python script with the added output from the script.py

script.py_output.fasta

SeqIO.write(non_hypermutated, filename + "_output.fasta", "fasta")

The goal was to run the program on all the FASTA files in the directory and add _output to the end. I define filename in my program as :

filename = sys.argv[0]

The job is submitted with a SLURM script as seen below. :

#!/bin/bash
 #SBATCH --job-name=RemoveHyperMutated     # Job Name
 #SBATCH --time=04:00:00                   # WallTime
 #SBATCH --nodes=1                         # Number of Nodes
 #SBATCH --ntasks-per-node=1               # Number of tasks (MPI processes)
 #SBATCH --cpus-per-task=1                 # Num threads per task(OMP threads)
 #SBATCH --output=file#.out                # Output file
 #SBATCH --error=file#.err                 # Error file
 #SBATCH --qos=normal                      # Quality of service 

  module load anaconda3/5.1.0
  for file in  *.fasta; 
  do python script.py "$file"
  done

Please let me know if you have any suggestions! Thank you.

slurm python bash wildcard fasta

0 answers

No answers yet.

Log in to answer this question.