Browse code

Add glioma classifier function from the GUI

Former-commit-id: 87ca26c2223fc6bc55154728dfbd6e5870323992 [formerly 986f30d2ccb71876b4062b03eb705d5523a01ea6]
Former-commit-id: a29c5eba559c2f955f206204b8e756546bfaaedb

Tiago Chedraoui Silva authored on 27/11/2019 18:14:10
Showing 3 changed files

... ...
@@ -83,7 +83,7 @@ test_that("TCGAanalyze_DMC is handling NAs correctly", {
83 83
         c(rep("group1", 10),  rep("group2", 10))
84 84
     hypo.hyper <-
85 85
         TCGAanalyze_DMC(data, p.cut = 0.85, "group", "group1", "group2")
86
-    result <- hypo.hyper
86
+    result <- hypo.hyper[1,]
87 87
     expect_equal(result$mean.group1, 0.9)
88 88
     expect_equal(result$mean.group2, 0.1)
89 89
     expect_equal(result$mean.group1.minus.mean.group2 , 0.8)
... ...
@@ -32,13 +32,21 @@ navbar:
32 32
           icon: fa-flask
33 33
           href: http://rpubs.com/tiagochst/atac_seq_workshop
34 34
     - text: "Analysis"
35
-      href: analysis.html
36 35
       icon: fa-flask
36
+      menu:
37
+        - text: "---------"
38
+        - text: "Analysis functions"
39
+          icon: fa-flask
40
+          href: analysis.html
41
+        - text: "Other functions"
42
+          icon: fa-flask
43
+          href: extension.html
44
+        - text: "---------"
45
+        - text: "Glioma classsifier"
46
+          icon: fa-bulleye
47
+          href: classifiers.html
37 48
     - text: "Case Study"
38 49
       href: casestudy.html
39
-    - text: "Other functions"
40
-      icon: fa-book
41
-      href: extension.html
42 50
     - text: "GUI"
43 51
       icon: fa-hand-pointer-o
44 52
       href: gui.html
45 53
new file mode 100755
... ...
@@ -0,0 +1,93 @@
1
+---
2
+title: "Classifiers methods"
3
+bibliography: bibliography.bib    
4
+vignette: >
5
+    %\VignetteIndexEntry{10. Classifiers}
6
+    %\VignetteEngine{knitr::rmarkdown}
7
+---
8
+  
9
+```{r setup, include=FALSE}
10
+knitr::opts_chunk$set(dpi = 300)
11
+knitr::opts_chunk$set(cache = FALSE)
12
+```
13
+  
14
+```{r, echo = FALSE,hide=TRUE, message=FALSE,warning=FALSE}
15
+devtools::load_all(".")
16
+```
17
+
18
+```{r message=FALSE, warning=FALSE, include=FALSE}
19
+library(SummarizedExperiment)
20
+library(dplyr)
21
+library(DT)
22
+```
23
+
24
+<br>
25
+
26
+## Classifying gliomas samples with `gliomaClassifier`
27
+
28
+Classify glioma samples with DNA methylation array based on:
29
+
30
+**Ceccarelli, Michele, et al. "Molecular profiling reveals biologically discrete subsets and pathways of progression in diffuse glioma." Cell 164.3 (2016): 550-563.** (https://doi.org/10.1016/j.cell.2015.12.028)
31
+
32
+Possible classifications are: 
33
+
34
+- Mesenchymal-like 
35
+- Classic-like
36
+- G-CIMP-high
37
+- G-CIMP-low
38
+- LGm6-GBM
39
+- Codel
40
+
41
+### Data
42
+
43
+The input data can be either a Summarized Experiment object of a matrix 
44
+(samples as columns, probes as rows) from the following platforms:
45
+
46
+- HM27
47
+- HM450 
48
+- EPIC array.
49
+
50
+In this example we will retrieve two samples from TCGA and classify them expecting 
51
+the same result as the paper.
52
+
53
+```{r, eval = TRUE, message = FALSE, results = "hide"}
54
+query <- GDCquery(project = "TCGA-GBM",
55
+                   data.category = "DNA methylation",
56
+                   barcode = c("TCGA-06-0122","TCGA-14-1456"),
57
+                   platform = "Illumina Human Methylation 27",
58
+                   legacy = TRUE)
59
+GDCdownload(query)
60
+data.hg19 <- GDCprepare(query)
61
+```
62
+
63
+```{r, eval = TRUE}
64
+assay(data.hg19)[1:5,1:2]
65
+```
66
+
67
+### Function
68
+```{r, eval = TRUE}
69
+classification <- gliomaClassifier(data.hg19)
70
+```
71
+
72
+### Results
73
+
74
+The classfier will return a list of 3 data frames:
75
+
76
+1. Sample final classification
77
+2. Each model final classification
78
+3. Each class probability of classification
79
+
80
+```{r, eval = TRUE}
81
+names(classification)
82
+classification$final.classification
83
+classification$model.classifications
84
+classification$model.probabilities
85
+```
86
+
87
+### Comparing results with paper
88
+```{R}
89
+TCGAquery_subtype("GBM") %>%
90
+ dplyr::filter(patient %in% c("TCGA-06-0122","TCGA-14-1456")) %>%
91
+ dplyr::select("patient","Supervised.DNA.Methylation.Cluster")
92
+```
93
+