### R code from vignette source 'STROMA4-vignette.Rnw' ################################################### ### code chunk number 1: STROMA4-vignette.Rnw:44-47 ################################################### source("https://bioconductor.org/biocLite.R") #biocLite("STROMA4") library("STROMA4") ################################################### ### code chunk number 2: STROMA4-vignette.Rnw:52-54 ################################################### library(breastCancerMAINZ) data(mainz, package='breastCancerMAINZ') ################################################### ### code chunk number 3: STROMA4-vignette.Rnw:58-59 ################################################### head(fData(mainz)[, "Gene.symbol", drop=FALSE]) ################################################### ### code chunk number 4: STROMA4-vignette.Rnw:71-73 ################################################### just.stromal.properties <- assign.properties(ESet=mainz, geneID.column="Gene.symbol", genelists="Stroma4", n=10, mc.cores=1) ################################################### ### code chunk number 5: STROMA4-vignette.Rnw:80-82 ################################################### just.lehmann.properties <- assign.properties(ESet=mainz, geneID.column="Gene.symbol", genelists="TNBCType", n=10, mc.cores=1) ################################################### ### code chunk number 6: STROMA4-vignette.Rnw:89-91 ################################################### all.properties <- assign.properties(ESet=mainz, geneID.column="Gene.symbol", genelists=c("Stroma4", "TNBCType"), n=10, mc.cores=1) ################################################### ### code chunk number 7: STROMA4-vignette.Rnw:99-101 ################################################### property.cols <- grepl('properties', pData(all.properties)) print(apply(pData(all.properties)[, property.cols], 2, table)) ################################################### ### code chunk number 8: STROMA4-vignette.Rnw:110-120 ################################################### property.cols <- paste0(c('T', 'B', 'D', 'E'), '.stroma.property') patient.subtypes <- pData(just.stromal.properties)[, property.cols] for(i in c('T', 'B', 'D', 'E')) patient.subtypes[, paste0(i, '.stroma.property')] <- paste0(i, '-', patient.subtypes[, paste0(i, '.stroma.property')]) patient.subtypes <- apply(patient.subtypes, 1, paste, collapse='/') print(head(patient.subtypes))