This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How to analysis coordinate density in whole gnome

Hi, Biostars.

I have a bed file, containing positions with 1bp interval. These positions express a feature in genome we focus.

I would like to analysis density of above bed file. "density" means accumulation of these position, like "hotspot".

Anyone have a solution? thanks.

genome

What do you exactly mean with "density"?

I would like to analysis whether some of bed positions exist in specific region of genome.

For example,

The number of positions : 10000

Whole genome length : 1.0E+9 [bp]

Assuming the above, 10 positions cluster in 1.0E+6 may be random distribution.

On the other hand, 10 positions cluster in 1.0E+3 may be "density" or "hotspot".

Sorry about my poor English and vague goal.

2 answers

You can use ggplot2 as recommended by Irsan in this post.

Edit: the link works now.

thanks harold, your "this post" lint is not valid...

If you are working with BED files, at a very basic level, you could use bedmap to count the number of features that overlap positions of interest ("density"):

$ bedmap --echo --count positions.bed features.bed > answer.bed

You can then apply whatever model over the desired window size, to compare what you expect with what you observe.

For instance, if you pick windows at random over all positions in your background space and --count features over those windows, that gives you a background expected rate. Then you can compare that with what you observe with the observed density of features in windows at each position.

Log in to answer this question.