Rollup for java clustering

This commit is contained in:
2024-08-16 17:07:57 -04:00
parent 38b3f66695
commit d1380f9c3b
6032 changed files with 23267 additions and 924 deletions

View File

@@ -39,8 +39,8 @@ Name2 <- Labels[expNumber2, 2]
go_terms_file <- "Average_GOTerms_All.csv"
input_file1 <- file.path(output_dir, exp_name, go_terms_file)
input_file2 <- file.path(output_dir, exp_name2, go_terms_file)
pairDirL <- file.path(output_dir, paste("PairwiseCompareL_", exp_name, "-", exp_name2, sep = ""))
pairDirK <- file.path(output_dir, paste("PairwiseCompareK_", exp_name, "-", exp_name2, sep = ""))
pairDirL <- file.path(output_dir, paste0("PairwiseCompareL_", exp_name, "-", exp_name2))
pairDirK <- file.path(output_dir, paste0("PairwiseCompareK_", exp_name, "-", exp_name2))
# Pairwise L
# outputPlotly <- "../GTAresults/PairwiseCompareL/" #"/GTAresults/PairwiseCompareL/"
@@ -146,7 +146,7 @@ gg <- ggplot(data = X, aes(
SD_1 = Z_lm_L_SD_X1,
SD_2 = Z_lm_L_SD_X2
)) +
xlab(paste("GO Term Avg lm Z for ", Name1, sep = "")) +
xlab(paste("GO Term Avg lm Z for", Name1)) +
geom_rect(
aes(xmin = -2, xmax = 2, ymin = -2, ymax = 2),
color = "grey20",
@@ -156,12 +156,12 @@ gg <- ggplot(data = X, aes(
fill = NA
) +
geom_point(shape = 3) +
ylab(paste("GO Term Avg lm Z for ", Name2, sep = "")) +
ggtitle(paste("Comparing Average GO Term Z lm for ", Name1, " vs. ", Name2, sep = "")) +
ylab(paste("GO Term Avg lm Z for", Name2)) +
ggtitle(paste("Comparing Average GO Term Z lm for", Name1, " vs. ", Name2) +
theme_Publication_legend_right()
pdf(
file.path(pairDirL, paste("Scatter_lm_GTA_Averages_", Name1, "_vs_", Name2, "_All_ByOntology.pdf", sep = "")),
file.path(pairDirL, paste0("Scatter_lm_GTA_Averages_", Name1, "_vs_", Name2, "_All_ByOntology.pdf")),
width = 12,
height = 8
)
@@ -169,7 +169,7 @@ pdf(
gg
dev.off()
pgg <- ggplotly(gg)
fname <- file.path(pairDirL, paste("Scatter_lm_GTA_Averages_", Name1, "_vs_", Name2, "_All_byOntology.html", sep = ""))
fname <- file.path(pairDirL, paste0("Scatter_lm_GTA_Averages_", Name1, "_vs_", Name2, "_All_byOntology.html"))
htmlwidgets::saveWidget(pgg, fname)
# ID aggravators and alleviators, regardless of whether they meet 2SD threshold
@@ -209,7 +209,7 @@ gg <- ggplot(data = X, aes(
SD_1 = Z_lm_L_SD_X1,
SD_2 = Z_lm_L_SD_X2
)) +
xlab(paste("GO Term Avg lm Z for ", Name1, sep = "")) +
xlab(paste("GO Term Avg lm Z for", Name1)) +
geom_rect(
aes(xmin = -2, xmax = 2, ymin = -2, ymax = 2),
color = "grey20",
@@ -219,12 +219,12 @@ gg <- ggplot(data = X, aes(
fill = NA
) +
geom_point(shape = 3) +
ylab(paste("GO Term Avg lm Z for ", Name2, sep = "")) +
ggtitle(paste("Comparing Average GO Term Z lm for ", Name1, " vs. ", Name2, sep = "")) +
ylab(paste("GO Term Avg lm Z for", Name2)) +
ggtitle(paste("Comparing Average GO Term Z lm for", Name1, " vs. ", Name2)) +
theme_Publication_legend_right()
pdf(
file.path(pairDirL, paste("Scatter_lm_GTA_Averages_", Name1, "_vs_", Name2, "_All_ByOverlap.pdf", sep = "")),
file.path(pairDirL, paste0("Scatter_lm_GTA_Averages_", Name1, "_vs_", Name2, "_All_ByOverlap.pdf")),
width = 12,
height = 8
)
@@ -232,7 +232,7 @@ pdf(
gg
dev.off()
pgg <- ggplotly(gg)
fname <- file.path(pairDirL, paste("Scatter_lm_GTA_Averages_", Name1, "_vs_", Name2, "_All_byOverlap.html", sep = ""))
fname <- file.path(pairDirL, paste0("Scatter_lm_GTA_Averages_", Name1, "_vs_", Name2, "_All_byOverlap.html"))
htmlwidgets::saveWidget(pgg, fname)
x_rem2_gene <- X[X$NumGenes_Avg_X1 >= 2 & X$NumGenes_Avg_X2 >= 2, ]
@@ -249,15 +249,15 @@ gg <- ggplot(data = x_rem2_gene, aes(
SD_1 = Z_lm_L_SD_X1,
SD_2 = Z_lm_L_SD_X2
)) +
xlab(paste("GO Term Avg lm Z for ", Name1, sep = "")) +
xlab(paste("GO Term Avg lm Z for", Name1)) +
geom_rect(aes(xmin = -2, xmax = 2, ymin = -2, ymax = 2), color = "grey20", size = 0.25, alpha = 0.1, inherit.aes = FALSE, fill = NA) +
geom_point(shape = 3) +
ylab(paste("GO Term Avg lm Z for ", Name2, sep = "")) +
ggtitle(paste("Comparing Average GO Term Z lm for ", Name1, " vs. ", Name2, sep = "")) +
ylab(paste("GO Term Avg lm Z for", Name2)) +
ggtitle(paste("Comparing Average GO Term Z lm for", Name1, "vs.", Name2)) +
theme_Publication_legend_right()
pdf(
file.path(pairDirL, paste("Scatter_lm_GTA_Averages_", Name1, "_vs_", Name2, "_All_ByOverlap_above2genes.pdf", sep = "")),
file.path(pairDirL, paste0("Scatter_lm_GTA_Averages_", Name1, "_vs_", Name2, "_All_ByOverlap_above2genes.pdf")),
width = 12,
height = 8
)
@@ -266,7 +266,7 @@ gg
dev.off()
pgg <- ggplotly(gg)
#pgg
fname <- file.path(pairDirL, paste("Scatter_lm_GTA_Averages_", Name1, "_vs_", Name2, "_All_byOverlap_above2genes.html", sep = ""))
fname <- file.path(pairDirL, paste0("Scatter_lm_GTA_Averages_", Name1, "_vs_", Name2, "_All_byOverlap_above2genes.html"))
htmlwidgets::saveWidget(pgg, fname)
#4
@@ -282,15 +282,15 @@ gg <- ggplot(data = X_overlap_nothresold, aes(
SD_1 = Z_lm_L_SD_X1,
SD_2 = Z_lm_L_SD_X2
)) +
xlab(paste("GO Term Avg lm Z for ", Name1, sep = "")) +
xlab(paste("GO Term Avg lm Z for", Name1)) +
geom_rect(aes(xmin = -2, xmax = 2, ymin = -2, ymax = 2), color = "grey20", size = 0.25, alpha = 0.1, inherit.aes = FALSE, fill = NA) +
geom_point(shape = 3) +
ylab(paste("GO Term Avg lm Z for ", Name2, sep = "")) +
ggtitle(paste("Comparing Average GO Term Z lm for ", Name1, " vs. ", Name2, sep = "")) +
ylab(paste("GO Term Avg lm Z for", Name2)) +
ggtitle(paste("Comparing Average GO Term Z lm for", Name1, "vs.", Name2)) +
theme_Publication_legend_right()
pdf(
file.path(pairDirL, paste("Scatter_lm_GTA_Averages_", Name1, "_vs_", Name2, "_Above2SD_ByOverlap.pdf", sep = "")),
file.path(pairDirL, paste0("Scatter_lm_GTA_Averages_", Name1, "_vs_", Name2, "_Above2SD_ByOverlap.pdf")),
width = 12,
height = 8
)
@@ -299,7 +299,7 @@ gg
dev.off()
pgg <- ggplotly(gg)
#pgg
fname <- file.path(pairDirL, paste("Scatter_lm_GTA_Averages_", Name1, "_vs_", Name2, "_Above2SD_ByOverlap.html", sep = ""))
fname <- file.path(pairDirL, paste0("Scatter_lm_GTA_Averages_", Name1, "_vs_", Name2, "_Above2SD_ByOverlap.html"))
htmlwidgets::saveWidget(pgg, fname)
# Only output GTA terms where average score is still above 2 after subtracting the SD
@@ -345,15 +345,15 @@ gg <- ggplot(data = X_abovethreshold, aes(
SD_1 = Z_lm_L_SD_X1,
SD_2 = Z_lm_L_SD_X2
)) +
xlab(paste("GO Term Avg lm Z for ", Name1, sep = "")) +
xlab(paste("GO Term Avg lm Z for", Name1)) +
geom_rect(aes(xmin = -2, xmax = 2, ymin = -2, ymax = 2), color = "grey20", size = 0.25, alpha = 0.1, inherit.aes = FALSE, fill = NA) +
geom_point(shape = 3) +
ylab(paste("GO Term Avg lm Z for ", Name2, sep = "")) +
ggtitle(paste("Comparing Average GO Term Z lm for ", Name1, " vs. ", Name2, sep = "")) +
ylab(paste("GO Term Avg lm Z for", Name2)) +
ggtitle(paste("Comparing Average GO Term Z lm for", Name1, " vs. ", Name2)) +
theme_Publication_legend_right()
pdf(
file.path(pairDirL, paste("Scatter_lm_GTA_Averages_", Name1, "_vs_", Name2, "_All_ByOverlap_AboveThreshold.pdf", sep = "")),
file.path(pairDirL, paste0("Scatter_lm_GTA_Averages_", Name1, "_vs_", Name2, "_All_ByOverlap_AboveThreshold.pdf")),
width = 12,
height = 8
)
@@ -362,7 +362,7 @@ gg
dev.off()
pgg <- ggplotly(gg)
#pgg
fname <- file.path(pairDirL, paste("Scatter_lm_GTA_Averages_", Name1, "_vs_", Name2, "_All_ByOverlap_AboveThreshold.html", sep = ""))
fname <- file.path(pairDirL, paste0("Scatter_lm_GTA_Averages_", Name1, "_vs_", Name2, "_All_ByOverlap_AboveThreshold.html"))
htmlwidgets::saveWidget(pgg, fname)
#6
@@ -377,16 +377,16 @@ gg <- ggplot(data = X_abovethreshold, aes(
SD_1 = Z_lm_L_SD_X1,
SD_2 = Z_lm_L_SD_X2
)) +
xlab(paste("GO Term Avg lm Z for ", Name1, sep = "")) +
xlab(paste("GO Term Avg lm Z for", Name1)) +
geom_text(aes(label = Term_Avg), nudge_y = 0.25, size = 2) +
geom_rect(aes(xmin = -2, xmax = 2, ymin = -2, ymax = 2), color = "grey20", size = 0.25, alpha = 0.1, inherit.aes = FALSE, fill = NA) +
geom_point(shape = 3, size = 3) +
ylab(paste("GO Term Avg lm Z for ", Name2, sep = "")) +
ggtitle(paste("Comparing Average GO Term Z lm for ", Name1, " vs. ", Name2, sep = "")) +
ylab(paste("GO Term Avg lm Z for", Name2)) +
ggtitle(paste("Comparing Average GO Term Z lm for", Name1, "vs.", Name2)) +
theme_Publication_legend_right()
pdf(
file.path(pairDirL, paste("Scatter_lm_GTA_Averages_", Name1, "_vs_", Name2, "_All_ByOverlap_AboveThreshold_names.pdf", sep = "")),
file.path(pairDirL, paste0("Scatter_lm_GTA_Averages_", Name1, "_vs_", Name2, "_All_ByOverlap_AboveThreshold_names.pdf")),
width = 20,
height = 20
)
@@ -395,7 +395,7 @@ gg
dev.off()
pgg <- ggplotly(gg)
#pgg
fname <- file.path(pairDirL, paste("Scatter_lm_GTA_Averages_", Name1, "_vs_", Name2, "_All_ByOverlap_AboveThreshold_names.html", sep = ""))
fname <- file.path(pairDirL, paste0("Scatter_lm_GTA_Averages_", Name1, "_vs_", Name2, "_All_ByOverlap_AboveThreshold_names.html"))
htmlwidgets::saveWidget(pgg, fname)
X_abovethreshold$X1_Rank <- NA
@@ -415,16 +415,16 @@ gg <- ggplot(data = X_abovethreshold, aes(
SD_1 = Z_lm_L_SD_X1,
SD_2 = Z_lm_L_SD_X2
)) +
xlab(paste("GO Term Avg lm Z for ", Name1, sep = "")) +
xlab(paste("GO Term Avg lm Z for", Name1)) +
geom_text(aes(label = X1_Rank), nudge_y = 0.25, size = 4) +
geom_rect(aes(xmin = -2, xmax = 2, ymin = -2, ymax = 2), color = "grey20", size = 0.25, alpha = 0.1, inherit.aes = FALSE, fill = NA) +
geom_point(shape = 3, size = 3) +
ylab(paste("GO Term Avg lm Z for ", Name2, sep = "")) +
ggtitle(paste("Comparing Average GO Term Z lm for ", Name1, " vs. ", Name2, sep = "")) +
ylab(paste("GO Term Avg lm Z for", Name2)) +
ggtitle(paste("Comparing Average GO Term Z lm for", Name1, "vs.", Name2)) +
theme_Publication_legend_right()
pdf(
file.path(pairDirL, paste("Scatter_lm_GTA_Averages_", Name1, "_vs_", Name2, "_All_ByOverlap_AboveThreshold_numberedX1.pdf", sep = "")),
file.path(pairDirL, paste0("Scatter_lm_GTA_Averages_", Name1, "_vs_", Name2, "_All_ByOverlap_AboveThreshold_numberedX1.pdf")),
width = 15,
height = 15
)
@@ -435,7 +435,7 @@ pgg <- ggplotly(gg)
#pgg
fname <-
file.path(pairDirL, paste("Scatter_lm_GTA_Averages_", Name1, "_vs_", Name2, "_All_ByOverlap_AboveThreshold_numberedX1.html", sep = ""))
file.path(pairDirL, paste0("Scatter_lm_GTA_Averages_", Name1, "_vs_", Name2, "_All_ByOverlap_AboveThreshold_numberedX1.html"))
htmlwidgets::saveWidget(pgg, fname)
#8
@@ -450,16 +450,16 @@ gg <- ggplot(data = X_abovethreshold, aes(
SD_1 = Z_lm_L_SD_X1,
SD_2 = Z_lm_L_SD_X2
)) +
xlab(paste("GO Term Avg lm Z for ", Name1, sep = "")) +
xlab(paste("GO Term Avg lm Z for", Name1)) +
geom_text(aes(label = X2_Rank), nudge_y = 0.25, size = 4) +
geom_rect(aes(xmin = -2, xmax = 2, ymin = -2, ymax = 2), color = "grey20", size = 0.25, alpha = 0.1, inherit.aes = FALSE, fill = NA) +
geom_point(shape = 3, size = 3) +
ylab(paste("GO Term Avg lm Z for ", Name2, sep = "")) +
ggtitle(paste("Comparing Average GO Term Z lm for ", Name1, " vs. ", Name2, sep = "")) +
ylab(paste("GO Term Avg lm Z for", Name2)) +
ggtitle(paste("Comparing Average GO Term Z lm for", Name1, "vs.", Name2)) +
theme_Publication_legend_right()
pdf(
file.path(pairDirL, paste("Scatter_lm_GTA_Averages_", Name1, "_vs_", Name2, "_All_ByOverlap_AboveThreshold_numberedX2.pdf", sep = "")),
file.path(pairDirL, paste0("Scatter_lm_GTA_Averages_", Name1, "_vs_", Name2, "_All_ByOverlap_AboveThreshold_numberedX2.pdf")),
width = 15,
height = 15
)
@@ -469,18 +469,18 @@ dev.off()
pgg <- ggplotly(gg)
#pgg
fname <-
file.path(pairDirL, paste("Scatter_lm_GTA_Averages_", Name1, "_vs_", Name2, "_All_ByOverlap_AboveThreshold_numberedX2.html", sep = ""))
file.path(pairDirL, paste0("Scatter_lm_GTA_Averages_", Name1, "_vs_", Name2, "_All_ByOverlap_AboveThreshold_numberedX2.html"))
htmlwidgets::saveWidget(pgg, fname)
write.csv(
x = X,
file.path(pairDirL, paste("All_GTA_Avg_Scores_", Name1, "_vs_", Name2, ".csv", sep = "")),
file.path(pairDirL, paste0("All_GTA_Avg_Scores_", Name1, "_vs_", Name2, ".csv")),
row.names = FALSE
)
write.csv(
x = X_abovethreshold,
file = file.path(pairDirL, paste("AboveThreshold_GTA_Avg_Scores_", Name1, "_vs_", Name2, ".csv", sep = "")),
file = file.path(pairDirL, paste0("AboveThreshold_GTA_Avg_Scores_", Name1, "_vs_", Name2, ".csv")),
row.names = FALSE
)
@@ -599,15 +599,15 @@ gg <- ggplot(data = X, aes(
SD_1 = Z_lm_K_SD_X1,
SD_2 = Z_lm_K_SD_X2
)) +
xlab(paste("GO Term Avg lm Z for ", Name1, sep = "")) +
xlab(paste("GO Term Avg lm Z for", Name1)) +
geom_rect(aes(xmin = -2, xmax = 2, ymin = -2, ymax = 2), color = "grey20", size = 0.25, alpha = 0.1, inherit.aes = FALSE, fill = NA) +
geom_point(shape = 3) +
ylab(paste("GO Term Avg lm Z for ", Name2, sep = "")) +
ggtitle(paste("Comparing Average GO Term Z lm for ", Name1, " vs. ", Name2, sep = "")) +
ylab(paste("GO Term Avg lm Z for", Name2)) +
ggtitle(paste("Comparing Average GO Term Z lm for", Name1, "vs.", Name2)) +
theme_Publication_legend_right()
pdf(
file.path(pairDirK, paste("Scatter_lm_GTF_Averages_", Name1, "_vs_", Name2, "_All_ByOntology.pdf", sep = "")),
file.path(pairDirK, paste0("Scatter_lm_GTF_Averages_", Name1, "_vs_", Name2, "_All_ByOntology.pdf")),
width = 12,
height = 8
)
@@ -616,7 +616,7 @@ gg
dev.off()
pgg <- ggplotly(gg)
#pgg
fname <- file.path(pairDirK, paste("Scatter_lm_GTA_Averages_", Name1, "_vs_", Name2, "_All_byOntology.html", sep = ""))
fname <- file.path(pairDirK, paste0("Scatter_lm_GTA_Averages_", Name1, "_vs_", Name2, "_All_byOntology.html"))
htmlwidgets::saveWidget(pgg, fname)
#2
@@ -648,7 +648,7 @@ try(X[X$Term_Avg %in% X2_Specific_Aggravators_X1_Alleviatiors$Term_Avg, ]$Overla
try(X[X$Term_Avg %in% X2_Specific_Alleviators_X1_Aggravators$Term_Avg, ]$Overlap_Avg <-
paste(Name2, "Deletion_Enhancers", Name1, "Deletion_Suppressors", sep = "_"))
plotly_path <- file.path(pairDirK, paste("Scatter_lm_GTF_Averages_", Name1, "_vs_", Name2, "_All_byOverlap.html", sep = ""))
plotly_path <- file.path(pairDirK, paste0("Scatter_lm_GTF_Averages_", Name1, "_vs_", Name2, "_All_byOverlap.html"))
gg <- ggplot(data = X, aes(
x = Z_lm_K_Avg_X1,
y = Z_lm_K_Avg_X2,
@@ -660,15 +660,15 @@ gg <- ggplot(data = X, aes(
SD_1 = Z_lm_K_SD_X1,
SD_2 = Z_lm_K_SD_X2
)) +
xlab(paste("GO Term Avg lm Z for ", Name1, sep = "")) +
xlab(paste("GO Term Avg lm Z for", Name1)) +
geom_rect(aes(xmin = -2, xmax = 2, ymin = -2, ymax = 2), color = "grey20", size = 0.25, alpha = 0.1, inherit.aes = FALSE, fill = NA) +
geom_point(shape = 3) +
ylab(paste("GO Term Avg lm Z for ", Name2, sep = "")) +
ggtitle(paste("Comparing Average GO Term Z lm for ", Name1, " vs. ", Name2, sep = "")) +
ylab(paste("GO Term Avg lm Z for", Name2)) +
ggtitle(paste("Comparing Average GO Term Z lm for", Name1, "vs.", Name2)) +
theme_Publication_legend_right()
pdf(
file.path(pairDirK, paste("Scatter_lm_GTF_Averages_", Name1, "_vs_", Name2, "_All_ByOverlap.pdf", sep = "")),
file.path(pairDirK, paste0("Scatter_lm_GTF_Averages_", Name1, "_vs_", Name2, "_All_ByOverlap.pdf")),
width = 12,
height = 8
)
@@ -678,12 +678,12 @@ dev.off()
pgg <- ggplotly(gg)
#2
fname <- file.path(pairDirK, paste("Scatter_lm_GTA_Averages_", Name1, "_vs_", Name2, "_All_byOverlap.html", sep = ""))
fname <- file.path(pairDirK, paste0("Scatter_lm_GTA_Averages_", Name1, "_vs_", Name2, "_All_byOverlap.html"))
htmlwidgets::saveWidget(pgg, fname)
#3
x_rem2_gene <- X[X$NumGenes_Avg_X1 >= 2 & X$NumGenes_Avg_X2 >= 2, ]
plotly_path <- file.path(pairDirK, paste("Scatter_lm_GTF_Averages_", Name1, "_vs_", Name2, "_All_byOverlap_above2genes.html", sep = ""))
plotly_path <- file.path(pairDirK, paste0("Scatter_lm_GTF_Averages_", Name1, "_vs_", Name2, "_All_byOverlap_above2genes.html"))
gg <- ggplot(data = x_rem2_gene, aes(
x = Z_lm_K_Avg_X1,
y = Z_lm_K_Avg_X2,
@@ -695,15 +695,15 @@ gg <- ggplot(data = x_rem2_gene, aes(
SD_1 = Z_lm_K_SD_X1,
SD_2 = Z_lm_K_SD_X2
)) +
xlab(paste("GO Term Avg lm Z for ", Name1, sep = "")) +
xlab(paste("GO Term Avg lm Z for", Name1)) +
geom_rect(aes(xmin = -2, xmax = 2, ymin = -2, ymax = 2), color = "grey20", size = 0.25, alpha = 0.1, inherit.aes = FALSE, fill = NA) +
geom_point(shape = 3) +
ylab(paste("GO Term Avg lm Z for ", Name2, sep = "")) +
ggtitle(paste("Comparing Average GO Term Z lm for ", Name1, " vs. ", Name2, sep = "")) +
ylab(paste("GO Term Avg lm Z for", Name2)) +
ggtitle(paste("Comparing Average GO Term Z lm for", Name1, "vs.", Name2)) +
theme_Publication_legend_right()
pdf(
file.path(pairDirK, paste("Scatter_lm_GTF_Averages_", Name1, "_vs_", Name2, "_All_ByOverlap_above2genes.pdf", sep = "")),
file.path(pairDirK, paste0("Scatter_lm_GTF_Averages_", Name1, "_vs_", Name2, "_All_ByOverlap_above2genes.pdf")),
width = 12,
height = 8
)
@@ -712,7 +712,7 @@ gg
dev.off()
pgg <- ggplotly(gg)
#pgg
fname <- file.path(pairDirK, paste("Scatter_lm_GTA_Averages_", Name1, "_vs_", Name2, "_All_byOverlap_above2genes.html", sep = ""))
fname <- file.path(pairDirK, paste0("Scatter_lm_GTA_Averages_", Name1, "_vs_", Name2, "_All_byOverlap_above2genes.html"))
htmlwidgets::saveWidget(pgg, fname)
#4
@@ -728,15 +728,15 @@ gg <- ggplot(data = X_overlap_nothresold, aes(
SD_1 = Z_lm_K_SD_X1,
SD_2 = Z_lm_K_SD_X2
)) +
xlab(paste("GO Term Avg lm Z for ", Name1, sep = "")) +
xlab(paste("GO Term Avg lm Z for", Name1)) +
geom_rect(aes(xmin = -2, xmax = 2, ymin = -2, ymax = 2), color = "grey20", size = 0.25, alpha = 0.1, inherit.aes = FALSE, fill = NA) +
geom_point(shape = 3) +
ylab(paste("GO Term Avg lm Z for ", Name2, sep = "")) +
ggtitle(paste("Comparing Average GO Term Z lm for ", Name1, " vs. ", Name2, sep = "")) +
ylab(paste("GO Term Avg lm Z for", Name2)) +
ggtitle(paste("Comparing Average GO Term Z lm for", Name1, "vs.", Name2)) +
theme_Publication_legend_right()
pdf(
file.path(pairDirK, paste("Scatter_lm_GTF_Averages_", Name1, "_vs_", Name2, "_Above2SD_ByOverlap.pdf", sep = "")),
file.path(pairDirK, paste0("Scatter_lm_GTF_Averages_", Name1, "_vs_", Name2, "_Above2SD_ByOverlap.pdf")),
width = 12,
height = 8
)
@@ -746,7 +746,7 @@ dev.off()
pgg <- ggplotly(gg)
#pgg
fname <- file.path(pairDirK, paste("Scatter_lm_GTA_Averages_", Name1, "_vs_", Name2, "_Above2SD_ByOverlap.html", sep = ""))
fname <- file.path(pairDirK, paste0("Scatter_lm_GTA_Averages_", Name1, "_vs_", Name2, "_Above2SD_ByOverlap.html"))
htmlwidgets::saveWidget(pgg, fname)
#5
@@ -797,15 +797,15 @@ gg <- ggplot(data = X_abovethreshold, aes(
SD_1 = Z_lm_K_SD_X1,
SD_2 = Z_lm_K_SD_X2
)) +
xlab(paste("GO Term Avg lm Z for ", Name1, sep = "")) +
xlab(paste("GO Term Avg lm Z for", Name1)) +
geom_rect(aes(xmin = -2, xmax = 2, ymin = -2, ymax = 2), color = "grey20", size = 0.25, alpha = 0.1, inherit.aes = FALSE, fill = NA) +
geom_point(shape = 3) +
ylab(paste("GO Term Avg lm Z for ", Name2, sep = "")) +
ggtitle(paste("Comparing Average GO Term Z lm for ", Name1, " vs. ", Name2, sep = "")) +
ylab(paste("GO Term Avg lm Z for", Name2)) +
ggtitle(paste("Comparing Average GO Term Z lm for", Name1, "vs.", Name2)) +
theme_Publication_legend_right()
pdf(
file.path(pairDirK, paste("Scatter_lm_GTF_Averages_", Name1, "_vs_", Name2, "_All_ByOverlap_AboveThreshold.pdf", sep = "")),
file.path(pairDirK, paste0("Scatter_lm_GTF_Averages_", Name1, "_vs_", Name2, "_All_ByOverlap_AboveThreshold.pdf")),
width = 12,
height = 8
)
@@ -814,7 +814,7 @@ gg
dev.off()
pgg <- ggplotly(gg)
#pgg
fname <- file.path(pairDirK, paste("Scatter_lm_GTA_Averages_", Name1, "_vs_", Name2, "_All_ByOverlap_AboveThreshold.html", sep = ""))
fname <- file.path(pairDirK, paste0("Scatter_lm_GTA_Averages_", Name1, "_vs_", Name2, "_All_ByOverlap_AboveThreshold.html"))
htmlwidgets::saveWidget(pgg, fname)
#6
@@ -829,16 +829,16 @@ gg <- ggplot(data = X_abovethreshold, aes(
SD_1 = Z_lm_K_SD_X1,
SD_2 = Z_lm_K_SD_X2
)) +
xlab(paste("GO Term Avg lm Z for ", Name1, sep = "")) +
xlab(paste("GO Term Avg lm Z for", Name1)) +
geom_text(aes(label = Term_Avg), nudge_y = 0.25, size = 2) +
geom_rect(aes(xmin = -2, xmax = 2, ymin = -2, ymax = 2), color = "grey20", size = 0.25, alpha = 0.1, inherit.aes = FALSE, fill = NA) +
geom_point(shape = 3, size = 3) +
ylab(paste("GO Term Avg lm Z for ", Name2, sep = "")) +
ggtitle(paste("Comparing Average GO Term Z lm for ", Name1, " vs. ", Name2, sep = "")) +
ylab(paste("GO Term Avg lm Z for", Name2)) +
ggtitle(paste("Comparing Average GO Term Z lm for", Name1, " vs. ", Name2)) +
theme_Publication_legend_right()
pdf(
file.path(pairDirK, paste("Scatter_lm_GTF_Averages_", Name1, "_vs_", Name2, "_All_ByOverlap_AboveThreshold_names.pdf", sep = "")),
file.path(pairDirK, paste0("Scatter_lm_GTF_Averages_", Name1, "_vs_", Name2, "_All_ByOverlap_AboveThreshold_names.pdf")),
width = 20,
height = 20
)
@@ -846,7 +846,7 @@ gg
dev.off()
pgg <- ggplotly(gg)
#pgg
fname <- file.path(pairDirK, paste("Scatter_lm_GTA_Averages_", Name1, "_vs_", Name2, "_All_ByOverlap_AboveThreshold_names.html", sep = ""))
fname <- file.path(pairDirK, paste0("Scatter_lm_GTA_Averages_", Name1, "_vs_", Name2, "_All_ByOverlap_AboveThreshold_names.html"))
htmlwidgets::saveWidget(pgg, fname)
#7
@@ -866,16 +866,16 @@ gg <- ggplot(data = X_abovethreshold, aes(
SD_1 = Z_lm_K_SD_X1,
SD_2 = Z_lm_K_SD_X2
)) +
xlab(paste("GO Term Avg lm Z for ", Name1, sep = "")) +
xlab(paste("GO Term Avg lm Z for", Name1)) +
geom_text(aes(label = X1_Rank), nudge_y = 0.25, size = 4) +
geom_rect(aes(xmin = -2, xmax = 2, ymin = -2, ymax = 2), color = "grey20", size = 0.25, alpha = 0.1, inherit.aes = FALSE, fill = NA) +
geom_point(shape = 3, size = 3) +
ylab(paste("GO Term Avg lm Z for ", Name2, sep = "")) +
ggtitle(paste("Comparing Average GO Term Z lm for ", Name1, " vs. ", Name2, sep = "")) +
ylab(paste("GO Term Avg lm Z for", Name2)) +
ggtitle(paste("Comparing Average GO Term Z lm for", Name1, "vs.", Name2)) +
theme_Publication_legend_right()
pdf(
file.path(pairDirK, paste("Scatter_lm_GTF_Averages_", Name1, "_vs_", Name2, "_All_ByOverlap_AboveThreshold_numberedX1.pdf", sep = "")),
file.path(pairDirK, paste0("Scatter_lm_GTF_Averages_", Name1, "_vs_", Name2, "_All_ByOverlap_AboveThreshold_numberedX1.pdf")),
width = 15,
height = 15
)
@@ -885,7 +885,7 @@ dev.off()
pgg <- ggplotly(gg)
#pgg
fname <-
file.path(pairDirK, paste("Scatter_lm_GTA_Averages_", Name1, "_vs_", Name2, "_All_ByOverlap_AboveThreshold_numberedX1.html", sep = ""))
file.path(pairDirK, paste0("Scatter_lm_GTA_Averages_", Name1, "_vs_", Name2, "_All_ByOverlap_AboveThreshold_numberedX1.html"))
htmlwidgets::saveWidget(pgg, fname)
#8
@@ -900,16 +900,16 @@ gg <- ggplot(data = X_abovethreshold, aes(
SD_1 = Z_lm_K_SD_X1,
SD_2 = Z_lm_K_SD_X2
)) +
xlab(paste("GO Term Avg lm Z for ", Name1, sep = "")) +
xlab(paste("GO Term Avg lm Z for", Name1)) +
geom_text(aes(label = X2_Rank), nudge_y = 0.25, size = 4) +
geom_rect(aes(xmin = -2, xmax = 2, ymin = -2, ymax = 2), color = "grey20", size = 0.25, alpha = 0.1, inherit.aes = FALSE, fill = NA) +
geom_point(shape = 3, size = 3) +
ylab(paste("GO Term Avg lm Z for ", Name2, sep = "")) +
ggtitle(paste("Comparing Average GO Term Z lm for ", Name1, " vs. ", Name2, sep = "")) +
ylab(paste("GO Term Avg lm Z for", Name2)) +
ggtitle(paste("Comparing Average GO Term Z lm for", Name1, "vs.", Name2)) +
theme_Publication_legend_right()
pdf(
file.path(pairDirK, paste("Scatter_lm_GTF_Averages_", Name1, "_vs_", Name2, "_All_ByOverlap_AboveThreshold_numberedX2.pdf", sep = "")),
file.path(pairDirK, paste0("Scatter_lm_GTF_Averages_", Name1, "_vs_", Name2, "_All_ByOverlap_AboveThreshold_numberedX2.pdf")),
width = 15,
height = 15
)
@@ -919,17 +919,17 @@ dev.off()
pgg <- ggplotly(gg)
#pgg
fname <-
file.path(pairDirK, paste("Scatter_lm_GTA_Averages_", Name1, "_vs_", Name2, "_All_ByOverlap_AboveThreshold_numberedX2.html", sep = ""))
file.path(pairDirK, paste0("Scatter_lm_GTA_Averages_", Name1, "_vs_", Name2, "_All_ByOverlap_AboveThreshold_numberedX2.html"))
htmlwidgets::saveWidget(pgg, fname)
write.csv(
x = X,
file = file.path(pairDirK, paste("All_GTF_Avg_Scores_", Name1, "_vs_", Name2, ".csv", sep = "")),
file = file.path(pairDirK, paste0("All_GTF_Avg_Scores_", Name1, "_vs_", Name2, ".csv")),
row.names = FALSE
)
write.csv(
x = X_abovethreshold,
file = file.path(pairDirK, paste("AboveThreshold_GTF_Avg_Scores_", Name1, "_vs_", Name2, ".csv", sep = "")),
file = file.path(pairDirK, paste0("AboveThreshold_GTF_Avg_Scores_", Name1, "_vs_", Name2, ".csv")),
row.names = FALSE
)