A bug was introduced in MACS 1.4, which arises if many of the initial reads in an input SAM file are unaligned. You are having this error if MACS is printing something like the following to stderr:
Traceback (most recent call last):
File "python/bin/macs14", line 354, in
File "python/bin/macs14", line 59, in main
(treat, control) = load_tag_files_options (options)
File "python/bin/macs14", line 323, in load_tag_files_options
ttsize = tp.tsize()
File "lib/python2.6/site-packages/MACS14/IO/Parser.py", line 655, in tsize
ZeroDivisionError: integer division or modulo by zero
Here’s a patch to fix the problem. You can download the patch to any location. Apply the patch by cd’ing to the directory lib/IO within the MACS source code. Then do
patch < path/to/macs14_Parser.patch.txt
and proceed to install MACS as normal.
Many thanks to David Cittaro, who provided this fix on the MACS mailing list. However, the diff given there is the wrong way around---with the old and new files swapped---so that cannot be used as the patch.