Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] does not accept proper pairix format #13

Open
esrice opened this issue Jul 15, 2024 · 0 comments
Open

[BUG] does not accept proper pairix format #13

esrice opened this issue Jul 15, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@esrice
Copy link

esrice commented Jul 15, 2024

Describe the bug
When giving pre a file in pairix format, it fails to parse the file and throws an exception. To make it accept pairix format, you have to remove some header lines that it does not expect, despite these header lines being officially part of the pairix specification.

To Reproduce
Steps to reproduce the behavior:

  1. Find a valid pairix format file, containing header lines starting with ## pairs, #shape, #chromsize, and #columns, as specified in https://github.com/4dn-dcic/pairix/blob/master/pairs_format_specification.md
  2. Run hic_tools pre with this file as input:
java -Xmx36G -jar /path/to/hic_tools.jar pairix_file.pairs outfile.hic chrom.sizes

This results in the following error:

java.lang.ArrayIndexOutOfBoundsException: 3
        at hic.tools.utils.iterators.mnd.ComplexLineParser.generateBasicPair(ComplexLineParser.java:56)
        at hic.tools.utils.iterators.mnd.MNDFileParser.parseDCICFormat(MNDFileParser.java:118)
        at hic.tools.utils.iterators.mnd.MNDFileParser.parse(MNDFileParser.java:83)
        at hic.tools.utils.iterators.mnd.GenericPairIterator.advance(GenericPairIterator.java:56)
        at hic.tools.utils.iterators.mnd.GenericPairIterator.next(GenericPairIterator.java:46)
        at hic.tools.utils.original.Preprocessor.computeWholeGenomeMatrix(Preprocessor.java:88)
        at hic.tools.utils.original.Preprocessor.writeBody(Preprocessor.java:114)
        at hic.tools.utils.original.Preprocessor.preprocess(Preprocessor.java:54)
        at hic.tools.clt.old.PreProcessing.run(PreProcessing.java:149)
        at hic.tools.HiCTools.main(HiCTools.java:83)

It appears to be trying to parse one of the header lines as if it is not a header line. To fix, I removed all header lines except those starting with ## pairs and #columns and it worked fine.

Expected behavior
The program should not crash on validly-formatted pairix format input.

@esrice esrice added the bug Something isn't working label Jul 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant