Skip to content

[BUG] Pre crashing due to ArrayIndexOutOfBoundsException at ComplexLineParser stage #1049

Description

@callumjethomas

Describe the bug
juicer_tools pre crashes when it gets to the "writing body" stage due to ArrayIndexOutOfBoundsException while parsing the input file.

To Reproduce
Command:
juicer_tools pre Genome_hap1.scaff_seqs.gz_vs_OmniC.pairs Genome_hap1.scaff_seqs.gz_vs_OmniC.hic chrom.sizes

The pairs file follows the format specified here:

## pairs format v1.0.0
#shape: upper triangle
#chromsize: scaffold_1 124542424
...
#chromsize: scaffold_241 11760
#columns: readID chrom1 pos1 chrom2 pos2 strand1 strand2 pair_type
lh00134:465:22C7F2LT4:6:1433:3517:23034 scaffold_1      72639   scaffold_1      72836   +       -       UU

The chrom.sizes file is a TSV listing each chromosome name and its length:

scaffold_1      124542424
scaffold_2      67981327
...
scaffold_240    12095
scaffold_241    11760

Error message

WARNING: sun.reflect.Reflection.getCallerClass is not supported. This will impact performance.
WARN [2026-05-05T08:47:03,210]  [Globals.java:138] [main]  Development mode is enabled
Using 1 CPU thread(s) for primary task
Using 10 CPU thread(s) for secondary task
Not including fragment map
Start preprocess
Writing header
Writing body
java.lang.ArrayIndexOutOfBoundsException: Index 3 out of bounds for length 3
        at juicebox.tools.utils.original.mnditerator.ComplexLineParser.generateBasicPair(ComplexLineParser.java:56)
        at juicebox.tools.utils.original.mnditerator.MNDFileParser.parseDCICFormat(MNDFileParser.java:118)
        at juicebox.tools.utils.original.mnditerator.MNDFileParser.parse(MNDFileParser.java:83)
        at juicebox.tools.utils.original.mnditerator.GenericPairIterator.advance(GenericPairIterator.java:56)
        at juicebox.tools.utils.original.mnditerator.GenericPairIterator.next(GenericPairIterator.java:46)
        at juicebox.tools.utils.original.Preprocessor.computeWholeGenomeMatrix(Preprocessor.java:603)
        at juicebox.tools.utils.original.Preprocessor.writeBody(Preprocessor.java:690)
        at juicebox.tools.utils.original.Preprocessor.preprocess(Preprocessor.java:452)
        at juicebox.tools.clt.old.PreProcessing.run(PreProcessing.java:176)
        at juicebox.tools.HiCTools.main(HiCTools.java:97)

Expected behavior
Complete pre run to produce a .hic file.

Versions:

  • Juicer tools version 2.20.00 (conda)
  • OS: Rocky Linux release 8.10 (Green Obsidian)

Metadata

Metadata

Assignees

No one assigned

    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