mina ming
11/04/2025, 5:09 PM#!/usr/bin/env bash
#SBATCH -J rnaseq_034_4
#SBATCH -p high_mem
#SBATCH -c 4
#SBATCH --mem=16G
#SBATCH -t 48:00:00
#SBATCH -o slurm-batch-%j.out
#SBATCH -e slurm-batch-%j.err
set -euo pipefail
# --- MODULES ---
module purge
module load Java/17.0.6
# module load apptainer # Uncomment if Eureka2 needs it
# --- DIRECTORIES ---
USER_DIR=/users/$USER
SCRATCH_BASE=/parallel_scratch/$USER
WORK_DIR=$SCRATCH_BASE/nfcore/rnaseq_034_4
TMP_DIR=$SCRATCH_BASE/tmp
mkdir -p "$WORK_DIR/tmp" "$SCRATCH_BASE/apti-cache" "$TMP_DIR"
chmod 777 "$TMP_DIR" "$WORK_DIR/tmp"
# --- ENVIRONMENT ---
export TMPDIR=$TMP_DIR
export APPTAINER_TMPDIR=$TMPDIR
export NXF_SINGULARITY_CACHEDIR=$SCRATCH_BASE/apti-cache
export NXF_SINGULARITY_OPTS="--writable-tmpfs --scratch /tmp --pwd /tmp -B $TMPDIR:/tmp --env TMPDIR=/tmp"
export NXF_WORK=$WORK_DIR/work
export NXF_TEMP=$WORK_DIR/tmp
# --- INSTALL NEXTFLOW IF MISSING ---
BIN_DIR=$SCRATCH_BASE/bin
mkdir -p "$BIN_DIR"
if ! command -v nextflow >/dev/null 2>&1; then
cd "$BIN_DIR"
curl -fsSL https://get.nextflow.io -o nextflow
chmod +x nextflow
fi
export PATH="$BIN_DIR:$PATH"
# --- RUN PIPELINE ---
echo ">>> Starting nf-core/rnaseq for sample 034_4 at $(date)"
cd "$SCRATCH_BASE"
nextflow run nf-core/rnaseq -r 3.21.0 -profile singularity \
--input $USER_DIR/singlesample.csv \
--outdir $WORK_DIR/results \
--fasta $USER_DIR/scratch/nfcore/rnaseq_S1/results/genome/rsem/genome.fa \
--gtf $USER_DIR/scratch/nfcore/rnaseq_S1/results/genome/genes.filtered.gtf \
--salmon_index $USER_DIR/scratch/nfcore/rnaseq_S1/results/genome/index/salmon \
--email fi0001@surrey.ac.uk \
--aligner salmon \
-resume but I do not get any quantification in the results folder
[fi0001@login1 (eureka2) ~]$ ls -lh /parallel_scratch/fi0001/nfcore/rnaseq_034_4/results/
total 3.0K
drwxr-xr-x 4 fi0001 a-bm00-staff 2 Nov 4 01:48 fastqc
drwxr-xr-x 4 fi0001 a-bm00-staff 2 Nov 4 01:53 fq_lint
drwxr-xr-x 3 fi0001 a-bm00-staff 6 Nov 4 14:15 genome
drwxr-xr-x 3 fi0001 a-bm00-staff 1 Nov 4 04:31 multiqc
drwxr-xr-x 2 fi0001 a-bm00-staff 28 Nov 4 16:34 pipeline_info
drwxr-xr-x 2 fi0001 a-bm00-staff 52 Nov 4 04:30 trimgalore
this is my config profiles {
singularity {
process.executor = 'slurm'
singularity.enabled = true
singularity.autoMounts = true
}
}
process {
scratch = true
queue = 'shared'
errorStrategy = { task.attempt < 2 ? 'retry' : 'terminate' }
maxRetries = 1
// Keep for later if you switch back to STAR
withName: 'NFCORE_RNASEQ:ALIGN_STAR:STAR_ALIGN_IGENOMES' {
queue = 'high_mem'
cpus = 16
memory = '96 GB'
time = '48h'
}
}
executor {
submitRateLimit = '8 sec'
}
params {
// I/O
input = "${baseDir}/singlesample.csv"
outdir = "/parallel_scratch/${System.getenv('USER')}/nfcore/rnaseq_S1/results"
// Keep useful intermediates
save_trimmed = true
save_reference = true
// **Use local references (no iGenomes)**
genome = null
fasta = "/users/fi0001/scratch/nfcore/rnaseq_S1/results/genome/rsem/genome.fa"
gtf = "/users/fi0001/scratch/nfcore/rnaseq_S1/results/genome/genes.filtered.gtf"
salmon_index = "/users/fi0001/scratch/nfcore/rnaseq_S1/results/genome/index/salmon"
// QC / trimming (NovaSeq/NextSeq)
extra_fqlint_args = "--disable-validator S007"
extra_trimgalore_args = "--illumina --stringency 3 --length 30 --trim-n --nextseq 20"
// Quant-only to avoid STAR timeout
aligner = 'salmon'
// **Kill schema noise**
validate_params = false
igenomes_base = null
custom_config_base = null
custom_config_version = null
} Thanks for any suggestionMatthias Zepper
11/05/2025, 11:15 AMnextflow.log would be useful here.
Apart from that, I suggest you revisit your configuration, because you are e.g. mix and matching params by specifying some in your configuration and some as command line arguments to Nextflow.
Generally, I also advice against including environment variables into your params, because this means that the time and location when they are evaluated are incredibly important. Do they evaluate on the node or at the time when you launch Nextflow etc?
For example, you define the outdir parameter in the config as "/parallel_scratch/${System.getenv('USER')}/nfcore/rnaseq_S1/results" but then are setting the outdir param on the command line as $WORK_DIR/results , which overrides your config due to Nextflow’s config priority.
$WORK_DIR is set to $SCRATCH_BASE/nfcore/rnaseq_034_4 with $SCRATCH_BASE being /parallel_scratch/$USER etc. So for Nextflow to know where to store your data, it must evaluate several environment variables and this can fail easily.
Here it apparently worked, because you can see your trimming and FastQC results published to the correct directory, but it is just a confusing mix and match. I recommend to use a single -params-file for nextflow run , because it ensures the best reproducibility.Thomas Danhorn
11/06/2025, 8:15 PM--aligner salmon is valid. It should be either star_salmon (or leave it out, since that is the default anyway), or -- if you don't want alignment to the genome -- you can use --pseudo_aligner salmon.Matthias Zepper
11/06/2025, 8:40 PM