#Download RTCGAToolbox source("https://bioconductor.org/biocLite.R") biocLite("RTCGAToolbox") # Download the data and copy it to the ¡°Data¡± variable Data = getFirehoseData (dataset="COAD",runDate="20160128",clinical = TRUE, RNASeqGene = TRUE, mRNAArray = TRUE, Mutation = TRUE) # Analysis of differential expressed genes (DEGs) in tumor and normal tissues, draw heatmap and volcanic map. COAD diffGenes = getDiffExpressedGenes(dataObject=Data,DrawPlots=TRUE,adj.method="BH",adj.pval=0.05,raw.pval=0.05, logFC=2,hmTopUpN=50,hmTopDownN=0) # Output the result of DEGs into CSV file toptableOut = showResults(BRCAdiffGenes[[1]]) write.csv(toptableOut,"toptableOut1.csv") #Survival analysis clinicData = getData(Data, "clinical") write.csv(clinicData,file="clinicData.csv") clinicData = clinicData[, 3:5] clinicData[is.na(clinicData[, 3]), 3] = clinicData[is.na(clinicData[, 3]), 2] survData = data.frame(Samples=rownames(clinicData), Time=as.numeric(clinicData[, 3]), Censor=as.numeric(clinicData[, 1])) getSurvival(dataObject=Data, geneSymbols=c("MYC"), sampleTimeCensor=survData) #MYC expression between tumor and normal tissues for (j in 1:length(Data@mRNAArray)) { tmpObj <- Data@mRNAArray[[j]] geneMat <- tmpObj@DataMatrix sampleIDs = colnames(geneMat) samplesDat <- data.frame(matrix(nrow = length(sampleIDs), ncol = 7)) rownames(samplesDat) <- sampleIDs for (j in 1:length(sampleIDs)) { if (grepl("\\.", sampleIDs[j])) { tmpRow <- unlist(strsplit(sampleIDs[j], split = "\\.")) samplesDat[sampleIDs[j], ] <- tmpRow } else { tmpRow <- unlist(strsplit(sampleIDs[j], split = "-")) samplesDat[sampleIDs[j], ] <- tmpRow } } sampleIDs1 <- as.character(samplesDat[, 4]) sampleIDs1 <- substr(sampleIDs1, 1, nchar(sampleIDs1) - 1) sampleIDs1 <- as.numeric(sampleIDs1) normalSamples <- rownames(samplesDat)[sampleIDs1 < 20 & sampleIDs1 > 9] tumorSamples <- rownames(samplesDat)[sampleIDs1 <10]} MYCnormal=Data@mRNAArray[[1]]@DataMatrix["MYC",normalSamples] MYCtumor=Data@mRNAArray[[1]]@DataMatrix["MYC",tumorSamples] boxplot(MYCnormal,PIK3CAtumor,col = c("blue", "red"),ylab="mRNAArray", main="MYC", names=c("normal","tumor"))