ataqv: ATAC-seq QC and visualization
What is it?
A toolkit for measuring and comparing ATAC-seq results, made in the Parker lab at the University of Michigan. We wrote it to help us understand how well our ATAC-seq assays had worked, and to make it easier to spot differences that might be caused by library prep or sequencing.
The main program,
ataqv, examines your aligned reads and reports some
basic metrics, including:
- reads mapped in proper pairs
- optical or PCR duplicates
- reads mapping to autosomal or mitochondrial references
- the ratio of short to mononucleosomal fragment counts
- mapping quality
- various kinds of problematic alignments
If you also have a file of peaks called on your data, that file can be examined to report read coverage of the peaks.
With a file of transcription start sites, ataqv can report a TSS enrichment metric based on the transposition activity around those locations.
The report is printed as plain text to standard output, and detailed metrics are written to JSON files for further processing.
A web-based visualization and comparison tool and a script to prepare the JSON output for it are also provided. The web viewer includes interactive tables of the metrics and plots of fragment length, distance from a fragment length reference distribution, mapping quality, counts of reads overlapping peaks, and peak territory.
Web viewer demo: https://parkerlab.github.io/ataqv/demo/
Where does it run?
It's tested on Linux and Macs. It may compile and run on other UNIX systems.
Binary packages (Linux only)
We provide several Linux binary packages under recent releases on
.rpm files with
or download and extract the
ataqv-x.x.x.tar.gz file and add the
full path to the resulting
ataqv-x.x.x/bin subdirectory to your
PATH environment variable.
Homebrew (Mac or Linux)
brew tap ParkerLab/tap brew install ataqv
Building from source manually
To build ataqv, you need:
- Linux or a Mac (it may work on other UNIX systems, but it's untested)
- C++11 compiler (gcc 4.9 or newer, or clang on OS X)
mkarv script that collects ataqv results and sets up a web
application to visualize them requires Python 2.7 or newer.
On Debian-based Linux distributions, you can install dependencies with:
sudo apt install libboost-all-dev libhts-dev libncurses5-dev libtinfo-dev zlib1g-dev lcov
and the latest supported option among:
sudo apt install libstdc++-6-dev sudo apt install libstdc++-5-dev sudo apt install libstdc++-4.9-dev
At your shell prompt:
git clone https://github.com/ParkerLab/ataqv cd ataqv make
If Boost and htslib are not available in default system locations (for
example if you're using environment modules, or compiling in your home
directory) you'll probably need to give
make some hints via the
make CPPFLAGS="-I/path/to/boost/include -I/path/to/htslib/include" LDFLAGS="-L/path/to/boost/lib -L/path/to/htslib/lib"
If the environment variables
HTSLIB_ROOT are set
to directories containing
lib subdirectories, the
compiler configuration can be made simpler:
make BOOST_ROOT=/path/to/boost HTSLIB_ROOT=/path/to/htslib
Or you can specify directories in BOOST_INCLUDE, BOOST_LIB, HTSLIB_INCLUDE, and HTSLIB_LIB separately.
If you use custom locations like this, you will probably need to set LD_LIBRARY_PATH for the shared libraries to be found at runtime:
If your Boost installation used their "tagged" layout, the libraries
will include metadata in their names; on Linux this usually just means
that they'll have a
-mt suffix to indicate multithreading
BOOST_TAGGED=yes in your make commands to link
If HTSlib was built to use libcurl, you'll need to link with that as well:
The Makefile supports the common DESTDIR and prefix variables. To install to /usr/local:
make install prefix=/usr/local
Support for the Environment Modules system is also included. You
can install to the modules tree by defining the
MODULEFILES_ROOT variables. If your modules are kept under
/opt/modules, with their accompanying module files under
make install-module MODULES_ROOT=/opt/modules MODULEFILE_ROOT=/opt/modulefiles
And then you should be able to run
module load ataqv to have
everything available in your environment.
You can create a distribution tarball with:
It will create a .tar.gz file in the
build subdirectory of the
source tree. Extract that anywhere and add the
bin subdirectory to
your PATH environment variable. To use the distribution on another
machine, that machine must have the same shared libraries as your
build machine. If that's not possible, you can try to build a static
However, static compilation has only been tried on Linux (RHEL 6;
Debian testing (Stretch) and unstable), and it may not work at all on
your distribution. You will almost certainly need HTSlib built without
cURL support, as some of the library dependencies are not available as
shared libraries. Supply the path to your custom HTSlib with
You'll need to have a BAM file containing alignments of your ATAC-seq reads to your reference genome. If you want accurate duplication metrics, you'll also need to have marked duplicates in that BAM file. If you have a BED file containing peaks called on your data, ataqv can produce some additional metrics using that.
Verifying ataqv results with data from a variety of common tools is on
our to-do list, but so far, we've only used bwa, Picard's
MarkDuplicates, and MACS2 for these steps. A pipeline like ours
can be generated with the included
make_ataqv_pipeline script. Its
output product starts from a BAM file of aligned reads, marks
duplicates and calls peaks, then runs ataqv and produces a web viewer
for the output.
The main program is ataqv. Run
ataqv --help for complete
When run, ataqv prints a human-readable summary to its standard output, and writes complete metrics to the JSON file named with the --metrics-file option.
The JSON output can be incorporated into a web application that
presents tables and plots of the metrics, and makes it easy to compare
results across samples or experiments. Use the
mkarv script to
create a local instance of the result viewer. A web server is not
required, though you can use one to publish your result viewer
The ataqv package includes a script that will set up and run our entire ATAC-seq pipeline on some sample data.
You'll need to have installed ataqv itself, plus Picard tools, samtools, and MACS2 to run the pipeline. On a Mac, you can obtain everything with:
$ brew install ataqv picard-tools samtools $ pip install MACS2
On Linux, installation of the dependencies is probably specific to
your environment and is left as an exercise for the reader. On Debian,
apt-get install picard-tools samtools followed by installing MACS2
pip install MACS2 should be enough.
Once you have the prerequisite programs installed, you can run the example pipeline with:
$ run_ataqv_example /output/path
Comparing your results to others
Part of this project will be publishing ataqv output for as many ATAC-seq experiments as we can get our hands on, so we can compare them and learn how changes to the protocol affect the output. Watch our GitHub docs for updates.
It's not currently concurrent, so don't allocate it more than a single processor. Memory usage should typically be no more than a few hundred megabytes.
Anecdotally, processing a 41GB BAM file containing 1,126,660,186 alignments of the data from the ATAC-seq paper took just under 20 minutes and 2GB of memory. Adding peak metrics extended the run time to almost 40 minutes, but it still used the same amount of memory.