1. What is MapSum?

MapSum is a program that summarize exported file from BMap. 

2. How to use MapSum

When BMap complete mapping of your reads, two text files are produced. The first one contains alignments for uniquely mapped reads, and second one contains summary of mapping for each read. MapSum uses the later for counting number of uniquely mapped reads, unmapped reads and reads mapped on several genomic regions. A typical command to run MapSum is as following.

>MapSum -sum Your_BMap_Result.sum -out Your_MapSum.html

MapSum can treat multiple sum files at once. You can specify them as followings.

>MapSum -sum Your_BMap_Result_A.sum Your_BMap_Result_B.sum -out Your_MapSum.txt
>MapSum -sum Your_BMap_Result_A.sum -sum Your_BMap_Result_B.sum -out Your_MapSum.txt
>MapSum -sum Your_BMap_Result_*.sum -out Your_MapSum.txt

MapSum can read gzipped files directry, so you can specify these files.

>MapSum -sum Your_BMap_Result.sum.gz -out Your_MapSum.txt

If you specify output file with extension ".html", MapSum exports graphical html file containing the result of mapping. 

>MapSum -sum Your_BMap_Result.sum.gz -out Your_MapSum.html

You can see an example of MapSum's output here.

Command line options for CalcEnrichment

Option Value type Descriptions
-sum string(s) Specify the path to sum file(s). Multiple files can be specified for one option. Multiple use of this option is also allowed. Gzipped file can be read directly. Wild cards are accepted. [requred]
-out string Specify the paths to output file. If the path contains an extension "html",  output of CalcCoverage becomes graphical one. [requred]

3. How to compile MapSum

MapSum is dependent on the C++ library Qt, so you can compile and use it on the platforms supported by Qt. The source code is available from here.

Once you correctly install Qt in your system, you can easily compile the source codes. After extraction of the source codes to an appropriate directory, change working directory to the directory and type the following commands.

>qmake MapSum.pro
>make (or nmake for Visual Studio on Windows)

After completion of the commands, you can find an executable file in the directory named "bin" located at the same layer with the directory of the source code.

4. A Notice for running MapSum in graphical mode

MapSum uses functions provided by an open source library QCustomPlot in graphical html output mode. Since  QCustomPlot requires X-window system in some platforms, MapSum needs to be provided with both an X-server process and an environment variable "DISPLAY". If MapSum can not find any X-window server process, an error message like following will appear.

>MapSum: cannot connect to X server localhost:10.0

To solve this, we use virtual X11 display server Xvfb. After installing Xvfb appropreately, we type following command to launch Xvfb.

>Xvfb :1 -screen 0 1024x768x24 1>/dev/null 2>/dev/null &

 Then set an environment variable "DISPLAY" with typing following command.

>export DISPLAY=:1.0

After completion of runnning MapSum, the Xvfb process can be killed as following.

>kill Xvfb

5. Precompiled executables

For your convenience, executable files are prepared as follows.

Platform compiled (Qt version) Link
Windows, 64-bit (Qt5.1) MapSum-v1.0-win64.zip
Macintosh, 64-bit (Qt5.1) MapSum-v1.0-mac64.gz
Linux CentOS 5 , 64-bit (Qt4.7) MapSum-v1.0-linux-centos64.tar.gz