Mercurial > repos > iuc > limma_voom
comparison limma_voom.R @ 9:4255881bebb1 draft
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 5f8052ab47b789da5ea47feb48e1b8e08b5fc1e0
author | iuc |
---|---|
date | Tue, 05 Jun 2018 04:28:56 -0400 |
parents | 00a42b66e522 |
children | e26047c4562d |
comparison
equal
deleted
inserted
replaced
8:00a42b66e522 | 9:4255881bebb1 |
---|---|
343 volOutPdf <- character() | 343 volOutPdf <- character() |
344 heatOutPdf <- character() | 344 heatOutPdf <- character() |
345 stripOutPdf <- character() | 345 stripOutPdf <- character() |
346 mdvolOutPng <- character() | 346 mdvolOutPng <- character() |
347 topOut <- character() | 347 topOut <- character() |
348 glimmaOut <- character() | |
348 for (i in 1:length(contrastData)) { | 349 for (i in 1:length(contrastData)) { |
349 con <- contrastData[i] | 350 con <- contrastData[i] |
350 con <- gsub("\\(|\\)", "", con) | 351 con <- gsub("\\(|\\)", "", con) |
351 mdOutPdf[i] <- makeOut(paste0("mdplot_", con, ".pdf")) | 352 mdOutPdf[i] <- makeOut(paste0("mdplot_", con, ".pdf")) |
352 volOutPdf[i] <- makeOut(paste0("volplot_", con, ".pdf")) | 353 volOutPdf[i] <- makeOut(paste0("volplot_", con, ".pdf")) |
353 heatOutPdf[i] <- makeOut(paste0("heatmap_", con, ".pdf")) | 354 heatOutPdf[i] <- makeOut(paste0("heatmap_", con, ".pdf")) |
354 stripOutPdf[i] <- makeOut(paste0("stripcharts_", con, ".pdf")) | 355 stripOutPdf[i] <- makeOut(paste0("stripcharts_", con, ".pdf")) |
355 mdvolOutPng[i] <- makeOut(paste0("mdvolplot_", con, ".png")) | 356 mdvolOutPng[i] <- makeOut(paste0("mdvolplot_", con, ".png")) |
356 topOut[i] <- makeOut(paste0(deMethod, "_", con, ".tsv")) | 357 topOut[i] <- makeOut(paste0(deMethod, "_", con, ".tsv")) |
358 glimmaOut[i] <- makeOut(paste0("glimma_", con, "/MD-Plot.html")) | |
357 } | 359 } |
358 | 360 |
359 normOut <- makeOut(paste0(deMethod, "_normcounts.tsv")) | 361 normOut <- makeOut(paste0(deMethod, "_normcounts.tsv")) |
360 rdaOut <- makeOut(paste0(deMethod, "_analysis.RData")) | 362 rdaOut <- makeOut(paste0(deMethod, "_analysis.RData")) |
361 sessionOut <- makeOut("session_info.txt") | 363 sessionOut <- makeOut("session_info.txt") |
803 abline(h=0, col="grey", lty=2) | 805 abline(h=0, col="grey", lty=2) |
804 linkName <- paste0("MDPlot_", con, ".pdf") | 806 linkName <- paste0("MDPlot_", con, ".pdf") |
805 linkAddr <- paste0("mdplot_", con, ".pdf") | 807 linkAddr <- paste0("mdplot_", con, ".pdf") |
806 linkData <- rbind(linkData, c(linkName, linkAddr)) | 808 linkData <- rbind(linkData, c(linkName, linkAddr)) |
807 invisible(dev.off()) | 809 invisible(dev.off()) |
810 | |
811 # Generate Glimma interactive MD plot and table, requires annotation file (assumes gene names in 2nd column) | |
812 if (haveAnno) { | |
813 Glimma::glMDPlot(fit, coef=i, counts=y$counts, anno=y$genes, groups=factors[, 1], | |
814 status=status[, i], sample.cols=col.group, | |
815 main=paste("MD Plot:", unmake.names(con)), side.main=colnames(y$genes)[2], | |
816 folder=paste0("glimma_", unmake.names(con)), launch=FALSE) | |
817 linkName <- paste0("Glimma_MDPlot_", con, ".html") | |
818 linkAddr <- paste0("glimma_", con, "/MD-Plot.html") | |
819 linkData <- rbind(linkData, c(linkName, linkAddr)) | |
820 } | |
808 | 821 |
809 # Plot Volcano | 822 # Plot Volcano |
810 pdf(volOutPdf[i]) | 823 pdf(volOutPdf[i]) |
811 if (haveAnno) { | 824 if (haveAnno) { |
812 # labels must be in second column currently | 825 # labels must be in second column currently |
1011 if (grepl(".RData", linkData$Link[i])) { | 1024 if (grepl(".RData", linkData$Link[i])) { |
1012 HtmlLink(linkData$Link[i], linkData$Label[i]) | 1025 HtmlLink(linkData$Link[i], linkData$Label[i]) |
1013 } | 1026 } |
1014 } | 1027 } |
1015 } | 1028 } |
1029 | |
1030 cata("<h4>Glimma Interactive Results:</h4>\n") | |
1031 for (i in 1:nrow(linkData)) { | |
1032 if (grepl("glimma", linkData$Link[i])) { | |
1033 HtmlLink(linkData$Link[i], linkData$Label[i]) | |
1034 } | |
1035 } | |
1016 | 1036 |
1017 cata("<p>Alt-click links to download file.</p>\n") | 1037 cata("<p>Alt-click links to download file.</p>\n") |
1018 cata("<p>Click floppy disc icon associated history item to download ") | 1038 cata("<p>Click floppy disc icon associated history item to download ") |
1019 cata("all files.</p>\n") | 1039 cata("all files.</p>\n") |
1020 cata("<p>.tsv files can be viewed in Excel or any spreadsheet program.</p>\n") | 1040 cata("<p>.tsv files can be viewed in Excel or any spreadsheet program.</p>\n") |