Please help me understand this bug. I am running t...
# variantprioritization
v
Please help me understand this bug. I am running the dev branch, but it happens with the 1.0.0 release as well. The vcf file was produced by mutect2 running in sarek.
Copy code
ERROR ~ Error executing process > 'NFCORE_VARIANTPRIORITIZATION:VARIANTPRIORITIZATION:PREPARE_SOMATIC:PCGR_PREPAREVCF (RevvityOncoSpan-HD827-50ng-Rep1:RevvityOncoSpan-HD827-50ng-Rep1)'

Caused by:
  Process `NFCORE_VARIANTPRIORITIZATION:VARIANTPRIORITIZATION:PREPARE_SOMATIC:PCGR_PREPAREVCF (RevvityOncoSpan-HD827-50ng-Rep1:RevvityOncoSpan-HD827-50ng-Rep1)` terminated with an error exit status (1)
  pcgr_vcf.py \
      --sample RevvityOncoSpan-HD827-50ng-Rep1.RevvityOncoSpan-HD827-50ng-Rep1 \
      --keys RevvityOncoSpan-HD827-50ng-Rep1.RevvityOncoSpan-HD827-50ng-Rep1_keys.txt \
      --vcf-dir inputs/         --tbi-dir inputs/         --pcgr-header pcgr_header.txt

Command exit status:
  1

Command output:
  (empty)

Command error:
  Traceback (most recent call last):
    File "/home/athena/.nextflow/assets/nf-core/variantprioritization/bin/pcgr_vcf.py", line 489, in <module>
      main()
    File "/home/athena/.nextflow/assets/nf-core/variantprioritization/bin/pcgr_vcf.py", line 485, in main
      pcgr_ready_vcf(args.sample, args.keys, vcf_files, args.pcgr_header)
    File "/home/athena/.nextflow/assets/nf-core/variantprioritization/bin/pcgr_vcf.py", line 373, in pcgr_ready_vcf
      tumor_only(sample_id, key_file, vcf_files, pcgr_header)
  TypeError: tumor_only() missing 1 required positional argument: 'pcgr_header'
f
Can you share your samplesheet? And maybe the VCF file?
How do you run the pipeline? 🙂
It seems that the path to the pcgr_header file is not correctly resolved
Can you check whether this file
pcgr_header.txt
is available in the workdir?
v
Sure.
Copy code
/work/08/c333af0d93e816f1fb654c2ef17396$ l
total 14K
lrwxrwxrwx 1 athena athena  79 Jun  3 10:52 pcgr_header.txt -> /home/athena/.nextflow/assets/nf-core/variantprioritization/bin/pcgr_header.txt
I catted the file and it had vcf header content. I can't post the whole sample sheet, but here are the relevant lines:
Copy code
patient,status,sample,vcf,cna
RevvityOncoSpan-HD827-50ng-Rep1,1,RevvityOncoSpan-HD827-50ng-Rep1,../results/variant_calling/mutect2/RevvityOncoSpan-HD827-50ng-Rep1/RevvityOncoSpan-HD827-50ng-Rep1.mutect2.filtered.vcf.gz,
This is how I ran it
nextflow run nf-core/variantprioritization -r dev -resume -profile singularity -params-file params.yaml
params-file:
Copy code
# Input / Output
input: './vp_samplesheet.csv'
outdir: './results_prioritised'

# Reference Genome
genome: 'GRCh38'
f
Ok let me try to reproduce the error. You just used one mutect vcf, right?
v
For that sample, yes
f
Which nextflow version are you using?
v
25.10.4
f
Ok I am not able to reproduce this error. Can you give me more context where you are running the pipeline? What happens if you try to run it again with
-resume
? What happens if you try to tun only this sample?
v
I am no python expert, but could it be related to how the arguments are passed in
pcgr_vcf.py
. Specifically
Copy code
def tumor_only(sample_id, key_file, vcf_files, tbi_files, pcgr_header):
accepts 5 arguments. Later:
Copy code
def pcgr_ready_vcf(sample_id, key_file, vcf_files, pcgr_header):
    with VariantFile(vcf_files[0]) as fr:
        header = fr.header
        info = list(<http://header.info|header.info>)
        if "NAF" in info:
            tumor_normal(sample_id, key_file, vcf_files, pcgr_header)
        else:
            tumor_only(sample_id, key_file, vcf_files, pcgr_header)
passes 4 arguments, skipping the
tbi_files
. Hence,
tumor_only()
receives the header file as the
tbi_files
. This can't be the cause, as I am sure your tests would have caught it.
👀 1
f
However when I use your naming I run into the following error later on:
Copy code
Command output:
  2026-06-03 11:25:53 - pcgr-validate-arguments-input-a - ERROR -
  2026-06-03 11:25:53 - pcgr-validate-arguments-input-a - ERROR - Sample name identifier ('--sample_id' = RevvityOncoSpan-HD827-50ng-Rep1.RevvityOncoSpan-HD827-50ng-Rep1) must be between 3 and 40 characters long, current length is 63
  2026-06-03 11:25:53 - pcgr-validate-arguments-input-a - ERROR -

Command error:
  INFO:    Environment variable SINGULARITYENV_NXF_TASK_WORKDIR is set, but APPTAINERENV_NXF_TASK_WORKDIR is preferred
  INFO:    Environment variable SINGULARITYENV_NXF_DEBUG is set, but APPTAINERENV_NXF_DEBUG is preferred
  2026-06-03 11:25:53 - pcgr-validate-arguments-input-a - ERROR -
  2026-06-03 11:25:53 - pcgr-validate-arguments-input-a - ERROR - Sample name identifier ('--sample_id' = RevvityOncoSpan-HD827-50ng-Rep1.RevvityOncoSpan-HD827-50ng-Rep1) must be between 3 and 40 characters long, current length is 63
  2026-06-03 11:25:53 - pcgr-validate-arguments-input-a - ERROR -
(so just as a heads up - we probably need to add this to the validation to catch it earlier)
v
Ah yes.. I'll fix that too
f
This can't be the cause, as I am sure your tests would have caught it.
Maybe our tests are incomplete but I am confused as to why I cannot reproduce your error.
v
I am testing this fix:
Copy code
def pcgr_ready_vcf(sample_id, key_file, vcf_files, tbi_files, pcgr_header):
    with VariantFile(vcf_files[0]) as fr:
        header = fr.header
        info = list(<http://header.info|header.info>)
        if "NAF" in info:
            tumor_normal(sample_id, key_file, vcf_files,pcgr_header)
        else:
            tumor_only(sample_id, key_file, vcf_files, tbi_files, pcgr_header)
But I suspect it will run into a bug when it runs into a tumor_normal sample. However, I don't have a one of this in this sheet.
f
But I think you spotted the error, can you open a bug report? Then we will fix it!
Thank you!
Ok I think I cannot reproduce because I have a tumor-normal VCF
v
I'll PM you the VCF. Testing the fix now
Ran into a related error:
Copy code
Caused by:
  Process `NFCORE_VARIANTPRIORITIZATION:VARIANTPRIORITIZATION:PREPARE_SOMATIC:PCGR_PREPAREVCF (TC-51-M1-4T:TC-51-M1-4T)` terminated with an error exit status (1)


Command executed:

  pcgr_vcf.py \
      --sample TC-51-M1-4T.TC-51-M1-4T \
      --keys TC-51-M1-4T.TC-51-M1-4T_keys.txt \
      --vcf-dir inputs/         --tbi-dir inputs/         --pcgr-header pcgr_header.txt

Command exit status:
  1

Command output:
  (empty)

Command error:
  Traceback (most recent call last):
    File "/athstore/CGP_tests/variantprior/variantprioritization/bin/pcgr_vcf.py", line 490, in <module>
      main()
    File "/athstore/CGP_tests/variantprior/variantprioritization/bin/pcgr_vcf.py", line 486, in main
      pcgr_ready_vcf(args.sample, args.keys, vcf_files, args.pcgr_header)
  TypeError: pcgr_ready_vcf() missing 1 required positional argument: 'pcgr_header'

Work dir:
  /athstore/CGP_tests/variantprior/work/ba/aa3c33fb2e52b413c40e790b572a96
Fixed it by modifying
pcgr_vcf.py
pcgr_ready_vcf(args.sample, args.keys, vcf_files, args.pcgr_header)
changed to
pcgr_ready_vcf(args.sample, args.keys, vcf_files, tbi_files, args.pcgr_header)
Which makes sense. Would it be crazy to refactor all of the functions to use named arguments instead of positional?
f
No I think that would be the best way forward!
😃 1