slurm script tp train classifier using a cluster

I am stuck at build our amplicon-region specific classifier.

qiime feature-classifier fit-classifier-naive-bayes --i-reference-reads silva-138-ssu-nr99-seqs-515f-806r-uniq.qza --i-reference-taxonomy silva-138-ssu-nr99-tax-515f-806r-derep-uniq.qza --o-classifier silva-138-ssu-nr99-515f-806r-classifier.qza
**Killed !!!!!! after reaching 13.9 G Ram**

So I am joining a cluster to run that.
Can you please provide slurm script that i can use to manage that?
I have this as a start

#!/bin/bash

#SBATCH --job-name=train_classifier
#SBATCH --partition=carl.p
#SBATCH --nodes=1
#SBATCH --ntasks=1
#SBATCH --mem=20G
#SBATCH --time=0-2:00  # D-HH or HH:MM
#SBATCH --output=train_classifier.out
#SBATCH --error=train_classifier.err
#SBATCH --mail-type=END,FAIL

for i in {1..100}; do
echo $RANDOM > random_numbers.txt
done

I do not understand how my command **qiime feature-classifier fit-classifier-naive-bayes --i-reference-reads silva-138-ssu-nr99-seqs-515f-806r-uniq.qza --i-reference-taxonomy silva-138-ssu-nr99-tax-515f-806r-derep-uniq.qza --o-classifier silva-138-ssu-nr99-515f-806r-classifier.qza**  should be intergrated in this slurm script to be excuted??

Thanks in advance

Like this:

#!/bin/bash

#SBATCH --job-name=train_classifier
#SBATCH --partition=carl.p
#SBATCH --nodes=1
#SBATCH --ntasks=1
#SBATCH --mem=20G
#SBATCH --time=0-2:00  # D-HH or HH:MM
#SBATCH --output=train_classifier.out
#SBATCH --error=train_classifier.err
#SBATCH --mail-type=END,FAIL

echo "Running Qiime 2 command"

qiime feature-classifier fit-classifier-naive-bayes \
  --i-reference-reads silva-138-ssu-nr99-seqs-515f-806r-uniq.qza \
  --i-reference-taxonomy silva-138-ssu-nr99-tax-515f-806r-derep-uniq.qza \
  --o-classifier silva-138-ssu-nr99-515f-806r-classifier.qza

echo "Done!"

Ask someone about the best sbatch settings to use. Like, you have this set to carl.p's partition and to run for 2 hours. You should get Carl's permission and maybe let it run longer than 2 hours!

Thank you so much.

Why i run this script, i am getting train_classifier.out but where is the qiime artificat silva-138-ssu-nr99-515f-806r-classifier.qza that i am running this syntax to have it!!
sorry for my confusion..

It should be in the same directory as the two input .qza files. If you can't find it, ask your system admin and they can help you find it.

Also open up that train_classifier.out log file and see if there was any errors running this script.

1 Like