Ruiqi Li
02/14/2026, 5:23 PMwithName: GTDBTK_CLASSIFYWF {
cpus = { 10 * task.attempt }
memory = { 128.GB * task.attempt }
time = { 12.h * task.attempt }
}
withName: METASPADES {
cpus = { params.spades_fix_cpus != -1 ? params.spades_fix_cpus : (10 * task.attempt) }
memory = { 64.GB * (2 ** (task.attempt - 1)) }
time = { 24.h * (2 ** (task.attempt - 1)) }
errorStrategy = { task.exitStatus in (...) ? 'retry' : 'finish' }
maxRetries = 5
}
since I will need to request specific number of cpus and amount of memories using slurm, what would you recommend to do in this case? Keep increasing mem/cpu when it fails? is there a better way?Ruiqi Li
02/14/2026, 5:23 PMWorkflow execution completed unsuccessfully!
The exit status of the task that caused the workflow execution to fail was: null.
The full error message was:
Error executing process > 'NFCORE_MAG:MAG:ASSEMBLY:SHORTREAD_ASSEMBLY:METASPADES (CR180008)'
Caused by:
Process requirement exceeds available memory -- req: 128 GB; avail: 120 GB
Command executed:
spades.py \
--meta \
--threads 48 \
--memory 128 \
\
-1 CR180008_run0_phix_removed.unmapped_1.fastq.gz -2 CR180008_run0_phix_removed.unmapped_2.fastq.gz \
-o ./
mv spades.log SPAdes-CR180008.spades.logRuiqi Li
02/14/2026, 5:24 PMWorkflow execution completed unsuccessfully!
The exit status of the task that caused the workflow execution to fail was: null.
The full error message was:
Error executing process > 'NFCORE_MAG:MAG:GTDBTK:GTDBTK_CLASSIFYWF (MEGAHIT-MaxBin2-unclassified-unrefined-CR180008)'
Caused by:
Process requirement exceeds available memory -- req: 128 GB; avail: 120 GB
Command executed:
export GTDBTK_DATA_PATH="$(find -L gtdb -name 'metadata' -type d -exec dirname {} \;)"
if [ "--scratch_dir pplacer_tmp" != "" ] ; then
mkdir pplacer_tmp
fi
gtdbtk classify_wf \
--extension fa --min_perc_aa 10 --min_af 0.65 --pplacer_cpus 1 \
--genome_dir bins \
--prefix "MEGAHIT-MaxBin2-unclassified-unrefined-CR180008" \
--out_dir MEGAHIT-MaxBin2-unclassified-unrefined-CR180008 \
--cpus 10 \
--scratch_dir pplacer_tmpRuiqi Li
02/14/2026, 5:35 PM[liruiqi@discovery2 docker_nohost]$ cat run_nfcore_mag_apptainer.slurm
#!/bin/bash
#SBATCH --job-name=nfcore_app
#SBATCH --partition=main
#SBATCH --time=18:00:00
#SBATCH --cpus-per-task=16
#SBATCH --mem=120G
#SBATCH --output=/project2/ckenkel_26/liruiqi/mag_out_project2/logs/nfcore_mag.%j.out
#SBATCH --error=/project2/ckenkel_26/liruiqi/mag_out_project2/logs/nfcore_mag.%j.err
#SBATCH --mail-user=liruiqi@usc.edu
#SBATCH --mail-type=END,FAIL
# Move to project directory
cd /project2/ckenkel_26/liruiqi/mag_out_project2/docker_nohost
module purge
module load apptainer/1.4.5
# Activate conda environment
source ~/.bashrc
conda activate meta
# Run nf-core/mag
nextflow run nf-core/mag \
-profile apptainer \
--input /project2/ckenkel_26/liruiqi/mag_out_project2/samplesheet.csv \
--outdir /project2/ckenkel_26/liruiqi/mag_out_project2/docker_nohost \
--spades_fix_cpus 16 \
--gtdb_db /project2/biodb/gtdb \
--host_fasta /project2/ckenkel_26/liruiqi/mag_out_project2/Osedax_frankpressi.fna \
--host_removal_verysensitiveJames Fellows Yates
02/16/2026, 8:55 AMSlackbot
02/16/2026, 8:55 AMJames Fellows Yates
02/16/2026, 8:55 AMJames Fellows Yates
02/16/2026, 8:56 AMJames Fellows Yates
02/16/2026, 8:56 AMJames Fellows Yates
02/16/2026, 8:56 AMJames Fellows Yates
02/16/2026, 8:56 AMRuiqi Li
02/17/2026, 3:46 PM