Question: metagene error when plot metagene reads signal
0
15 months ago by
wuzefeng20080 wrote:
Hi,
I am using ""metagene" to plot average reads signal around gene, but it gave error like this:
Error in intoNbins(gr, bcount) : all 'width(gr)' must be >= 'n'.

My command is :

mg <- metagene$new(genes, "H3K4me3.bam", cores = 8, force_seqlevels = TRUE) After add the parameter of "bin_count=30", Error in .subset2(public_bind_env, "initialize")(...) : parameter no use (bin_count = 30), besides, some times it gave error " Error in intoNbins(gr, bcount) : all 'width(gr)' must be >= 'n'" , and i don't know why? Thanks metagene metagene$new • 336 views
modified 15 months ago by Charles Joly Beauparlant160 • written 15 months ago by wuzefeng20080
1
15 months ago by
Charles Joly Beauparlant160 wrote:

Hello,

The error happens when you have a region smaller than the bin_count parameter value.

In your example, if genes is a GRanges object, you can test this by doing:

summary(width(genes))


The min value should be smaller than 30.

Depending on what you want to see with the metagene plot, you might consider resizing your regions, i.e.:

genes <- resize(genes, 1000, fix = "center")


Thank you for your interest in metagene! Charles.