diff --git a/R/classifiers.R b/R/classifiers.R index fc6ae1776..8bbeada5d 100644 --- a/R/classifiers.R +++ b/R/classifiers.R @@ -72,6 +72,12 @@ gliomaClassifier <- function(data){ } } + # For missing probes add values to 0.5 + missing_probes <- setdiff(colnames(model$trainingData), colnames(met)) + missing_probes_matrix <- matrix(rep(0.5, nrow(met) * length(missing_probes)),nrow = nrow(met)) + colnames(missing_probes_matrix) <- missing_probes + aux <- bind_cols(aux,missing_probes_matrix) + pred <- predict(model, aux) pred.prob <- predict(model, aux, type = "prob") colnames(pred.prob) <- paste0(i,"_", colnames(pred.prob)) diff --git a/vignettes/classifiers.Rmd b/vignettes/classifiers.Rmd index fcd40cd86..8ed46b1cf 100755 --- a/vignettes/classifiers.Rmd +++ b/vignettes/classifiers.Rmd @@ -55,25 +55,25 @@ the same result as the paper. ```{r, eval = FALSE, message = FALSE, results = "hide"} query <- GDCquery( - project = "TCGA-GBM", - data.category = "DNA methylation", - barcode = c("TCGA-06-0122","TCGA-14-1456"), - platform = "Illumina Human Methylation 27", - legacy = TRUE + project = "TCGA-GBM", + data.category = "DNA Methylation", + barcode = c("TCGA-06-0122","TCGA-14-1456"), + platform = "Illumina Human Methylation 27", + data.type = "Methylation Beta Value" ) GDCdownload(query) -data.hg19 <- GDCprepare(query) +dnam <- GDCprepare(query) ``` ```{r, eval = FALSE} -assay(data.hg19)[1:5,1:2] +assay(dnam)[1:5,1:2] ``` ## Function
```{r, eval = FALSE} -classification <- gliomaClassifier(data.hg19) +classification <- gliomaClassifier(dnam) ``` ## Results