random list of coordinates of different lengths
1
1
Entering edit mode
18 months ago
Chironex ▴ 40

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 • 696 views
ADD COMMENT
3
Entering edit mode
18 months ago
mmmmcandrew ▴ 190

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.

ADD COMMENT
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?

ADD REPLY
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

ADD REPLY
0
Entering edit mode

Fantastic, thanks a lot!

ADD REPLY

Login before adding your answer.

Traffic: 2740 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6