從NCBI下載到由macs2生成的wig文件(wig file from macs),正在開(kāi)心可以不用自己分析數(shù)據(jù)直接借用的時(shí)候,發(fā)現(xiàn)wig文件轉(zhuǎn)bigwig時(shí)候(wigToBigWig),報(bào)錯(cuò):item's end is longer than chromosome size。
/software/wigToBigWig col.wig arabidopsis.genome col.bigwig
#Line 3825834 of col.wig: chromosome 5 has 26975502 bases, but item ends at 26975550
答案1:
在網(wǎng)上找到有人在biostars上已經(jīng)問(wèn)了這個(gè)問(wèn)題而且已經(jīng)有答案了Question: Wig file obtained from MACS14 is longer than chromosome size?
macs2會(huì)把reads延伸300bp,導(dǎo)致有的片段會(huì)超出基因組范圍,macs2生成的bedgraph文件也有相同問(wèn)題。解決方法就是用UCSC的bedclip工具(點(diǎn)擊到UCSC工具下載頁(yè)面),先把超出的基因組的片段扔掉,或者把超出的部分去掉(parameter:-truncate)。但是下載后發(fā)現(xiàn)bedclip的輸入對(duì)象是bed文件,要應(yīng)用于我的wig文件,還要麻煩的轉(zhuǎn)格式。
使用說(shuō)明如下:
bedClip - Remove lines from bed file that refer to off-chromosome locations.
usage:
bedClip [options] input.bed chrom.sizes output.bed
chrom.sizes is a two-column file/URL: <chromosome name> <size in bases>
答案2:
小白還是想偷個(gè)懶看看有沒(méi)有人寫好了腳本。
在簡(jiǎn)書上也有作者用bedclip解決相似問(wèn)題,還寫好了可以直接使用的腳本。但是輸入文件是macs2的bedgraph文件。MACS2學(xué)習(xí)筆記
答案3:
繼續(xù)找答案,在biostars上看到了另一個(gè)問(wèn)題和回答。Question: item's end higher than chrom size, wigToBigWig。其實(shí)wigToBigWig有一個(gè)參數(shù)-clip,可以直接把有超出基因組部分的片段扔掉,而不報(bào)錯(cuò)。
使用說(shuō)明如下:
options:
-blockSize=N - Number of items to bundle in r-tree. Default 256
-itemsPerSlot=N - Number of data points bundled at lowest level. Default 1024
-clip - If set just issue warning messages rather than dying if wig
file contains items off end of chromosome or chromosomes
that are not in the chrom.sizes file.
這個(gè)方法簡(jiǎn)單方便,可以直接輸入wig文件,但是缺點(diǎn)就是不能像bedClip一樣,只去超出的那部分,而是把有超出基因組部分的整個(gè)片段丟掉。
成功拿到想要的bigwig文件啦ヾ(≧▽≦*)o
/software/wigToBigWig -clip col.wig arabidopsis.genome col.bigwig
寫在后面:
如果有人寫出了用bedClip解決wig轉(zhuǎn)bigwig片段超出基因組的腳本,記得提醒小白,一起學(xué)習(xí),謝謝!!☆⌒(*^-゜)v