Mega2: *** buffer overflow detected ***: mega2 terminated

12 views
Skip to first unread message

Dan Weeks

unread,
Jul 1, 2021, 7:19:25 AM7/1/21
to Mega2
Bug: When attempting to convert from a VCF containing 7 million variants across the chromosomes, Mega2 crashes with a "*** buffer overflow detected ***: mega2 terminated" error.

Possible solution:  
While we should make Mega2 more robust to this, it may take quite a while to find and squash this bug.

Someone else ran into a similar problem last week, and we first explored if it was a problem of variant names being too long (which used to be a bug in Mega2 but my documentation says that we have fixed that).  Still shorting the variant names may be needed. 

But I suspect the solution is the following:

As Merlin analyzed data on a per chromosome basis, you should split by chromosome, and see if that works.

Also, if you are doing linkage analysis with Merlin, one probably wouldn't use all the markers but rather would do some linkage-disequilibrium-based pruning first to get a much reduced set of markers.  That's because Merlin's default algorithm assumes the markers are in linkage equilibrium with each other, and the presence of linkage disequilibrium (LD) between closely spaced SNP markers can falsely inflate linkage statistics.  

See

Webb EL, Sellick GS, Houlston RS. SNPLINK: multipoint linkage analysis of densely distributed SNP data incorporating automated linkage disequilibrium removal. Bioinformatics. 2005 Jul 1;21(13):3060-1. doi: 10.1093/bioinformatics/bti449. Epub 2005 Apr 19. PMID: 15840706.

If splitting by chromosome and doing LD pruning to markedly reduce the number of variants solves your problem with Mega2, please let me know.
Reply all
Reply to author
Forward
0 new messages