1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
| f_getGPL <- function(lc_GPLN, lc_local = F){ options(stringsAsFactors = F) if (!file.exists(lc_GPLN)){dir.create(lc_GPLN)} if(lc_local){ gpl=read.table(file.path(lc_GPLN, lc_GPLN), header = TRUE,fill = T,sep = "\t", comment.char = "#", stringsAsFactors = FALSE, quote = "") return(gpl) }else{ return(Table(getGEO(lc_GPLN,destdir = lc_GPLN))) } } f_id2name <- function(lc_exp, lc_db){ if(!is.data.frame(lc_db)){ lc_ids <- toTable(lc_db) }else{ lc_ids <- lc_db } res <- lc_exp[rownames(lc_exp) %in% lc_ids[[1]],] lc_ids=lc_ids[match(rownames(res),lc_ids[[1]]),] lc_tmp = by(res, lc_ids[[2]], function(x) rownames(x)[which.max(rowMeans(x))]) lc_probes = as.character(lc_tmp) res = res[rownames(res) %in% lc_probes,] rownames(res)=lc_ids[match(rownames(res),lc_ids[[1]]),2] res }
|