title: 格里森评分数据处理 tags: [] id: '1958' categories:
uncategorized
f_TCGA_gleason_grade <- function(primary_gleason_grade, secondary_gleason_grade){
primary_gleason_grade <- as.numeric(unlist(data.frame(strsplit(primary_gleason_grade, ' '))[2,]))
secondary_gleason_grade <- as.numeric(unlist(data.frame(strsplit(secondary_gleason_grade, ' '))[2,]))
primary_gleason_grade + secondary_gleason_grade
}
clinical <- readRDS('../../../zl_liu_new/Bulk/tcga/PRAD/clinical.rds')
tmp <- clinical[c('psa', 'age_at_initial_pathologic_diagnosis', 'ajcc_pathologic_t', 'ajcc_pathologic_n', 'ajcc_clinical_m')]
names(tmp) <- c('PSA', 'Age', 'T', 'N', 'M')
tmp$GS <- f_TCGA_gleason_grade(clinical$primary_gleason_grade, clinical$secondary_gleason_grade)
tmp$T <- factor(tmp$T, ordered = T)
tmp$N <- factor(tmp$N, ordered = T)
tmp$M <- factor(tmp$M, ordered = T)