1 | subtypeClassification(eset, model = c("scmgene", "scmod1", "scmod2", "pam50", "ssp2006", "ssp2003"), cancerType = c("breast", "ovarian"))
|
eset |
|
model |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 | ##---- Should be DIRECTLY executable !! ----
##-- ==> Define data, use random,
##-- or do help(data=index) for the standard data sets.
## The function is currently defined as
function (eset, model = c("scmgene", "scmod1", "scmod2", "pam50",
"ssp2006", "ssp2003"))
{
require(genefu)
require(Biobase)
model <- match.arg(model)
sbt.conv <- rbind(c("ER+/HER2- Low Prolif", "LumA"), c("ER+/HER2- High Prolif",
"LumB"), c("HER2+", "Her2"), c("ER-/HER2-", "Basal"))
colnames(sbt.conv) <- c("SCM.nomenclature", "SSP.nomenclature")
sbtn2 <- c("LumA", "LumB", "Her2", "Basal", "Normal")
datage <- t(Biobase::exprs(eset))
annotge <- cbind(probe = rownames(Biobase::featureData(eset)@data),
EntrezGene.ID = as.character(Biobase::featureData(eset)@data[,
"ENTREZID"]))
rownames(annotge) <- as.character(annotge[, "probe"])
switch(model, scmgene = {
sbts <- genefu::subtype.cluster.predict(sbt.model = scmgene.robust,
data = datage, annot = annotge, do.mapping = TRUE)[c("subtype2",
"subtype.proba2")]
names(sbts) <- c("subtype", "subtype.proba")
ss <- factor(x = sbts$subtype)
levels(ss)[match(sbt.conv[!is.na(sbt.conv[, "SCM.nomenclature"]),
"SCM.nomenclature"], levels(ss))] <- sbt.conv[!is.na(sbt.conv[,
"SCM.nomenclature"]), "SSP.nomenclature"]
sbts$subtype <- as.character(ss)
iix <- match(sbt.conv[!is.na(sbt.conv[, "SCM.nomenclature"]),
"SCM.nomenclature"], colnames(sbts$subtype.proba))
colnames(sbts$subtype.proba)[iix] <- sbt.conv[!is.na(sbt.conv[,
"SCM.nomenclature"]), "SSP.nomenclature"]
}, scmod1 = {
sbts <- genefu::subtype.cluster.predict(sbt.model = scmod1.robust,
data = datage, annot = annotge, do.mapping = TRUE)[c("subtype2",
"subtype.proba2")]
names(sbts) <- c("subtype", "subtype.proba")
ss <- factor(x = sbts$subtype)
levels(ss)[match(sbt.conv[!is.na(sbt.conv[, "SCM.nomenclature"]),
"SCM.nomenclature"], levels(ss))] <- sbt.conv[!is.na(sbt.conv[,
"SCM.nomenclature"]), "SSP.nomenclature"]
sbts$subtype <- as.character(ss)
iix <- match(sbt.conv[!is.na(sbt.conv[, "SCM.nomenclature"]),
"SCM.nomenclature"], colnames(sbts$subtype.proba))
colnames(sbts$subtype.proba)[iix] <- sbt.conv[!is.na(sbt.conv[,
"SCM.nomenclature"]), "SSP.nomenclature"]
}, scmod2 = {
sbts <- genefu::subtype.cluster.predict(sbt.model = scmod2.robust,
data = datage, annot = annotge, do.mapping = TRUE)[c("subtype2",
"subtype.proba2")]
names(sbts) <- c("subtype", "subtype.proba")
ss <- factor(x = sbts$subtype)
levels(ss)[match(sbt.conv[!is.na(sbt.conv[, "SCM.nomenclature"]),
"SCM.nomenclature"], levels(ss))] <- sbt.conv[!is.na(sbt.conv[,
"SCM.nomenclature"]), "SSP.nomenclature"]
sbts$subtype <- as.character(ss)
iix <- match(sbt.conv[!is.na(sbt.conv[, "SCM.nomenclature"]),
"SCM.nomenclature"], colnames(sbts$subtype.proba))
colnames(sbts$subtype.proba)[iix] <- sbt.conv[!is.na(sbt.conv[,
"SCM.nomenclature"]), "SSP.nomenclature"]
}, pam50 = {
sbts <- genefu::intrinsic.cluster.predict(sbt.model = pam50.robust,
data = datage, annot = annotge, do.mapping = TRUE)[c("subtype",
"subtype.proba")]
}, ssp2006 = {
sbts <- genefu::intrinsic.cluster.predict(sbt.model = ssp2006.robust,
data = datage, annot = annotge, do.mapping = TRUE)[c("subtype",
"subtype.proba")]
}, ssp2003 = {
sbts <- genefu::intrinsic.cluster.predict(sbt.model = ssp2003.robust,
data = datage, annot = annotge, do.mapping = TRUE)[c("subtype",
"subtype.proba")]
}, {
stop("Unknown subtype classification model")
})
colnames(sbts$subtype.proba) <- paste("subtyproba", colnames(sbts$subtype.proba),
sep = ".")
Biobase::phenoData(eset)@data <- cbind(Biobase::phenoData(eset)@data,
subtype = sbts$subtype, sbts$subtype.proba)
return(eset)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.