Skip to content

Multiple issues: config parsing errors, script variable undefined, and OOM in create_kmers_database #1

Description

@txfc

I encountered a series of problems when trying to run RFHap on my trio dataset (paternal/maternal Illumina short reads, child ont long reads). After resolving initial configuration and script syntax errors, the pipeline still fails at the create_kmers_database step due to kmc_tools subtract being killed by the OOM killer. Below I detail each issue and the workarounds I applied, hoping for improvements in the pipeline.

Environment

Nextflow version: 26.04.3

Singularity version: (latest)

Resource: 256 CPU cores, 1000 GB RAM (but create_kmers_database still OOM with default settings)

Steps to reproduce

Clone RFHap repository.

Prepare input text files (paternal.txt, maternal.txt, child.txt) each containing a CSV header path and one line with the file path.

Run the pipeline with:

nextflow run rfhap.nf --paternal_reads paternal.txt --maternal_reads maternal.txt --child_reads child.txt --num_cases 400000 --outdir results -profile local

Issue 1: Nextflow config parsing error

The provided nextflow.config contained a line:

groovy
def trace_timestamp = new java.util.Date().format( 'yyyy-MM-dd_HH-mm-ss' )
Inside a configuration block, using def is not allowed and leads to:

text
Variable declarations cannot be mixed with config statements
Workaround: I changed it to:

groovy
trace_timestamp = new java.util.Date().format( 'yyyy-MM-dd_HH-mm-ss' )
and added params.trace_timestamp = ... where needed. This allowed the config to be parsed.

Issue 2: Script variable undefined in rfhap.nf

Two variables were not defined, causing compilation errors:

In help_function(): help was assigned without def.

In process predictRF: filename was used inside the script but never defined.

Error messages:

text

Error rfhap.nf:7:5: `help` was assigned but not declared
Error rfhap.nf:208:13: `filename` is not defined
Workaround: I added def to help inside the function and defined def filename = matrix.baseName at the beginning of the script block in predictRF. After these changes the pipeline started.

Issue 3: OOM in create_kmers_database (kmc_tools subtract killed)

After fixing the above, the pipeline ran for ~2 days and then failed at the create_kmers_database step. The error log shows:

Launching `rfhap/rfhap.nf` [loving_allen] revision: 5f660f3037

executor >  local (4)
[66/dfa18d] create_kmers_database (2) | 0 of 4
[-        ] print_paths               -
[-        ] sort_kmer_db              -
[-        ] FastKM                    -
[-        ] trainRF                   -
[-        ] predictRF                 -
[-        ] setHaplotypes             -
[-        ] seqtk                     -
WARN: Killing running tasks (3)
ERROR ~ Error executing process > 'create_kmers_database (4)'

Caused by:
  Process `create_kmers_database (4)` terminated with an error exit status (1)


Command executed:

  mkdir uk33                                                                                                     /home/duanying/refgenome_assembly/rfhap/aux_scripts/find_unique_kmers.py -k33 -p  100 -o uk33 --path-to-kmc kmc B685_1_merge.fq.gz,B685_2_merge.fq.gz B54_1_merge.fq.gz,B54_2_merge.fq.gz > uk33/uk33.log.txt 2> uk33/uk33.err.txt

Command exit status:
  1

Command output:
  (empty)

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

Work dir:
  /home/duanying/refgenome_assembly/work/f7/7938811751e1519fb91516395cd89e

Container:                                                                                                       /home/duanying/refgenome_assembly/work/singularity/community.wave.seqera.io-library-kmc_mappy_seqtk_r-caret_pruned-46de1e7eb6bf9c6d.img
                                                                                                               Tip: view the complete command output by changing to the process work dir and entering the command `cat .command.out`

 -- 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

Thank you for your work on RFHap!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions