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?
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!
1 answer
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.
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
Fantastic, thanks a lot!
Log in to answer this question.