metagene error when plot metagene reads signal
1
0
Entering edit mode
Wojeff • 0
@wojeff-14309
Last seen 2.7 years ago
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 • 901 views
1
Entering edit mode
@charles-joly-beauparlant-4777
Last seen 4.0 years ago

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.