The same regions are observations where maximum difference between minimum and maximum position is tiles.length argument.

create_tiles_fixed_length(data, tiles.length, common = FALSE)

Arguments

data

dataframe with specific columns: chr, poz, prob, no, meth, unmeth, meth.rate. This dataframe is result of function preprocessing.

tiles.length

integer number that specifies maximum difference between minimum and maximum position in the same methylation regions. k-region in chromosome are observations for which position is between [k * tiles.length;(k + 1)* tiles.length -1]

common

logi value. If TRUE this function creates second regions group that k-region in chromosome are observations for which position is between [ k * tiles.length + tiles.length/2 ; (k + 1)* tiles.length -1 + tiles.length/2]

Value

data.frame from parameter data with extra column tiles that is region id number within chromosomes and extra column tiles.common if argument tiles.common is not null

Examples

data('schizophrenia') control <- schizophrenia %>% filter(category == 'control') %>% dplyr::select(-category) disease <- schizophrenia %>% filter(category == 'disease') %>% dplyr::select(-category) data <- preprocessing(control, disease) head(create_tiles_fixed_length(data, tiles.length = 1000, common = FALSE))
#> chr poz prob no meth unmeth meth.rate tiles #> 1 chr1 81412 x 35 29 6 0.8285714 81 #> 2 chr1 81412 y 76 66 10 0.8684211 81 #> 3 chr1 81442 x 35 29 6 0.8285714 81 #> 4 chr1 81442 y 76 66 10 0.8684211 81 #> 5 chr1 81546 x 35 29 6 0.8285714 81 #> 6 chr1 81546 y 76 66 10 0.8684211 81
head(create_tiles_fixed_length(data, tiles.length = 1000, common = TRUE))
#> chr poz prob no meth unmeth meth.rate tiles tiles.common #> 1 chr1 81412 x 35 29 6 0.8285714 81 81 #> 2 chr1 81412 y 76 66 10 0.8684211 81 81 #> 3 chr1 81442 x 35 29 6 0.8285714 81 81 #> 4 chr1 81442 y 76 66 10 0.8684211 81 81 #> 5 chr1 81546 x 35 29 6 0.8285714 81 82 #> 6 chr1 81546 y 76 66 10 0.8684211 81 82