Hey Everyone, Again, a problem I’ve once come acr...
# rnasplice
m
Hey Everyone, Again, a problem I’ve once come across when running
nf-core/rnasplice
. Hopefully, this,
featureCounts
and
MISO_SASHIMI
are the last ones. The error message is this:
Copy code
Error executing process > 'NFCORE_RNASPLICE:RNASPLICE:RMATS:CREATE_BAMLIST_SINGLE (1)'

Caused by:
 No such variable: bam -- Check script '/home/tud03125/.nextflow/assets/nf-core/rnasplice/./workflows/../subworkflows/local/../../modules/local/create_bamlist_single.nf' at line: 20


Source block:
 """
 echo $bam | sed 's: :,:g' > ${cond}_bamlist.txt
 
 cat <<-END_VERSIONS > versions.yml
 "${task.process}":
     sed: \$(echo \$(sed --version 2>&1) | sed 's/^.*GNU sed) //; s/ .*\$//')
 END_VERSIONS
 """

Tip: you can try to figure out what's wrong by changing to the process work dir and showing the script file named `.command.sh`
Anyone had “CREATE_BAMLIST_SINGLE” or “No such variable: bam” issue before? Maybe, some GitHub references to this? Just in case, here’s my PBS script:
Copy code
#!/bin/bash
#PBS -N rnasplice_pipeline
#PBS -l nodes=1:ppn=16
#PBS -l mem=128gb
#PBS -l walltime=168:00:00 # Set to 168 hours
#PBS -o /home/tud03125/pipeline/normal_human_liver_rnasplice/$PBS_JOBID.out
#PBS -e /home/tud03125/pipeline/normal_human_liver_rnasplice/$PBS_JOBID.err
#PBS -M <mailto:michael.levin@temple.edu|michael.levin@temple.edu>
#PBS -m abe # 'a' for abort, 'b' for begin, 'e' for end

# Debugging: Print environment information
echo "Job started on $(date)"
echo "Running on $(hostname)"
echo "Current directory: $(pwd)"

# Output directory
OUTPUT_DIR="/home/tud03125/pipeline/normal_human_liver_rnasplice"

# Create the output directory if it doesn't exist
mkdir -p "$OUTPUT_DIR"

# Load necessary modules
module load gcc/11.2.0
module load singularity
module load python/3.10.2 # Load Python 3.10.2

# Create an alias for python to point to python3
alias python=python3

# Check that the alias works
python --version # Should output Python 3.10.2

# Set Nextflow version
export NXF_VER=24.04.4

# Install Nextflow if not already installed
if [ ! -f ./nextflow ]; then
   echo "Nextflow not found, downloading..."
   curl -s <https://get.nextflow.io> | bash
   chmod +x nextflow
fi

# Set Nextflow work directory to avoid quota issues
export NXF_WORK=/home/tud03125/pipeline/normal_human_liver_rnasplice/work

# Run Nextflow with your local rnasplice pipeline
echo "Starting Nextflow pipeline..."
./nextflow run /home/tud03125/pipeline/rnasplice -resume -profile singularity \
   --input /home/tud03125/pipeline/normal_human_liver_design_rnasplice_3.csv \
   --fasta /home/tud03125/pipeline/Homo_sapiens.GRCh38.dna_sm.primary_assembly.fa \
   --gtf /home/tud03125/pipeline/Homo_sapiens.GRCh38.108.gtf \
   --save_reference \
   --outdir /home/tud03125/pipeline/normal_human_liver_rnasplice \
   --star_index /home/tud03125/STAR_index \
   --salmon_index /home/tud03125/new_salmon_index \
   --rmats \
   --suppa \
   --ribo_database_manifest /home/tud03125/ribo_database_manifest.txt \
   --contrasts /home/tud03125/pipeline/contrast_NORMAL_2.csv

# Debugging: Print completion message and end timestamp
echo "Processing complete."
echo "Job ended on $(date)"
And for reference, this is the
<http://create_bamlist_single.nf|create_bamlist_single.nf>
script that’s involved here:
Copy code
process CREATE_BAMLIST_SINGLE {
   label 'process_single'

   conda "conda-forge::sed=4.7.0"
   container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
       '<https://depot.galaxyproject.org/singularity/sed:4.7.0>' :
       'biocontainers/sed:4.7.0' }"

   input:
   tuple val(contrast), val(cond1), path(bam1)

   output:
   tuple val(contrast), path("${cond}_bamlist.txt"), emit: bamlist
   path "versions.yml",  emit: versions

   when:
   task.ext.when == null || task.ext.when

   script:
   """
   echo $bam | sed 's: :,:g' > ${cond}_bamlist.txt

   cat <<-END_VERSIONS > versions.yml
   "${task.process}":
       sed: \$(echo \$(sed --version 2>&1) | sed 's/^.*GNU sed) //; s/ .*\$//')
   END_VERSIONS
   """
}
*When investigating what's going on, one of the things I did was 1)
cd
to the
work
directory, and then 2) execute this command:
find . -name ".command.sh" -exec grep -H "bam" {} \;
. From there, ChatGPT gave me this suggestion: • Based on the results of your find command, it looks like there are several
.command.sh
files that reference BAM files, but none of them directly use the bam variable as shown in your
<http://create_bamlist_single.nf|create_bamlist_single.nf>
script. This suggests that the bam variable might not be getting passed correctly into the process. • And, one of the possible solutions: Check the Input Definition: The
<http://create_bamlist_single.nf|create_bamlist_single.nf>
script expects a tuple with
val(contrast)
,
val(cond1)
, and
path(bam1)
as input. However, in the script, the variable
bam
is being used instead of
bam1
. If the input is indeed provided as
bam1
, you should modify the script to use
bam1
instead of
bam
. When I used that suggestion,
bam
->
bam1
and
cond
->
cond1
, that fixed the problem. But, I was told that modifying configuration or
.nf
scripts is not good. So, I want to hear your inputs on it, on what's the better way to do it.
t
As you correctly diagnosed, it's using
bam1
as input and
bam
in the script (same with
cond
). This is almost certainly a bug introduced sometime last year. Please file an issue on GitHub. Interestingly somehow this didn't bite me when I used the pipeline (likely also the reason it went undetected until now), so this process is only executed under certain circumstances.
👍 1
Your choices are to run with your fix (for now) or wait for a new release, or to find some parameter setting that does not use this process.
👍 1
m
Awesome advices!