1
1
library(" tidyverse" )
2
+ # in case you cannot install tidyverse package, please uncomment the packages below
3
+ # library("readr")
4
+ # library("tibble")
5
+ # library("dplyr")
6
+ # library("tidyr")
7
+ # library("ggplot2")
2
8
library(" magrittr" )
3
9
library(" DESeq" )
4
10
library(" e1071" )
@@ -14,7 +20,7 @@ readcounts <- read_tsv("data/readcounts_96_nodup.tsv", col_names = T)
14
20
# the column "recurStatus" shows the recurrence status of the patient, R = recurrence, N = non-recurrence
15
21
patient_info <- read_csv(" data/patient_info.csv" , col_names = T ) # recurrence status file
16
22
17
- # generate sample_recurStatus dataframe with the same sampel order in tpm and reacounts
23
+ # generate sample_recurStatus dataframe with the same sample order in tpm and reacounts
18
24
sampel_recurStatus <- patient_info %> % arrange(match(sampleID , colnames(readcounts )[- 1 ])) %> %
19
25
select(sampleID , recurStatus )
20
26
@@ -38,7 +44,8 @@ rank_marker_gene <- res %>% filter(id %in% preselectedList) %>%
38
44
# top 30, 60, 90, ... 720, 750
39
45
geneNum <- seq(30 , 750 , 30 )
40
46
41
- # calculate average AUC of SVM based on each subset of biomarker genes
47
+ # calculate average AUC of SVM based on each subset of biomarker genes
48
+ # need several minutes to complete the loop
42
49
43
50
averageAUC <- rep(0 , length(geneNum ))
44
51
for (i in 1 : length(geneNum )){
@@ -153,4 +160,4 @@ ggplot(roc_data, aes(x = x, y = y, group = runtime, col = runtime)) + geom_line(
153
160
x = 0.65 , y = 0.2 , size = 3 )
154
161
155
162
ggsave(' ROCplot.pdf' , width = 4 , height = 4 )
156
-
163
+ column_to_rownames()
0 commit comments