Description Usage Arguments Value Examples
View source: R/makeCpGranges.R
Cluster CpGs together in genes based on annotation
1 | makeCpGgenes(observations, chr, pos, gene, minCpG = 2)
|
observations |
Vector of corresponding observed T-value for each CpG, must be ordered in the same way as chr and pos |
chr |
Vector of chromosome location for each CpG |
pos |
Vector giving base pair position for each CpG If unsorted, use order(chr,pos) to sort the genomic positions within each chromosome. |
gene |
A vector asigning each probe to a gene. |
minCpG |
Minimum number of CpGs allowed in each region to be considered. Default is set to at least 2 CpGs within each region. |
The suplied observations ordered into into a list, with one entry for each CpG region.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | data(DMRScan.methylationData) ## Load methylation data from chromosome 22
data(DMRScan.phenotypes) ## Load phenotype (end-point for methylation data)
## Test for an association between phenotype and Methylation
testStatistics <- apply(DMRScan.methylationData,1,function(x,y)
summary(glm(y ~ x, family = binomial(link = "logit")))$coefficients[2,3],
y = DMRScan.phenotypes)
## Set chromosomal position to each test-statistic
pos <- data.frame(matrix(as.integer(unlist(strsplit(names(testStatistics),
split="chr|[.]"))), ncol = 3, byrow = TRUE))[,-1]
## Set clustering features
minCpG <- 3 ## Minimum number of CpGs in a tested cluster
gene <- sample(paste("Gene",1:100,sep=""),
length(testStatistics),replace=TRUE)
regions <- makeCpGgenes(observations = testStatistics,
chr = pos[,1], pos = pos[,2],
gene = gene, minCpG = minCpG)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.