random list of coordinates of different lengths
1
1
Entering edit mode
8 weeks ago
Chironex ▴ 50

hi, I would like to create a list of random mm10 genomic coordinates with bedtools. I saw that the useful command to do this is bedtools random [OPTIONS] -g <GENOME>. The problem is that they must have different length, similar to my coordinates:

> summary (new \$ width)
Min.  1st Qu.   Median   Mean   3rd Qu.   Max.
188    1645     2649   2904    4196      11484


is there any other tool that can set different lengths when generating coordinates? Thank you!

r bedtools • 247 views
3
Entering edit mode
8 weeks ago
mmmmcandrew ▴ 180

There are a couple of different ways to approach this, I think, depending on what you have on hand. If you already have a set of coordinates such as the ones you've entered above, you could simply shuffle these coordinates along the genome using bedtools shuffle. If you only have a small list of such regions and need a relatively large amount, you could perform the operation repeatedly to get a large number of such regions.

Alternatively it looks like there is an R package for this task. I've not used it myself, but the documentation is here.

0
Entering edit mode

Hi, thanks for your reply. I don't want exactly shuffle my coordinates. I have about 1300 coordinates and I want to create a new set of coordinates which are the same width as mine but which do not overlap with mine, to be used as a negative control. My coordinates are enhancers, the ones I want to generate must be non-enhancers. so I thought I'd create them randomly. do you have any idea how I can proceed?

0
Entering edit mode

Yes, this is exactly what you can accomplish with bedtools shuffle. Take a look at the documentation here. The shuffle tool will take the coordinates you have on hand and transpose them randomly to produce an equal number of regions of the same width. If you want to make sure that the regions you are using (as well as any other enhancers you are aware of that are relevant in this context), you can use the -excl option and provide a bed file of those enhancer regions to ensure that the regions are shuffled to loci outside of those regions. Your final command would look something like: bedtools shuffle -excl enhancers.bed -i myInput.bed -g genomeOfInterest

0
Entering edit mode

Fantastic, thanks a lot!