Skip to content

Commit

Permalink
Added qn.bmiq normalization
Browse files Browse the repository at this point in the history
  • Loading branch information
jenzopr committed Aug 31, 2016
1 parent e17e2c9 commit 22496b5
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/normalizeAndCreateTables.R
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,15 @@ if(normalization == "quantile") {
write.table(getM(mSet)[-failed_probes,], file = paste(targetDir, "mValues_quantile.txt", sep="/"), quote = F, sep = "\t", row.names = T, col.names = T)
write.table(getBeta(mSet)[-failed_probes,], file = paste(targetDir, "betaValues_qunatile.txt", sep="/"), quote = F, sep = "\t", row.names = T, col.names = T)
}

if(normalization == "qn.bmiq") {
mSet = preprocessQuantile(rgSet, fixOutliers=fixOutliers, removeBadSamples=removeBadSamples, badSampleCutoff=badSampleCutoff)
betas = getBeta(mSet)[-failed_probes,]
design = ifelse(rownames(betas) %in% getProbeInfo(rgSet, type="I")$Name, 1, 2)
bnorm = lapply(1:ncol(betas), function(i) BMIQ(betas[,i],design=design)$all)
betaValues = do.call("cbind", bnorm)
colnames(betaValues) = colnames(betas)
mValues = apply(betaValues, 2, logit2)
write.table(mValues, file=paste(targetDir, "mValues_qn.bmiq.txt", sep="/"), quote = F, sep = "\t", row.names = T, col.names = T)
write.table(betaValues, file=paste(targetDir, "betaValues_qn.bmiq.txt", sep="/"), quote = F, sep = "\t", row.names = T, col.names = T)
}

0 comments on commit 22496b5

Please sign in to comment.