This is a test version of Biostars. For the public version, visit https://www.biostars.org.
bedGraphToBigWig genome size does not fit

Hi I was trying to convert begGraph into bigwig file. but got error like:

"End coordinate 121843858 bigger than chr11 size of 121843856 line 3239399 of ..."

the bedgraph was from MACS peak calling.

~/_MACS_bedGraph/treat/~_treat_afterfiting_all.bedGraph

I got the genome size file by:

fetchChromSizes mm9 > mm9.chrom.sizes

then I ran the command:

bedGraphToBigWig *_treat_afterfiting_all.sorted.bedGraph ~/Ref_sequence/Mus_musculus/mm9.chrom.sizes *.bw

but I always got error like:

"End coordinate 121843858 bigger than chr11 size of 121843856 line 3239399 of ..."

initially, I thought that I just did not sort the bedGraph file, so I sorted the file:

sort -k1,1 -k2,2n *.bedGraph > *. sorted.bedGraph

then I rerun the command, but got the same error.

Anyone has any idea what might go wrong? Thanks!

alignment chip-seq

Are you sure your BedGraph was mm9?

1 answer

Error probably comes from read extension occuring during bedgraph building. This can bring read coordinates out of the chromosomes boundaries To prevent this situation you might want to limit signal coordinates to the chromosome ones:

bedtools slop -i ${File} -g ${chrom_info} -b 0 | bedClip stdin ${chrom_info} ${File}.clip

Then sort it again :

LC_COLLATE=C sort -k1,1 -k2,2n ${File}.clip &> ${File}.sort.clip

and redo the bedGraphToBigWig conversion

This might do what you want

Log in to answer this question.