WIG file from MACS14

1,404 views
Skip to first unread message

Wang, Feng

unread,
Dec 9, 2011, 10:17:43 AM12/9/11
to macs-ann...@googlegroups.com

Hi all,

 

I have done several ChIP analysis using MACS14 and found that the wig file generated from MACS14 is not consistent with the original BAM files (the base coverage).

 

At some position, the coverage from BAM files is higher while at other position, the coverage from WIG files is higher.

 

The difference is not small. Sometimes it even goes to two or three fold.

 

I am wondering how MACS generate the wig files. Thanks!

 

Feng Wang

 

Tao Liu

unread,
Dec 9, 2011, 10:22:31 AM12/9/11
to macs-ann...@googlegroups.com
Hi Feng,

Two differences between MACS wiggle and base coverage from BAM:

1. MACS extends all reads to a fixed length towards their 3' direction, that will make MACS wig higher than base coverage from BAM at some positions;
2. MACS will filter out duplicate reads at exactly the same position. Check --keep-dup option. This will make MACS wig lower than base coverage from BAM at some positions;

HTH,
Tao Liu

Research Fellow
Dept of Biostats and Comp Bio, DFCI / HSPH
450 Brookline Ave., Boston, MA 02215

> --
> You received this message because you are subscribed to the Google Groups "MACS announcement" group.
> To post to this group, send email to macs-ann...@googlegroups.com.
> To unsubscribe from this group, send email to macs-announcem...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/macs-announcement?hl=en.

Wang, Feng

unread,
Dec 9, 2011, 10:25:38 AM12/9/11
to macs-ann...@googlegroups.com
Got it.

Thank you very much!

Feng

Vince

unread,
Jul 16, 2012, 4:52:21 PM7/16/12
to macs-ann...@googlegroups.com
Hi,

I am having problems with macs14 1.4.0rc2 20110214 (Valentine) calling peaks where there are absolutely no reads  in the ChIP data.  In this case, I am using zebrafish 75 bp single end reads mapped with bwa, sorted and duplicates marked but not removed using picard.  I remove non uniquely mapping and unmapped reads using samtools view   -F 260 -q 5  Here is macs info:

# tag size is determined as 76 bps
# total tags in treatment: 6036137
# tags after filtering in treatment: 6035856
# maximum duplicate tags at the same position in treatment = 1
# Redundant rate in treatment: 0.00
# total tags in control: 19622342
# tags after filtering in control: 19622335
# maximum duplicate tags at the same position in control = 2
# Redundant rate in control: 0.00
# d = 200


I can see that signal in the wig file will be altered by D extension and duplicate removal, but I can't see how signal will be generated where there are no reads.  Maybe this is caused by the unbalanced treatment and control?  The wig file is mostly consistent with the bam file, but there are a number of places where the discrepancy is large.  An IGB screen capture is attached

Thanks,

Vince
IGB_MacsScreenCapture.gif

Vince

unread,
Jul 17, 2012, 11:10:52 AM7/17/12
to macs-ann...@googlegroups.com
The wig file signal in regions with no reads problem goes away when the --to-small parameter is used.  Does anyone know if wig file signal in regions with no reads happens when --to-small is not used using newer versions of macs?  I suggest that macs users should think twice about using the default no --to-small when using unbalanced samples (more in input) since there may be some amount of false calls.

Vince

Tao Liu

unread,
Jul 24, 2012, 10:51:22 AM7/24/12
to macs-ann...@googlegroups.com
Hi Vince,

You are right on that. Currently, both MACS (1.4.2) and MACS2 are using --to-small as default and --to-large as an option. The reason is simple -- while scaling up samples, you will amplify more background noises than real signals.

Best,
Tao

liuliu6

unread,
Oct 16, 2012, 1:14:01 PM10/16/12
to macs-ann...@googlegroups.com, fe...@bcm.edu
Hi, Tao,

the wig files generated under the --wig  option  are scaled or not?    

also what about the bedgraph files generated by -B ?  scaled?

we are not sure whether the --to-small or --to-large option will be applied to the wig files or bedgraph files generated by MACS1.4

Thanks
Sophia


On Friday, December 9, 2011 10:17:43 AM UTC-5, Wang, Feng wrote:

Tao Liu

unread,
Oct 16, 2012, 5:11:09 PM10/16/12
to macs-ann...@googlegroups.com
Hi Sophia,

MACS14: No. They are raw pileup with tag extension.  Scaling is only used while calling peaks. Note that control track is generated by same tag extension as treatment. So it's not exactly the same as local bias from MACS, which is a maximum of average tag number from a small window(1kbp) and a larger window(10kbp). In brief, they are raw fragment pileup.

MACS2: Yes. They are scaled. Especially with current --SPMR option, you will get values of signal per million reads. And control track is consistent with local bias calculated from MACS.

Best,
Tao


--
You received this message because you are subscribed to the Google Groups "MACS announcement" group.
To view this discussion on the web visit https://groups.google.com/d/msg/macs-announcement/-/5oAws6EHkHEJ.

To post to this group, send email to macs-ann...@googlegroups.com.
To unsubscribe from this group, send email to macs-announcem...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/macs-announcement?hl=en.
Tao Liu

Research Fellow
Dept of Biostats and Comp Bio, DFCI / HSPH
450 Brookline Ave., Boston, MA 02215

Sophia

unread,
Oct 16, 2012, 5:19:56 PM10/16/12
to macs-ann...@googlegroups.com
In this case, the redundant tags are included in the pileup in wig file?  

More specifically,  if I get this information during running the MACS14:  # maximum duplicate tags at the same position in treatment = 4

this means only 4 tags at this position are calculated ?  or all redundant tags at this same position are calculated?

Again, the bedGraph file generated in MACS14 is also the raw pileup right?

Thanks !!!

Tao Liu

unread,
Oct 16, 2012, 5:50:28 PM10/16/12
to macs-ann...@googlegroups.com
No. Redundant tags are removed from the beginning of analysis.

BedGraph file is consistent with wig -- just another format. The difference is that in wig, MACS outputs variableStep at (by default) 10bp step; however in bedGraph, MACS outputs all values and merges adjacent points with the same value.

Best,
Tao

Sophia

unread,
Oct 16, 2012, 6:18:00 PM10/16/12
to macs-ann...@googlegroups.com
If I use --keep-dup=all,  then the wig file generation should include all tags,   right?   And, peak enrichment calculation also includes all tags, right ??

Tao Liu

unread,
Oct 16, 2012, 6:46:39 PM10/16/12
to macs-ann...@googlegroups.com
Yes.

avinash waghray

unread,
Oct 17, 2012, 12:32:35 AM10/17/12
to macs-ann...@googlegroups.com
Hey Tao,

Is there any way of getting scaled Wig files in MACS14 or otherwise. I am unable to run MACS2 on my computer because of its large memory requirement. Do you have any suggestions on how to get scaled wig files from MACS14 output?

Thanks

Sophia

unread,
Oct 17, 2012, 4:22:59 AM10/17/12
to macs-ann...@googlegroups.com
Hi, Tao,

For fly, with the 50nt sequencing , the effective genome size should still be 1.2e-8 ???

Thanks

Tao Liu

unread,
Oct 17, 2012, 3:04:50 PM10/17/12
to macs-ann...@googlegroups.com
Hi Avinash,

Wiggle or BedGraph file is in plain text format. So you can easily manipulate the file and divide the score column by a denominator from sequencing depth. I usually use sequencing depth in million reads after redundant reads being filtered out. You can check MACS log or xls output for these numbers. 

For example, you have 3,123,456 reads after filtering. You can do:

$ awk -v OFS="\t" 'NF==2{print $1,$2/3.123456};END {print}' yourwig.wig

for variableStep wig.

Or

$ awk -v OFS="\t" 'NF==4{print $1,$2,$3,$4/3.123456};END {print}'  yourbedgraph.bdg

for bedGraph.

Best,
Tao

Sophia

unread,
Oct 17, 2012, 3:36:07 PM10/17/12
to macs-ann...@googlegroups.com

Tao Liu

unread,
Oct 17, 2012, 3:56:10 PM10/17/12
to macs-ann...@googlegroups.com
Hi Sophia,

Read length will influence mappable genome by definition. However the effective genome size in MACS wouldn't affect results too much, if the difference is only within one order of magnitude. So, you can simply keep it as is. If you are not satisfied with the number we suggest, you can assign any number you like.

Tao

Sophia

unread,
Oct 17, 2012, 4:00:34 PM10/17/12
to macs-ann...@googlegroups.com
Tao, 

then with which formula, does that 1.2e-8 is obtained? 

Tao Liu

unread,
Oct 17, 2012, 4:38:04 PM10/17/12
to macs-ann...@googlegroups.com
You can check README:


They are roughly estimated -- either whole genome size - repetitive region size or whole genome size * 70% or 90%.

Tao

avinash waghray

unread,
Oct 22, 2012, 3:27:58 PM10/22/12
to macs-ann...@googlegroups.com
Hey Tao,

Thanks for your earlier reply. Is there any way of generating a wiggle file that corresponds only to hits in the peaks.bed file. I want to basically get a wiggle file for my treatment minus the wiggle peaks of the control. That is: treatement.wig - control.wig = Real hits bound only by the TF ad not IgG.

This would be of immense help. thanks
Nash

Tao Liu

unread,
Oct 23, 2012, 6:13:47 PM10/23/12
to macs-ann...@googlegroups.com
Hi Nash,

I am trying to recall what I implemented for MACS1... Yes. There should be a tool named 'wignorm' in MACS1.4.2 which can calculate pvalue, fold change or asinh difference from two wig files. But there is no simple subtraction function. 

The alternative is to ask MACS generate bedGraph output, then use one of the MACSv2 function bdgcmp in this way:

$ macs2 bdgcmp -t a.bdg -c b.bdg -m subtract -o c.bdg

Best,
Tao


On Oct 22, 2012, at 3:27 PM, avinash waghray <avinash...@gmail.com> wrote:

Hey Tao,

guoshicheng

unread,
Nov 24, 2012, 10:46:30 PM11/24/12
to macs-ann...@googlegroups.com
Dear All,
    I compile MACS-1.4.2 and enter to bin directory to run ./macs14, but i get the follow error report. what should i do to resolve this problem??

jcw...@nebulae.login:~/software/MACS-1.4.2/bin> ./macs14
Traceback (most recent call last):
  File "./macs14", line 35, in ?
    from MACS14.OptValidator import opt_validate
ImportError: No module named MACS14.OptValidator


Python and linux system information:

jcw...@nebulae.login:~/software/MACS-1.4.2/bin> python
Python 2.4.2 (#1, Jan 10 2008, 17:43:47)
[GCC 4.1.2 20070115 (prerelease) (SUSE Linux)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>

system infomation:
jcw...@nebulae.login:~/software/MACS-1.4.2/bin>  lsb_release -a
LSB Version:    core-2.0-noarch:core-3.0-noarch:core-2.0-x86_64:core-3.0-x86_64:desktop-3.1-amd64:desktop-3.1-noarch:graphics-2.0-amd64:graphics-2.0-noarch:graphics-3.1-amd64:graphics-3.1-noarch
Distributor ID:    SUSE LINUX
Description:    SUSE Linux Enterprise Server 10 (x86_64)
Release:    10
Codename:    n/a

jcw...@nebulae.login:~/software/MACS-1.4.2/bin> uname -a 
Linux node1 2.6.16.60-0.69.1-smp #2 SMP Sun Apr 17 18:21:18 CST 2011 x86_64 x86_64 x86_64 GNU/Linux

jcw...@nebulae.login:~/software/MACS-1.4.2/bin> cat /etc/issue

Welcome to SUSE Linux Enterprise Server 10 SP2 (x86_64) - Kernel \r (\l).






--
Ministry of Education Key Laboratory of Contemporary Anthropology
School of Life Sciences, Fudan University
220 Handan Road
Shanghai, China 200433
Phone:15216760764
Office Tel:021-55664474
E-mail: guoshic...@yeah.net
--
You received this message because you are subscribed to the Google Groups "MACS announcement" group.
To post to this group, send email to macs-ann...@googlegroups.com.
To unsubscribe from this group, send email to macs-announcement+unsub...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages