Question: metagene ERROR in plot and other function
1
gravatar for arinaldi
2.7 years ago by
arinaldi10
arinaldi10 wrote:

Hi,

I'm using metagene package to make some plot.

I ve tried different bam file but always new() command is ok while each other give me this error:

Error in intoNbins(gr, bcount) : all 'width(gr)' must be >= 'n'

Why?

Thank All

metagene • 613 views
ADD COMMENTlink modified 2.7 years ago • written 2.7 years ago by arinaldi10
Answer: metagene ERROR in plot and other function
2
gravatar for Charles Joly Beauparlant
2.7 years ago by
Canada
Charles Joly Beauparlant160 wrote:

Hello arinaldi,

The problem you have is because metagene will try to split all the regions into 100 bins by defaults to make sure all the regions have the same size. In your data, some regions are probably smaller than 100 nucleotides, which is why there is the error message you saw.

You have two options to solve this problem:

1. You can resize your regions before starting the metagene analysis. For example, if you want to resize all your original regions to 200 nucleotides:

resized_regions <- resize(original_regions, 200, fix = "center")

2. You can reduce the number of bins. For instance, if you saved the metagene object in a variable named mg:

mg$produce_matrices(bin_count = 50)

mg$plot()

With option 1, each bin will always represent the same number of nucleotides (i.e.: if your regions all have a size of 200 nucleotides and the bin_size is 100, each bin will contain the average coverage of 2 nucleotides). With option 2, if the regions have different sizes, the number of nucleotide of each bin will be different for each region.

Here is a visual representation on how the bins are produced:

https://www.dropbox.com/s/9i7dqd3687hvij5/bin_explanation.pdf?dl=0

Thank you for your interest in metagene!

Charles.

ADD COMMENTlink written 2.7 years ago by Charles Joly Beauparlant160

That link is no longer available.

ADD REPLYlink written 23 months ago by Zachary Juang0

Here is a new dropbox link:

https://www.dropbox.com/s/ryg9xzcffh0m2vp/bin_explanation.pdf?dl=0

I added a Imgur link in case the dropbox one dies again:

https://imgur.com/wo0UGio

 

ADD REPLYlink written 23 months ago by Charles Joly Beauparlant160
Answer: metagene ERROR in plot and other function
0
gravatar for arinaldi
2.7 years ago by
arinaldi10
arinaldi10 wrote:

Thank Charles, very useful.

ADD COMMENTlink written 2.7 years ago by arinaldi10
Please log in to add an answer.

Help
Access

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