View on GitHub


MACS -- Model-based Analysis of ChIP-Seq

MACS: Model-based Analysis for ChIP-Seq

Status License Programming languages CI x64 CI non x64 CI MacOS 12


Latest Release:


With the improvement of sequencing techniques, chromatin immunoprecipitation followed by high throughput sequencing (ChIP-Seq) is getting popular to study genome-wide protein-DNA interactions. To address the lack of powerful ChIP-Seq analysis method, we presented the Model-based Analysis of ChIP-Seq (MACS), for identifying transcript factor binding sites. MACS captures the influence of genome complexity to evaluate the significance of enriched ChIP regions and MACS improves the spatial resolution of binding sites through combining the information of both sequencing tag position and orientation. MACS can be easily used for ChIP-Seq data alone, or with a control sample with the increase of specificity. Moreover, as a general peak-caller, MACS can also be applied to any “DNA enrichment assays” if the question to be asked is simply: where we can find significant reads coverage than the random background.

Changes for MACS (3.0.0)

1) Call variants in peak regions directly from BAM files. The function was originally developed under code name SAPPER. Now SAPPER has been merged into MACS as the callvar command. It can be used to call SNVs and small INDELs directly from alignment files for ChIP-seq or ATAC-seq. We call fermi-lite to assemble the DNA sequence at the enriched genomic regions (binding sites or accessible DNA) and to refine the alignment when necessary. We added simde as a submodule in order to support fermi-lite library under non-x64 architectures.

2) HMMRATAC module is added as subcommand hmmratac. HMMRATAC is a dedicated software to analyze ATAC-seq data. The basic idea behind HMMRATAC is to digest ATAC-seq data according to the fragment length of read pairs into four signal tracks: short fragments, mono-nucleosomal fragments, di-nucleosomal fragments and tri-nucleosomal fragments. Then integrate the four tracks again using Hidden Markov Model to consider three hidden states: open region, nucleosomal region, and background region. The orginal paper was published in 2019 written in JAVA, by Evan Tarbell. We implemented it in Python/Cython and optimize the whole process using existing MACS functions and hmmlearn. Now it can run much faster than the original JAVA version. Note: evaluation of the peak calling results is still underway.

3) Speed/memory optimization. Use the cykhash to replace python dictionary. Use buffer (10MB) to read and parse input file (not available for BAM file parser). And many optimization tweaks. We added memory monitoring to the runtime messages.

4) R wrappers for MACS – MACSr for bioconductor.

5) Code cleanup. Reorganize source codes.

6) Unit testing.

7) Switch to Github Action for CI, support multi-arch testing including x64, armv7, aarch64, s390x and ppc64le. We also test on Mac OS 12.

8) MACS tag-shifting model has been refined. Now it will use a naive peak calling approach to find ALL possible paired peaks at + and - strand, then use all of them to calculate the cross-correlation. (a related bug has been fix #442)

9) BAI index and random access to BAM file now is supported. #449.

10) Support of Python > 3.10 #498

11) The effective genome size parameters have been updated according to deeptools. #508

12) Multiple updates regarding dependencies, anaconda built, CI/CD process.

13) Cython 3 is supported.

14) Documentations for each subcommand can be found under /docs


1) Missing header line while no peaks can be called #501 #502

2) Note: different numpy, scipy, sklearn may give slightly different results for hmmratac results. The current standard results for automated testing in /test directory are from Numpy 1.25.1, Scipy 1.11.1, and sklearn 1.3.0.


The common way to install MACS is through PYPI) or conda. Please check the INSTALL document for detail.

MACS3 has been tested using GitHub Actions for every push and PR in the following architectures:

In general, you can install through PyPI as pip install macs3. To use virtual environment is highly recommended. Or you can install after unzipping the released package downloaded from Github, then use pip install . command. Please note that, we haven’t tested installation on any Windows OS, so currently only Linux and Mac OS systems are supported.


Example for regular peak calling on TF ChIP-seq:

macs3 callpeak -t ChIP.bam -c Control.bam -f BAM -g hs -n test -B -q 0.01

Example for broad peak calling on Histone Mark ChIP-seq:

macs3 callpeak -t ChIP.bam -c Control.bam --broad -g hs --broad-cutoff 0.1

Example for peak calling on ATAC-seq (paired-end mode):

macs3 callpeak -f BAMPE -t ATAC.bam -g hs -n test -B -q 0.01

There are currently 14 functions available in MACS3 serving as sub-commands. Please click on the link to see the detail description of the subcommands.

Subcommand Description
callpeak Main MACS3 Function to call peaks from alignment results.
bdgpeakcall Call peaks from bedGraph file.
bdgbroadcall Call nested broad peaks from bedGraph file.
bdgcmp Comparing two signal tracks in bedGraph format.
bdgopt Operate the score column of bedGraph file.
cmbreps Combine bedGraph files of scores from replicates.
bdgdiff Differential peak detection based on paired four bedGraph files.
filterdup Remove duplicate reads, then save in BED/BEDPE format file.
predictd Predict d or fragment size from alignment results. In case of PE data, report the average insertion/fragment size from all pairs.
pileup Pileup aligned reads (single-end) or fragments (paired-end)
randsample Randomly choose a number/percentage of total reads, then save in BED/BEDPE format file.
refinepeak Take raw reads alignment, refine peak summits.
callvar Call variants in given peak regions from the alignment BAM files.
hmmratac Dedicated peak calling based on Hidden Markov Model for ATAC-seq data.

For advanced usage, for example, to run macs3 in a modular way, please read the advanced usage. There is a Q&A document where we collected some common questions from users.


Please read our CODE OF CONDUCT and How to contribute documents. If you have any questions, suggestion/ideas, or just want to have conversions with developers and other users in the community, we recommend using the MACS Discussions instead of posting to our Issues page.


MACS3 project is sponsored by CZI EOSS. And we particularly want to thank the user community for their supports, feedbacks and contributions over the years.


2008: Model-based Analysis of ChIP-Seq (MACS)