### R code from vignette source 'matchBox.Rnw' ################################################### ### code chunk number 1: start ################################################### options(width=85) options(continue=" ") rm(list=ls()) ################################################### ### code chunk number 2: matchBox.Rnw:151-153 (eval = FALSE) ################################################### ## source("http://bioconductor.org/biocLite.R") ## biocLite("matchBox") ################################################### ### code chunk number 3: matchBox.Rnw:157-158 ################################################### require(matchBox) ################################################### ### code chunk number 4: loadmatchBoxExpression ################################################### data(matchBoxExpression) ################################################### ### code chunk number 5: matchBox.Rnw:173-176 ################################################### sapply(matchBoxExpression, class) sapply(matchBoxExpression, dim) str(matchBoxExpression) ################################################### ### code chunk number 6: matchBox.Rnw:207-210 ################################################### sapply(matchBoxExpression, function(x) any(duplicated(x[, 1])) ) allDataBySymbolAndT <- lapply(matchBoxExpression, filterRedundant, idCol="SYMBOL", byCol="t", absolute=TRUE) ################################################### ### code chunk number 7: matchBox.Rnw:214-216 ################################################### sapply(allDataBySymbolAndT, dim) sapply(allDataBySymbolAndT, function(x) any(duplicated(x[, 1])) ) ################################################### ### code chunk number 8: matchBox.Rnw:224-227 ################################################### sapply(matchBoxExpression, function(x) any(duplicated(x[, 1])) ) allDataByEGIDAndLogFC <- lapply(matchBoxExpression, filterRedundant, idCol="ENTREZID", byCol="logFC", absolute=FALSE) ################################################### ### code chunk number 9: matchBox.Rnw:231-233 ################################################### sapply(allDataByEGIDAndLogFC, dim) sapply(allDataByEGIDAndLogFC, function(x) any(duplicated(x[, 1])) ) ################################################### ### code chunk number 10: matchBox.Rnw:242-246 ################################################### sapply(matchBoxExpression, function(x) any(duplicated(x[, 1])) ) allDataByEGIDAndMedianFDR <- lapply(matchBoxExpression, filterRedundant, idCol="ENTREZID", byCol="adj.P.Val", absolute=FALSE, method="median") ################################################### ### code chunk number 11: matchBox.Rnw:250-252 ################################################### sapply(allDataByEGIDAndMedianFDR, dim) sapply(allDataByEGIDAndMedianFDR, function(x) any(duplicated(x[, 1])) ) ################################################### ### code chunk number 12: matchBox.Rnw:263-264 ################################################### data <- mergeData(allDataBySymbolAndT, idCol="SYMBOL", byCol="t") ################################################### ### code chunk number 13: matchBox.Rnw:272-275 ################################################### sapply(allDataBySymbolAndT, dim) dim(data) str(data) ################################################### ### code chunk number 14: matchBox.Rnw:318-320 ################################################### catHigh2LowNoRefByEqualRanks <- computeCat(data = data, idCol = 1, method="equalRank", decreasing=TRUE) ################################################### ### code chunk number 15: matchBox.Rnw:327-329 ################################################### catLow2HighNoRefByEqualRanks <- computeCat(data = data, idCol = 1, method="equalRank", decreasing=FALSE) ################################################### ### code chunk number 16: matchBox.Rnw:338-340 ################################################### catHigh2LowWithRefByEqualRanks <- computeCat(data = data, idCol = 1, ref="dataSetA.t", method="equalRank", decreasing=TRUE) ################################################### ### code chunk number 17: matchBox.Rnw:346-347 ################################################### str(catHigh2LowWithRefByEqualRanks) ################################################### ### code chunk number 18: matchBox.Rnw:353-355 ################################################### catHigh2LowWithRefByEqualStats <- computeCat(data = data, idCol = 1, ref="dataSetA.t", method="equalStat", decreasing=TRUE) ################################################### ### code chunk number 19: matchBox.Rnw:361-362 ################################################### str(catHigh2LowWithRefByEqualStats) ################################################### ### code chunk number 20: matchBox.Rnw:408-409 ################################################### PIbyRefEqualRanks <- calcHypPI(data=data) ################################################### ### code chunk number 21: matchBox.Rnw:415-416 ################################################### head(PIbyRefEqualRanks) ################################################### ### code chunk number 22: matchBox.Rnw:422-423 ################################################### PIbyRefEqualRanks03 <- calcHypPI(data=data, expectedProp=0.3) ################################################### ### code chunk number 23: matchBox.Rnw:429-430 ################################################### head(PIbyRefEqualRanks03) ################################################### ### code chunk number 24: matchBox.Rnw:437-438 ################################################### PIbyRefEqualRanksQuant <- calcHypPI(data=data, prob=c(0.75, 0.9, 0.95, 0.99) ) ################################################### ### code chunk number 25: matchBox.Rnw:444-445 ################################################### head(PIbyRefEqualRanksQuant) ################################################### ### code chunk number 26: matchBox.Rnw:451-452 ################################################### PIbyRefEqualRanksNoExpectedProp <- calcHypPI(data=data, expectedProp=NULL) ################################################### ### code chunk number 27: matchBox.Rnw:458-459 ################################################### head(PIbyRefEqualRanksNoExpectedProp) ################################################### ### code chunk number 28: fig1 ################################################### plotCat(catData = catHigh2LowWithRefByEqualRanks, preComputedPI=PIbyRefEqualRanks03, cex=1.2, lwd=1.2, cexPts=1.2, spacePts=30, col=c("red", "blue"), main="CAT curves for decreasing t-statistics", where="center", legend=TRUE, legCex=1, ncol=1, plotLayout = layout(matrix(1:2, ncol = 2), widths = c(2,1))) ################################################### ### code chunk number 29: fig2 ################################################### plotCat(catData = catHigh2LowWithRefByEqualStats, cex=1.2, lwd=1.2, cexPts=1.2, spacePts=30, col=c("red", "blue"), main="CAT curves for decreasing t-statistics", where="center", legend=TRUE, legCex=1, ncol=1, plotLayout = layout(matrix(1:2, ncol = 2), widths = c(2,1))) ################################################### ### code chunk number 30: fig3 ################################################### plotCat(catData = catHigh2LowNoRefByEqualRanks, preComputedPI=PIbyRefEqualRanks, cex=1.2, lwd=1.2, cexPts=1.2, spacePts=30, main="CAT curves for decreasing t-statistics", where="center", legend=TRUE, legCex=1, ncol=1, plotLayout = layout(matrix(1:2, ncol = 2), widths = c(2,1))) ################################################### ### code chunk number 31: fig4 ################################################### plotCat(catData = catHigh2LowNoRefByEqualRanks, preComputedPI=PIbyRefEqualRanksNoExpectedProp, cex=1.2, lwd=1.2, cexPts=1.2, spacePts=30, main="CAT curves for decreasing t-statistics", where="center", legend=TRUE, legCex=1, ncol=1, plotLayout = layout(matrix(1:2, ncol = 2), widths = c(2,1))) ################################################### ### code chunk number 32: sessioInfo ################################################### toLatex(sessionInfo())