Question: bed file run macs error
gravatar for catherine12243
5.9 years ago by
United States
catherine12243140 wrote:

I have wig file downloaded from GEO, and since MACS doesn't accept wig file, so I convert it to bed file using wig2bed command. And my bed file looks like this:

chr1    3002399    3002499    id-1    0.110000

chr1    3016999    3017099    id-2    0.110000

chr1    3017099    3017199    id-3    0.110000

chr1    3017199    3017299    id-4    0.110000

chr1    3018699    3018799    id-5    0.110000

chr1    3018799    3018899    id-6    0.110000

chr1    3018899    3018999    id-7    0.110000

chr1    3018999    3019099    id-8    0.110000

chr1    3021699    3021799    id-9    0.110000

chr1    3021799    3021899    id-10    0.110000

But when I run MACS, I get empty output. Is that because the 4th column? 

If it is, can someone tell me how to remove it? I tried to use 

cut -f 1-3,5 H3K4me1_mef.bed >H3K4me1_mef.bed 


cat H3K4me1_mef.bed |awk '{print $1 "\t" $2 "\t" $3 "\t" $5}' >H3K4me1_mef.bed

Neither of them works. Is that because they are not separated by tab? But they looks like tab separated.

Thank you for any idea!!!

chip-seq macs • 1.6k views
ADD COMMENTlink modified 5.9 years ago by Dan D7.1k • written 5.9 years ago by catherine12243140
gravatar for Dan D
5.9 years ago by
Dan D7.1k
Dan D7.1k wrote:

You might save some time by looking at the MACS readme.  Seems your BED is missing the required sixth column with strand information. Scroll down to the -f/--format section in the link for more info.

You don't want to remove that fourth column. But just for grins: your command should have worked for a tab-delimited file. It probably won't for a space-delimited file. For a situation where you have multiple separating spaces between columns, I think the easiest course of action is to use:

sed -e 's/[[:blank:]]\+/\t/g' H3K4me1_mef.bed | cut -f 1-3,5 - > H3K4me1_mef_test.bed 

This converts all of the interstitial whitespace to a single tab, which cut then handles happily.

ADD COMMENTlink modified 5.9 years ago • written 5.9 years ago by Dan D7.1k
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1114 users visited in the last hour