This repository is for running and testing nf-core RNA-seq workflows on Unity
HPC. It contains scripts, notes, and troubleshooting details from setting up
nf-core/demo and nf-core/rnaseq with Apptainer, Slurm, scratch workspaces,
and a custom Staurois parvus EGAPx genome.
This is not the polished tutorial website. It is the working/run repository.
The Unity scripts live in:
/home/kfloer_smith_edu/rnaseq_nf_core/scriptsCurrent scripts:
demo_nfcore.sh
nfcore-rnaseq-test.sh
test-nfcore-tadpole-genome.sh
The useful pattern is:
sbatch /home/kfloer_smith_edu/rnaseq_nf_core/scripts/<script-name>.shThe Slurm log files are written to:
/home/kfloer_smith_edu/rnaseq_nf_core/job-logsWe tested the setup in stages:
nf-core/demowith-profile test,unity.nf-core/rnaseqwith-profile test,unity.nf-core/rnaseqwith a custom EGAPx Staurois parvus genome and a small subset of real paired-end FASTQ files.
The successful approach was to run the Nextflow controller through sbatch on a
compute node instead of launching directly from the login node.
The working versions were:
module purge
module load nextflow/26.04.1
module load apptainer/latestNextflow may print that a newer version is available. That is just an update notice unless the run fails because of a version requirement.
Use Unity scratch workspaces for active runs:
ws_allocate rnaseq_real_test 30
ws_listFor the custom-genome test, the scratch workspace was:
/scratch/workspace/kfloer_smith_edu-rnaseq_real_testThe custom genome files were:
GENOME_FASTA=/scratch3/workspace/kfloer_smith_edu-simple/egapx_sparvus/output/complete.genomic.fna
GENOME_GTF=/scratch3/workspace/kfloer_smith_edu-simple/egapx_sparvus/output/complete.genomic.gtfThe test FASTQs were:
C45-1B_S2_L002
/work/pi_lmangiamele_smith_edu/03_26_flut_yale_rnaseq/C45-1B_S2_L002_R1_001.fastq.gz
/work/pi_lmangiamele_smith_edu/03_26_flut_yale_rnaseq/C45-1B_S2_L002_R2_001.fastq.gz
C45-1H_S1_L002
/work/pi_lmangiamele_smith_edu/03_26_flut_yale_rnaseq/C45-1H_S1_L002_R1_001.fastq.gz
/work/pi_lmangiamele_smith_edu/03_26_flut_yale_rnaseq/C45-1H_S1_L002_R2_001.fastq.gz
Inside each scratch workspace, the scripts create:
.apptainer/build-cache/ Apptainer OCI/blob cache
.apptainer/tmp/ Temporary directory for Apptainer and proot
.nextflow-apptainer-cache/ Final Nextflow container .img files
work/ Nextflow task work directories
results_*/ Pipeline outputs
samplesheets/ Generated samplesheets
These paths are set explicitly so container downloads and temporary files do not fill home or use fragile default temp directories.
The scripts should set:
export APPTAINER_CACHEDIR="$SCRATCH_RNASEQ/.apptainer/build-cache"
export APPTAINER_TMPDIR="$SCRATCH_RNASEQ/.apptainer/tmp"
export PROOT_TMP_DIR="$SCRATCH_RNASEQ/.apptainer/tmp"
export NXF_APPTAINER_CACHEDIR="$SCRATCH_RNASEQ/.nextflow-apptainer-cache"
export NXF_OPTS='-Xms1g -Xmx4g'
export PROOT_NO_SECCOMP=1Why they matter:
APPTAINER_CACHEDIR: stores container layers while Apptainer builds images.APPTAINER_TMPDIR: gives Apptainer a scratch temp directory.PROOT_TMP_DIR: prevents proot from using/tmp, which may be mountednoexec.NXF_APPTAINER_CACHEDIR: stores final.imgfiles for Nextflow reuse.NXF_OPTS: keeps the Nextflow Java controller small.PROOT_NO_SECCOMP=1: works around proot/kernel restrictions during image builds.
Passing boolean parameters directly on the command line caused nf-core schema validation errors:
Value is [string] but should be [boolean]
The robust fix was to write a JSON params file:
{
"igenomes_ignore": true,
"aligner": "star_salmon",
"pseudo_aligner": "salmon",
"skip_bbsplit": true,
"skip_markduplicates": true,
"skip_rseqc": true,
"skip_dupradar": true
}Then launch with:
nextflow run nf-core/rnaseq \
-r 3.26.0 \
-profile unity \
-params-file "$SCRATCH_RNASEQ/tadpole_params.json" \
-resumeSeveral failed container builds left behind bad .img files. The error looked
like:
not a valid squashfs image
The scripts clean these before launching:
find "$NXF_APPTAINER_CACHEDIR" -type f -name "*.pulling.*" -delete || true
find "$NXF_APPTAINER_CACHEDIR" -type f -name "*.img" | while read -r img; do
if ! apptainer inspect "$img" > /dev/null 2>&1; then
echo "Removing invalid container image: $img"
rm -f "$img"
fi
doneThis removes incomplete or invalid containers, but keeps completed Nextflow task outputs.
Some pulls failed with registry-side errors such as:
502 Bad Gateway
For these, resubmit the same script. -resume will reuse completed work once the
registry responds normally.
One Apptainer/proot failure said:
the current temporary directory (/tmp) is mounted with no execution permission
Please set PROOT_TMP_DIR env. variable to an alternate location
The fix is:
export PROOT_TMP_DIR="$SCRATCH_RNASEQ/.apptainer/tmp"This should be included in all Unity run scripts.
-resume does not fix errors by itself. It prevents completed tasks from being
rerun after the underlying problem is fixed.
Useful pattern:
- Read the error.
- Fix the cause, such as a corrupt container image or bad parameter.
- Resubmit the same script with
-resume.
Check your jobs:
squeue --meEstimate start times:
squeue --me --startInspect a job:
scontrol show job <JOBID>Follow logs:
tail -f /home/kfloer_smith_edu/rnaseq_nf_core/job-logs/<log-file>.out
tail -f /home/kfloer_smith_edu/rnaseq_nf_core/job-logs/<log-file>.errFor a fresh setup, use this order:
- Run
demo_nfcore.sh. - Run
nfcore-rnaseq-test.sh. - Run
test-nfcore-tadpole-genome.shon the small real-data subset. - Scale up to all samples only after the custom-genome subset succeeds.
This keeps failures easier to diagnose.