# HG changeset patch # User galaxyp # Date 1547071164 18000 # Node ID ed0bb50d7ffe1c4b0b3e9e532fabe20e42c97fd2 # Parent bcc7a4c4cc299c4981c3cd353efb64e1531d3ad2 planemo upload commit bd6bc95760db6832c77d4d2872281772c31f9039 diff -r bcc7a4c4cc29 -r ed0bb50d7ffe quantp.r --- a/quantp.r Thu Dec 20 16:06:05 2018 -0500 +++ b/quantp.r Wed Jan 09 16:59:24 2019 -0500 @@ -60,9 +60,9 @@ dev.off(); suppressWarnings(g <- autoplot(regmodel, label = FALSE)[[1]] + - geom_point(aes(text=sprintf("Residual: %.2f
Fitted value: %.2f
Gene: %s", .fitted, .resid, PE_TE_data$PE_ID)), - shape = 1, size = .1, stroke = .2) + - theme_light()) + geom_point(aes(text=sprintf("Residual: %.2f
Fitted value: %.2f
Gene: %s", .fitted, .resid, PE_TE_data$PE_ID)), + shape = 1, size = .1, stroke = .2) + + theme_light()) saveWidget(ggplotly(g, tooltip= c("text")), file.path(gsub("\\.png", "\\.html", outplot))) outplot = paste(outdir,"/PE_TE_lm_2.png",sep="",collapse=""); @@ -74,9 +74,9 @@ dev.off(); suppressWarnings(g <- autoplot(regmodel, label = FALSE)[[2]] + - geom_point(aes(text=sprintf("Standarized residual: %.2f
Theoretical quantile: %.2f
Gene: %s", .qqx, .qqy, PE_TE_data$PE_ID)), - shape = 1, size = .1) + - theme_light()) + geom_point(aes(text=sprintf("Standarized residual: %.2f
Theoretical quantile: %.2f
Gene: %s", .qqx, .qqy, PE_TE_data$PE_ID)), + shape = 1, size = .1) + + theme_light()) saveWidget(ggplotly(g, tooltip = "text"), file.path(gsub("\\.png", "\\.html", outplot))) @@ -91,9 +91,9 @@ cd_cont_neg <- function(leverage, level, model) {-cd_cont_pos(leverage, level, model)} suppressWarnings(g <- autoplot(regmodel, label = FALSE)[[4]] + - aes(label = PE_TE_data$PE_ID) + - geom_point(aes(text=sprintf("Leverage: %.2f
Standardized residual: %.2f
Gene: %s", .hat, .stdresid, PE_TE_data$PE_ID))) + - theme_light()) + aes(label = PE_TE_data$PE_ID) + + geom_point(aes(text=sprintf("Leverage: %.2f
Standardized residual: %.2f
Gene: %s", .hat, .stdresid, PE_TE_data$PE_ID))) + + theme_light()) saveWidget(ggplotly(g, tooltip = "text"), file.path(gsub("\\.png", "\\.html", outplot))) cat('', file = htmloutfile, append = TRUE); @@ -215,7 +215,7 @@ cooksd_df[cooksd_df$cooksd > cutoff,]$colors <- "red" g <- ggplot(cooksd_df, aes(x = index, y = cooksd, label = row.names(cooksd_df), color=as.factor(colors), - text=sprintf("Gene: %s
Cook's Distance: %.3f", row.names(cooksd_df), cooksd))) + + text=sprintf("Gene: %s
Cook's Distance: %.3f", row.names(cooksd_df), cooksd))) + ggtitle("Influential Obs. by Cook's distance") + xlab("Observations") + ylab("Cook's Distance") + #xlim(0, 3000) + ylim(0, .15) + scale_shape_discrete(solid=F) + @@ -275,10 +275,10 @@ png(outplot, width = 10, height = 10, units = 'in', res=300); # bitmap(outplot,"png16m"); suppressWarnings(g <- ggplot(PE_TE_data_no_outlier, aes(x=TE_abundance, y=PE_abundance, label=PE_ID)) + geom_smooth() + - xlab("Transcript abundance log fold-change") + ylab("Protein abundance log fold-change") + - xlim(min_lim,max_lim) + ylim(min_lim,max_lim) + - geom_point(aes(text=sprintf("Gene: %s
Transcript Abundance (log fold-change): %.3f
Protein Abundance (log fold-change): %.3f", - PE_ID, TE_abundance, PE_abundance)))) + xlab("Transcript abundance log fold-change") + ylab("Protein abundance log fold-change") + + xlim(min_lim,max_lim) + ylim(min_lim,max_lim) + + geom_point(aes(text=sprintf("Gene: %s
Transcript Abundance (log fold-change): %.3f
Protein Abundance (log fold-change): %.3f", + PE_ID, TE_abundance, PE_abundance)))) suppressMessages(plot(g)) suppressMessages(saveWidget(ggplotly(g, tooltip="text"), file.path(gsub("\\.png", "\\.html", outplot)))) dev.off(); @@ -440,9 +440,9 @@ # Interactive plot for k-means clustering g <- ggplot(PE_TE_data, aes(x = TE_abundance, y = PE_abundance, label = row.names(PE_TE_data), - text=sprintf("Gene: %s
Transcript Abundance: %.3f
Protein Abundance: %.3f", - PE_ID, TE_abundance, PE_abundance), - color=as.factor(k1$cluster))) + + text=sprintf("Gene: %s
Transcript Abundance: %.3f
Protein Abundance: %.3f", + PE_ID, TE_abundance, PE_abundance), + color=as.factor(k1$cluster))) + xlab("Transcript Abundance") + ylab("Protein Abundance") + scale_shape_discrete(solid=F) + geom_smooth(method = "loess", span = 2/3) + geom_point(size = 1, shape = 8) + @@ -475,11 +475,11 @@ png(outfile, width = 10, height = 10, units = 'in', res=300); # bitmap(outfile, "png16m"); suppressWarnings(g <- ggplot(PE_TE_data, aes(x=TE_abundance, y=PE_abundance, label=PE_ID)) + geom_smooth() + - xlab("Transcript abundance log fold-change") + ylab("Protein abundance log fold-change") + - xlim(min_lim,max_lim) + ylim(min_lim,max_lim) + - geom_point(aes(text=sprintf("Gene: %s
Transcript Abundance (log fold-change): %.3f
Protein Abundance (log fold-change): %.3f", - PE_ID, TE_abundance, PE_abundance)), - size = .5)) + xlab("Transcript abundance log fold-change") + ylab("Protein abundance log fold-change") + + xlim(min_lim,max_lim) + ylim(min_lim,max_lim) + + geom_point(aes(text=sprintf("Gene: %s
Transcript Abundance (log fold-change): %.3f
Protein Abundance (log fold-change): %.3f", + PE_ID, TE_abundance, PE_abundance)), + size = .5)) suppressMessages(plot(g)) suppressMessages(saveWidget(ggplotly(g, tooltip = "text"), file.path(gsub("\\.png", "\\.html", outfile)))) dev.off(); @@ -682,8 +682,8 @@ dev.off(); g <- ggplot(PE_df_logfold, aes(x = LogFold, -log10(PE_pval), color = as.factor(color), - text=sprintf("Gene: %s
Log2 Fold-Change: %.3f
-log10 p-value: %.3f
p-value: %.3f", - Genes, LogFold, -log10(PE_pval), PE_pval))) + + text=sprintf("Gene: %s
Log2 Fold-Change: %.3f
-log10 p-value: %.3f
p-value: %.3f", + Genes, LogFold, -log10(PE_pval), PE_pval))) + xlab("log2 fold change") + ylab("-log10 p-value") + geom_point(shape=1, size = 1.5, stroke = .2) + scale_color_manual(values = c("black" = "black", "red" = "red", "blue" = "blue")) + @@ -722,7 +722,7 @@ dev.off(); g <- ggplot(TE_df_logfold, aes(x = LogFold, -log10(TE_pval), color = as.factor(color), - text=sprintf("Gene: %s
Log2 Fold-Change: %.3f
-log10 p-value: %.3f
p-value: %.3f", + text=sprintf("Gene: %s
Log2 Fold-Change: %.3f
-log10 p-value: %.3f
p-value: %.3f", Genes, LogFold, -log10(TE_pval), TE_pval))) + xlab("log2 fold change") + ylab("-log10 p-value") + geom_point(shape=1, size = 1.5, stroke = .2) + @@ -974,28 +974,33 @@ # TE Boxplot outplot = paste(outdir,"/Box_TE.png",sep="",collape=""); + multisample_boxplot(TE_df, sampleinfo_df, outplot, "Yes", "Samples", "Transcript Abundance data"); + lines <- extractWidgetCode(outplot) + prescripts <- c(prescripts, lines$prescripts) + postscripts <- c(postscripts, lines$postscripts) cat('
\n', '\n', - "\n', file = htmloutfile, append = TRUE); - multisample_boxplot(TE_df, sampleinfo_df, outplot, "Yes", "Samples", "Transcript Abundance data"); + "\n', file = htmloutfile, append = TRUE); # PE Boxplot outplot = paste(outdir,"/Box_PE.png",sep="",collape=""); - cat("
Boxplot: Transcriptome dataBoxplot: Proteome data
", '
", '', lines$widget_div, '", '
\n', file = htmloutfile, append = TRUE); multisample_boxplot(PE_df, sampleinfo_df, outplot, "Yes", "Samples", "Protein Abundance data"); - + lines <- extractWidgetCode(outplot) + postscripts <- c(postscripts, lines$postscripts) + cat("", '', lines$widget_div, + '\n', file = htmloutfile, append = TRUE); cat('

CORRELATION

\n', file = htmloutfile, append = TRUE); # TE PE scatter + PE_TE_data = data.frame(PE_df, TE_df); + colnames(PE_TE_data) = c("PE_ID","PE_abundance","TE_ID","TE_abundance"); outplot = paste(outdir,"/TE_PE_scatter.png",sep="",collape=""); cat('\n', file = htmloutfile, append = TRUE); singlesample_scatter(PE_TE_data, outplot); lines <- extractWidgetCode(outplot); postscripts <- c(postscripts, lines$postscripts); - cat("\n', file = htmloutfile, append = TRUE); - PE_TE_data = data.frame(PE_df, TE_df); - colnames(PE_TE_data) = c("PE_ID","PE_abundance","TE_ID","TE_abundance"); + cat("\n', file = htmloutfile, append = TRUE); # TE PE Cor cat("
Scatter plot between Proteome and Transcriptome Abundance
", '', lines$widget_div, '
", '', gsub('width:500px;height:500px', 'width:800px;height:800px' , lines$widget_div), '
", file = htmloutfile, append = TRUE); @@ -1014,7 +1019,9 @@ extractWidgetCode(paste(outdir,"/PE_TE_lm_2.png",sep="",collapse=""))$postscripts, extractWidgetCode(paste(outdir,"/PE_TE_lm_5.png",sep="",collapse=""))$postscripts, extractWidgetCode(paste(outdir,"/PE_TE_lm_cooksd.png",sep="",collapse=""))$postscripts, - extractWidgetCode(paste(outdir,"/AbundancePlot_scatter_without_outliers.png",sep="",collapse=""))$postscripts)); + extractWidgetCode(paste(outdir,"/AbundancePlot_scatter_without_outliers.png",sep="",collapse=""))$postscripts, + gsub('data-for="html', 'data-for="secondhtml"', + extractWidgetCode(paste(outdir,"/TE_PE_scatter.png",sep="",collapse=""))$postscripts))) cat('

CLUSTER ANALYSIS

\n', file = htmloutfile, append = TRUE); diff -r bcc7a4c4cc29 -r ed0bb50d7ffe quantp.xml --- a/quantp.xml Thu Dec 20 16:06:05 2018 -0500 +++ b/quantp.xml Wed Jan 09 16:59:24 2019 -0500 @@ -1,4 +1,4 @@ - + Correlation between protein and transcript abundances r-data.table @@ -7,7 +7,7 @@ r-ggplot2 r-ggfortify r-plotly - r-d3heatmap + r-d3heatmap + + + + + + + + + + + + + + + + + +