Question: Simulated CNVs maintaining size
gravatar for Crisr
18 months ago by
Crisr0 wrote:

I would like to generate a random distribution of simulated CNVs to compare with my original data (chr, start, end position). I would like to maintain the same chromosome and in addition to keep fixed the length of each CNV only changing its start/end positions. I am wondering how it is the easiest and correct way to do that. I know the bedtools random and shuffle options but neither of them allowing me to keep fixed the size for each single CNV. Thank you very much for your help! Cristina

genome cnv R simulations gene • 363 views
ADD COMMENTlink modified 18 months ago by bernatgel2.4k • written 18 months ago by Crisr0
gravatar for bernatgel
18 months ago by
Barcelona, Spain
bernatgel2.4k wrote:

Hi Crisr,

You can use the R/Bioconductor package regioneR for that. It has a function called randomizeRegions that will move around your CNV regions maintaing their size and taking care that the randomized regions do not overlap. If you set the per.chromosome parameter to TRUE then it will randomize your regions in their original chromosomes in the way you need them. By default it assumes you are working on human with genome version "hg19" and will get the correct chromosome sizes automatically, but

If you want to create the random regions to perform a permutation test, you can use the permTest function in regioneR tha will take care of the whole process.

Important note: this function will not place any region on "masked" parts of the genome. By default it takes the default mask in the BSGenome package (includes centromeres, repeatmasker....) but in your case you should probably create a mask with only the centromere regions (code to get them below) or disable the mask completely with mask=NA.

How to get the centromeres in 3 lines: You can use karyoploteR to easily get the centromeres with this code. More info on karyoploteR at the tutorial page

cytobands <- filterChromosomes(getCytobands("hg19"))
centromeres <- cytobands[cytobands$gieStain=="acen"]
ADD COMMENTlink written 18 months ago by bernatgel2.4k
Please log in to add an answer.


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