Skip to content

Commit

Permalink
Update glioma classifier to handle missing probes in EPIC v2. Probabl…
Browse files Browse the repository at this point in the history
…y will need to update the model later. #599
  • Loading branch information
Tiago Silva authored and Tiago Silva committed Oct 5, 2023
1 parent cc95e93 commit 573ce0e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
6 changes: 6 additions & 0 deletions R/classifiers.R
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
16 changes: 8 additions & 8 deletions vignettes/classifiers.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -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
<hr>

```{r, eval = FALSE}
classification <- gliomaClassifier(data.hg19)
classification <- gliomaClassifier(dnam)
```

## Results
Expand Down

0 comments on commit 573ce0e

Please sign in to comment.