1 2 3 4 5 6 7 8 9 10 11 12
| group <- t(readRDS('prad_tpm_Cu_death.rds')) clinical <- read.csv('TCGA-PRAD_clinical.csv', row.names = 'bcr_patient_barcode') 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[['gleason']] <- f_TCGA_gleason_grade(clinical$primary_gleason_grade, clinical$secondary_gleason_grade) mergeID <- intersect(rownames(clinical), rownames(group)) df <- cbind(group[mergeID,], clinical[mergeID, c('gleason', 'dcf_time', 'dcf_status', 'os_time', 'os_status')]) df[,'dcf_status'] = ifelse(df[,'dcf_status']==1,0,1) df
|