#################################### # # # Read in probe level # # 192 samples from # # Data Citation 1 # # (n = 192, p = 56044) # # # #################################### ## File names # Refer to GEO submission of Data Citation 1 for the raw .txt file file name: # e.g. US83903565_253118111471_S01_miRNA_107_Sep09_1_1.txt file.name.list <- c("US83903565_253118111471_S01_miRNA_107_Sep09_1_1.txt", ...) ## Read the data in ---- # set up the frame data.array.192 <- vector("list",3) temp <- read.table(file = file.name.list[1], sep = "\t", header = TRUE, skip = 9) probe.name.agi <- as.character(temp$ProbeName) gene.name.agi <- as.character(temp$GeneName) probe.type.agi <- temp$ControlType data.array.192[[1]] <- cbind(data.array.192[[1]],temp$gMeanSignal) data.array.192[[2]] <- cbind(data.array.192[[2]],temp$gBGMeanSignal) data.array.192[[3]] <- cbind(data.array.192[[3]],temp$gProcessedSignal) # loop through 192 samples (except the first one) for (i in 2:192){print(i) temp <- read.table(file = file.name.list[i], sep = "\t", header = TRUE, skip = 9) data.array.192[[1]] <- cbind(data.array.192[[1]],temp$gMeanSignal) data.array.192[[2]] <- cbind(data.array.192[[2]],temp$gBGMeanSignal) data.array.192[[3]] <- cbind(data.array.192[[3]],temp$gProcessedSignal) } rownames(data.array.192[[1]]) <- rownames(data.array.192[[2]]) <- rownames(data.array.192[[3]]) <- probe.name.agi colnames(data.array.192[[1]]) <- colnames(data.array.192[[2]]) <- colnames(data.array.192[[3]]) <- sub(" ", ".", list.array$SampleName) names(data.array.192) <- c("MeanSignal","BGMeanSignal","ProcessedSignal") # to matrix array.192.pro <- as.matrix(data.array.192$ProcessedSignal) array.192.fgd <- as.matrix(data.array.192$MeanSignal) array.192.bgd <- as.matrix(data.array.192$BGMeanSignal) ## get the original no background adjusted (noba) and background adjusted (ba) 192-sample randomized data ---- temp <- array.192.fgd temp[temp < 1] <- 1 noba.log2.data.a <- log2(temp) temp <- array.192.fgd - array.192.bgd temp[temp < 1] <- 1 ba.log2.data.a <- log2(temp) rownames(noba.log2.data.a) <- rownames(ba.log2.data.a) <- probe.name.agi colnames(noba.log2.data.a) <- colnames(ba.log2.data.a) <- list.array$SampleName ## save noba.log2.data.a (n = 192) ---- # enter path to directory you would like to save the data matrix path3 <- "path_to_save_data_matrix/" save(noba.log2.data.a, file = paste0(path3, "/noba.log2.data.a.Rdata"))