Hi there, I ran sarek with `test_full` few days a...
# nostupidquestions
r
Hi there, I ran sarek with
test_full
few days ago and it worked perfectly:
nextflow run nf-core/sarek -r 3.8.1 -profile singularity,test_full --outdir /mnt/HDD2/sarek_test/output/ -resume
Copy code
[...]
-[nf-core/sarek] Pipeline completed successfully-

Completed at: 13-Feb-2026 21:58:44
Duration    : 4h 52m 59s
CPU hours   : 96.3 (42,1% cached)
Succeeded   : 214
Cached      : 48
Then I tried to run it with our data by starting with one patient with paired-end fastq files (already demultiplexed and merged). I recycled the
base.config
found in your git and add the
umi_read_structure
and
umi_in_read_header
to force fgbio step. However I am stuck at
bwa-mem
step (which was not the case without UMI information):
nextflow run nf-core/sarek -profile singularity --input /mnt/HDD2/sarek_inhouse/samplesheet_mapping_NGShem.csv --outdir /mnt/HDD2/sarek_inhouse/2026-02-04_SRP_NGShem/ -c /mnt/HDD2/sarek_inhouse/base.config -r 3.8.0
Copy code
[...]
Execution cancelled -- Finishing pending tasks before exit
-[nf-core/sarek] Pipeline completed with errors-
ERROR ~ Error executing process > 'NFCORE_SAREK: SAREK :FASTQ_PREPROCESS_GATK:FASTQ_CREATE_UMI_CONSENSUS_FGBIO:ALIGN_UMI:BWAMEM1_MEM (C2508328-star-lane_1)'

Caused by:
  No signature of method: nextflow.processor.TaskPath.get() is applicable for argument types: (Integer) values: [0]
  Possible solutions: getAt(int), grep(), getAt(java.lang.String), grep(java.lang.Object), head(int), wait() -- Check script '/home/localadmin/.nextflow/assets/nf-core/sarek/modules/nf-core/bwa/mem/main.nf' at line: 29

Source block:
  def args = task.ext.args ?: ''
  def args2 = task.ext.args2 ?: ''
  def prefix = task.ext.prefix ?: "${meta.id}"
  def samtools_command = sort_bam ? 'sort' : 'view'
  def extension = args2.contains("--output-fmt sam")   ? "sam" :
                  args2.contains("--output-fmt cram")  ? "cram":
                  sort_bam && args2.contains("-O cram")? "cram":
                  !sort_bam && args2.contains("-C")    ? "cram":
                  "bam"
  def reference = fasta && extension=="cram"  ? "--reference ${fasta}" : ""
  if (!fasta && extension=="cram") error "Fasta reference is required for CRAM output"
  """
  INDEX=`find -L ./ -name "*.amb" | sed 's/\\.amb\$//'`
  
  bwa mem \\
      $args \\
      -t $task.cpus \\
      \$INDEX \\
      $reads \\
      | samtools $samtools_command $args2 ${reference} --threads $task.cpus -o ${prefix}.${extension} -
  
  cat <<-END_VERSIONS > versions.yml
  "${task.process}":
      bwa: \$(echo \$(bwa 2>&1) | sed 's/^.*Version: //; s/Contact:.*\$//')
      samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//')
  END_VERSIONS
  """

Container:
  /mnt/HDD2/sarek_inhouse/work/singularity/community-cr-prod.seqera.io-docker-registry-v2-blobs-sha256-bf-bf7890f8d4e38a7586581cb7fa13401b7af1582f21d94eef969df4cea852b6da-data.img

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`

 -- Check '.nextflow.log' file for details
ERROR ~ Pipeline failed. Please refer to troubleshooting docs: <https://nf-co.re/docs/usage/troubleshooting>

 -- Check '.nextflow.log' file for details
WARN: Failed to render execution report -- see the log file for details
WARN: Failed to render execution timeline -- see the log file for details
If I understand well the error is due to an non-existent prefix value:
~/.nextflow/assets/nf-core/sarek/modules/nf-core/bwa/mem/main.nf
def prefix = task.ext.prefix ?: "${meta.id}"
Do you know how to define prefix? I thought it was taken from the patient +/- combination lane from the sample sheet. I tried to force a value on
-c .config
file under
params
or
process
but as I am a beginner on nextflow I may miss something. Here the sample sheet:
cat samplesheet_mapping_NGShem.csv
Copy code
patient,sex,status,sample,lane,fastq_1,fastq_2
C2508328-star,NA,1,C2508328-star,lane_1,/mnt/SHARE_NGSDATA/IPA_NHE/260204_VH01811_146_AAHJLJCM5/Analysis/1/Data/fastq/C2508328-star_S1_R1_001.fastq.gz,/mnt/SHARE_NGSDATA/IPA_NHE/260204_VH01811_146_AAHJLJCM5/Analysis/1/Data/fastq/C2508328-star_S1_R2_001.fastq.gz
I also joined the log file and base.config. The nextflow version used is 25.10.3 and the sarek version used is 3.8.0. I tried to find this error on slack search bar but I was not able to found something similar. Hope you have enough information to give me some hints. Thanks for your time and help. Best, Vimel
m
The offending line is
def prefix = task.ext.prefix ?: "${meta.id}"
. The ID is generated from the sample sheet, so I recommend checking your sample names. It may be that
C2508328-star-lane_1
doesn’t work as prefix due to the underscore or hyphens? In case that didn’t help, mind that there is a dedicated channel #CGFUX04HZ for pipeline-specific questions. Lastly, mind that you are running 3.8.0 now and did run 3.8.1 for the test, so that is not entirely the same pipeline.
👍🏾 1
r
Hi Matthias, thanks for your fast reply. I will give a try without "-". I already give a try with LANE instead of lane_1 but did not work. I will rename
C2508328-star
to
C2508328star
. Thanks! However the prefix exists when I check the command:
singularity run --bind /mnt/HDD2/sarek_inhouse/ /mnt/HDD2/sarek_inhouse/work/singularity/community-cr-prod.seqera.io-docker-registry-v2-blobs-sha256-bf-bf7890f8d4e38a7586581cb7fa13401b7af1582f21d94eef969df4cea852b6da-data.img
Copy code
Singularity> cd /mnt/HDD2/sarek_inhouse/work/b0/44a5b97d596779ab2b496505aca785/
Singularity> cat .command.sh
#!/bin/bash -euo pipefail
samtools \
    bam2fq \
    -T RX \
    -@ 2 \
    C2508328-star-lane_1.bam | gzip --no-name > C2508328-star-lane_1_interleaved.fq.gz

cat <<-END_VERSIONS > versions.yml
"NFCORE_SAREK:sarek:FASTQ_PREPROCESS_GATK:FASTQ_CREATE_UMI_CONSENSUS_FGBIO:BAM2FASTQ":
    samtools: $(echo $(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*$//')
END_VERSIONS
It is my first post, good to know for #CGFUX04HZ channel I will post on it if I am still stuck! Best, Vimel
m
🤔 You are right, I probably deceived you here with some irrelevant suggestion. Sorry. The rationale was that the prefix in this module is outputted without quotes, so the CLI argument parser of
bwa mem
or
samtools
might happily mistake part of your ID it for another command line argument and parse it as
-o C2508328 -s tar -l ane_1.bam
or the like:
Copy code
bwa mem \\
      $args \\
      -t $task.cpus \\
      \$INDEX \\
      $reads \\
      | samtools $samtools_command $args2 ${reference} --threads $task.cpus -o ${prefix}.${extension} -
Just a shot into the dark though, so best to ask in #CGFUX04HZ.
r
Thanks Matthias! Your first clue was also a good one to try. I will post my problem on the correct channel. Thanks again.
s
Don't use a config file to pass parameters, use a params.json file if you want to do that.
👍🏾 1
r
I will try that thanks.
s
That may be part of the issue. The other question, is where did you get that base.config that you've modified? It contains e.g.
max_cpus
that hasn't been in sarek for some time
put your configuration settings (like using singularity) into a config, your parameters into a parameter file (or pass via the command line)
r
s
uhh, almost nothing is in common between that file and the one you used?
Ok, I see, it looks like that file is pretty much in forks of sarek that are ~7 years old https://github.com/search?q=wf_repository+%3D+%27maxulysse%27&amp;type=code
Basically don't try and use that file at all, it is very out of date. You shouldn't need to add anything to the base.config, just add any specific config bits for things you need, put the params in a json (or command line) and try 3.8.1