I'm trying to run HaploView 4.2 on one chromosome of a genome in order to compute haplotype blocks. The chromosome is approx 600Mbp and I'm looking at about 6k markers and 400 samples. Looking at the marker data it is clear that some of the blocks should be in the >200Mbp range, meaning that I do not want HaploView to limit itself to the default 500kb window used. Using the standard window or a subset of markers I'm able to successfully generate blocks, but using the full chromosome as window with all markers I end up with various java errors. Most recently this is what I get:
java -jar /tmp/Haploview.jar -memory 2000 -nogui -pedfile plink.ped -info plink.info -out outfile -check -blockoutput SPI -skipcheck -maxdistance 0
************************************
Haploview 4.2 Java Version: 17.0.20
*****************************************************
Arguments: -nogui -pedfile plink.ped -info plink.info -out outfile -check -blockoutput SPI -skipcheck -maxdistance 0
Skipping genotype file check
Max LD comparison distance = 0kb
Using data file: plink.ped
Using output fileroot: outfile
Using marker information file: plink.info
File outfile.CHECK already exists and will be overwritten.
Writing output to outfile.CHECK
Fatal Error:
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
Attempting to increase the memory further I get an overflow error:
java -jar /tmp/Haploview.jar -memory 4000 -nogui -pedfile plink.ped -info plink.info -out outfile -check -blockoutput SPI -skipcheck -maxdistance 0
*************************************
Haploview 4.2 Java Version: 17.0.20
*****************************************************
Arguments: -nogui -pedfile plink.ped -info plink.info -out outfile -check -blockoutput SPI -skipcheck -maxdistance 0
Skipping genotype file check
Max LD comparison distance = 0kb
Using data file: plink.ped
Using output fileroot: outfile
Using marker information file: plink.info
File outfile.CHECK already exists and will be overwritten.
Writing output to outfile.CHECK
Writing output to outfile.SPINEblocks
Exception in thread "main" java.lang.NegativeArraySizeException: -1710227456
at edu.mit.wi.haploview.EM.create_super_haplos(EM.java:1155)
at edu.mit.wi.haploview.EM.full_em_breakup(EM.java:569)
at edu.mit.wi.haploview.EM.doEM(EM.java:407)
at edu.mit.wi.haploview.HaploData.generateHaplotypes(HaploData.java:1002)
at edu.mit.wi.haploview.HaploData.generateBlockHaplotypes(HaploData.java:909)
at edu.mit.wi.haploview.HaploText.processFile(HaploText.java:1626)
at edu.mit.wi.haploview.HaploText.processTextOnly(HaploText.java:1369)
at edu.mit.wi.haploview.HaploText.<init>(HaploText.java:245)
at edu.mit.wi.haploview.HaploView.main(HaploView.java:1600)
I've seen speculation online that this is a matter of some 32 bit memory limitation, but I also see people saying that java jars aren't limited in this way. Looking at the code resulting the the NegativeArraySizeException it seems like an int is overflowing - simply changing it to a long does not work as it is being used to index an array, and apparently java doesn't accept long indexes.
One way of solving this is accepting that this is a limitation of HaploView and using a smaller number of markers, maybe even running multiple iterations of different marker sets and attempting to merge these in some way. What other solutions do y'all propose?
haplotype
blocks
java
haploview