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
)

View File

@@ -44,7 +44,7 @@ Terms <- read.delim(file = sgd_terms_tfile,
col.names = c("GO_ID", "GO_Term", "GO_Aspect", "GO_Term_Definition")
)
XX3 <- read.csv(file = all_sgd_terms_csv, stringsAsFactors = FALSE, header = TRUE)
XX3[, 1] <- paste("GO:", formatC(XX3[, 1], width = 7, flag = "0"), sep = "")
XX3[, 1] <- paste0("GO:", formatC(XX3[, 1], width = 7, flag = "0"))
XX3[, 2] <- gsub(pattern = " ", replacement = "_", x = XX3[, 2])
XX3[, 2] <- gsub(pattern = "/", replacement = "_", x = XX3[, 2])
@@ -84,7 +84,7 @@ if (length(study_nums) > 0) {
X1$Rank_L <- rank(X1$Z_lm_L)
X1$Rank_K <- rank(X1$Z_lm_K)
X1 <- X1[order(X1$OrfRep, decreasing = FALSE), ]
colnames(X1) <- paste(colnames(X1), "_X1", sep = "")
colnames(X1) <- paste0(colnames(X1), "_X1")
}
if (length(study_nums) > 1) {
@@ -111,7 +111,7 @@ if (length(study_nums) > 1) {
X2$Rank_K <- rank(X2$Z_lm_K)
X2 <- X2[order(X2$OrfRep, decreasing = FALSE), ]
colnames(X2) <- paste(colnames(X2), "_X2", sep = "")
colnames(X2) <- paste0(colnames(X2), "_X2")
X <- cbind(X1, X2)
}
@@ -138,7 +138,7 @@ if (length(study_nums) > 2) {
X3$Rank_L <- rank(X3$Z_lm_L)
X3$Rank_K <- rank(X3$Z_lm_K)
X3 <- X3[order(X3$OrfRep, decreasing = FALSE), ]
colnames(X3) <- paste(colnames(X3), "_X3", sep = "")
colnames(X3) <- paste0(colnames(X3), "_X3")
X <- cbind(X, X3)
}
@@ -165,7 +165,7 @@ if (length(study_nums) > 3) {
X4$Rank_L <- rank(X4$Z_lm_L)
X4$Rank_K <- rank(X4$Z_lm_K)
X4 <- X4[order(X4$OrfRep, decreasing = FALSE), ]
colnames(X4) <- paste(colnames(X4), "_X4", sep = "")
colnames(X4) <- paste0(colnames(X4), "_X4")
X <- cbind(X, X4)
}
@@ -192,7 +192,7 @@ if (length(study_nums) > 4) {
X5$Rank_L <- rank(X5$Z_lm_L)
X5$Rank_K <- rank(X5$Z_lm_K)
X5 <- X5[order(X5$OrfRep, decreasing = FALSE), ]
colnames(X5) <- paste(colnames(X5), "_X5", sep = "")
colnames(X5) <- paste0(colnames(X5), "_X5")
X <- cbind(X, X5)
}
@@ -441,7 +441,7 @@ for (s in 1:dim(XX3)[1]) {
if (Parent_Size > 2000) {
pdf(
file = file.path(output_dir, paste(XX3[s, 2], ".pdf", sep = "")),
file = file.path(output_dir, paste0(XX3[s, 2], ".pdf")),
width = 12,
height = 45,
onefile = TRUE
@@ -477,7 +477,7 @@ for (s in 1:dim(XX3)[1]) {
if (Parent_Size >= 1000 && Parent_Size <= 2000) {
pdf(
file = file.path(output_dir, paste(XX3[s, 2], ".pdf", sep = "")),
file = file.path(output_dir, paste0(XX3[s, 2], ".pdf")),
width = 12,
height = 35,
onefile = TRUE
@@ -513,7 +513,7 @@ for (s in 1:dim(XX3)[1]) {
if (Parent_Size >= 500 && Parent_Size <= 1000) {
pdf(
file = file.path(output_dir, paste(XX3[s, 2], ".pdf", sep = "")),
file = file.path(output_dir, paste0(XX3[s, 2], ".pdf")),
width = 12,
height = 30,
onefile = TRUE
@@ -549,7 +549,7 @@ for (s in 1:dim(XX3)[1]) {
if (Parent_Size >= 200 && Parent_Size <= 500) {
pdf(
file = file.path(output_dir, paste(XX3[s, 2], ".pdf", sep = "")),
file = file.path(output_dir, paste0(XX3[s, 2], ".pdf")),
width = 12,
height = 25,
onefile = TRUE
@@ -585,7 +585,7 @@ for (s in 1:dim(XX3)[1]) {
if (Parent_Size >= 100 && Parent_Size <= 200) {
pdf(
file = file.path(output_dir, paste(XX3[s, 2], ".pdf", sep = "")),
file = file.path(output_dir, paste0(XX3[s, 2], ".pdf")),
width = 12,
height = 20,
onefile = TRUE
@@ -621,7 +621,7 @@ for (s in 1:dim(XX3)[1]) {
if (Parent_Size >= 60 && Parent_Size <= 100) {
pdf(
file = file.path(output_dir, paste(XX3[s, 2], ".pdf", sep = "")),
file = file.path(output_dir, paste0(XX3[s, 2], ".pdf")),
width = 12,
height = 15,
onefile = TRUE
@@ -657,7 +657,7 @@ for (s in 1:dim(XX3)[1]) {
if (Parent_Size >= 30 && Parent_Size <= 60) {
pdf(
file = file.path(output_dir, paste(XX3[s, 2], ".pdf", sep = "")),
file = file.path(output_dir, paste0(XX3[s, 2], ".pdf")),
width = 12,
height = 10,
onefile = TRUE
@@ -709,7 +709,7 @@ for (s in 1:dim(XX3)[1]) {
if (Parent_Size >= 3 && Parent_Size <= 30) {
pdf(
file = file.path(output_dir, paste(XX3[s, 2], ".pdf", sep = "")),
file = file.path(output_dir, paste0(XX3[s, 2], ".pdf")),
width = 12,
height = 7,
onefile = TRUE
@@ -760,7 +760,7 @@ for (s in 1:dim(XX3)[1]) {
if (Parent_Size == 2) {
pdf(
file = file.path(output_dir, paste(XX3[s, 2], ".pdf", sep = "")),
file = file.path(output_dir, paste0(XX3[s, 2], ".pdf")),
width = 12,
height = 7,
onefile = TRUE

View File

@@ -171,7 +171,7 @@ for (i in 1:num_unique_clusts) {
if (cluster_length != 1) {
X0 <- as.matrix(cluster_data[, 4:(length(hmapfile[1, ]) - 2)])
if (cluster_length >= 2001) {
mypath <- file.path(outDir, paste("cluster_", gsub(" ", "", cluster), ".pdf", sep = ""))
mypath <- file.path(outDir, paste0("cluster_", gsub(" ", "", cluster), ".pdf"))
pdf(file = mypath, height = 20, width = 15)
heatmap.2(
x = X0,
@@ -191,7 +191,7 @@ for (i in 1:num_unique_clusts) {
dev.off()
}
if (cluster_length >= 201 && cluster_length <= 2000) {
mypath <- file.path(outDir, paste("cluster_", gsub(" ", "", cluster), ".pdf", sep = ""))
mypath <- file.path(outDir, paste0("cluster_", gsub(" ", "", cluster), ".pdf"))
pdf(file = mypath, height = 15, width = 12)
heatmap.2(
x = X0,
@@ -210,7 +210,7 @@ for (i in 1:num_unique_clusts) {
dev.off()
}
if (cluster_length >= 150 && cluster_length <= 200) {
mypath <- file.path(outDir, paste("cluster_", gsub(" ", "", cluster), ".pdf", sep = ""))
mypath <- file.path(outDir, paste0("cluster_", gsub(" ", "", cluster), ".pdf"))
pdf(file = mypath, height = 12, width = 12)
heatmap.2(
x = X0,
@@ -228,7 +228,7 @@ for (i in 1:num_unique_clusts) {
dev.off()
}
if (cluster_length >= 101 && cluster_length <= 149) {
mypath <- file.path(outDir, paste("cluster_", gsub(" ", "", cluster), ".pdf", sep = ""))
mypath <- file.path(outDir, paste0("cluster_", gsub(" ", "", cluster), ".pdf"))
pdf(file = mypath, mypath, height = 12, width = 12)
heatmap.2(
x = X0,
@@ -246,7 +246,7 @@ for (i in 1:num_unique_clusts) {
dev.off()
}
if (cluster_length >= 60 && cluster_length <= 100) {
mypath <- file.path(outDir, paste("cluster_", gsub(" ", "", cluster), ".pdf", sep = ""))
mypath <- file.path(outDir, paste0("cluster_", gsub(" ", "", cluster), ".pdf"))
pdf(file = mypath, height = 12, width = 12)
heatmap.2(
x = X0,
@@ -264,7 +264,7 @@ for (i in 1:num_unique_clusts) {
dev.off()
}
if (cluster_length <= 59 && cluster_length >= 30) {
mypath <- file.path(outDir, paste("cluster_", gsub(" ", "", cluster), ".pdf", sep = ""))
mypath <- file.path(outDir, paste0("cluster_", gsub(" ", "", cluster), ".pdf"))
pdf(file = mypath, height = 9, width = 12)
heatmap.2(
x = X0,
@@ -282,7 +282,7 @@ for (i in 1:num_unique_clusts) {
dev.off()
}
if (cluster_length <= 29) {
mypath <- file.path(outDir, paste("cluster_", gsub(" ", "", cluster), ".pdf", sep = ""))
mypath <- file.path(outDir, paste0("cluster_", gsub(" ", "", cluster), ".pdf"))
pdf(file = mypath, height = 7, width = 12)
heatmap.2(
x = X0,

View File

@@ -45,11 +45,11 @@ hmapfile_w_homolog <- full_join(hmapfile_map, mapping, by = c("ORFMatch" = "ense
hmapfile_w_homolog <- hmapfile_w_homolog[is.na(hmapfile_w_homolog$likelihood) == FASLE, ]
# Write csv with all info from mapping file
write.csv(hmapfile_w_homolog, file.path(output_path, paste(final_table, "_WithHomologAll.csv", sep = "")), row.names = FALSE)
write.csv(hmapfile_w_homolog, file.path(output_path, paste0(final_table, "_WithHomologAll.csv")), row.names = FALSE)
# Remove the non matches and output another mapping file - this is also one used to make heatmaps
hmapfile_w_homolog <- hmapfile_w_homolog[is.na(hmapfile_w_homolog$external_gene_name_Human) == FALSE, ]
write.csv(hmapfile_w_homolog, file.path(output_path, paste(final_table, "_WithHomologMatchesOnly.csv", sep = ""), row.names = FALSE))
write.csv(hmapfile_w_homolog, file.path(output_path, paste0(final_table, "_WithHomologMatchesOnly.csv"), row.names = FALSE))
# Add human gene name to the Gene column
hmapfile_w_homolog$Gene <- paste(hmapfile_w_homolog$Gene, hmapfile_w_homolog$external_gene_name_Human, sep = "/")
@@ -230,7 +230,7 @@ for (i in 1:num_unique_clusts) {
if (cluster_length != 1) {
X0 <- as.matrix(cluster_data[, 4:(length(hmapfile[1, ]) - 6)])
if (cluster_length >= 2001) {
mypath <- file.path(output_path, paste("cluster_", gsub(" ", "", cluster), ".pdf", sep = ""))
mypath <- file.path(output_path, paste0("cluster_", gsub(" ", "", cluster), ".pdf"))
pdf(file = mypath, height = 20, width = 15)
heatmap.2(
x = X0,
@@ -250,7 +250,7 @@ for (i in 1:num_unique_clusts) {
dev.off()
}
if (cluster_length >= 201 && cluster_length <= 2000) {
mypath <- file.path(output_path, paste("cluster_", gsub(" ", "", cluster), ".pdf", sep = ""))
mypath <- file.path(output_path, paste0("cluster_", gsub(" ", "", cluster), ".pdf"))
pdf(file = mypath, height = 15, width = 12)
heatmap.2(
x = X0,
@@ -269,7 +269,7 @@ for (i in 1:num_unique_clusts) {
dev.off()
}
if (cluster_length >= 150 && cluster_length <= 200) {
mypath <- file.path(output_path, paste("cluster_", gsub(" ", "", cluster), ".pdf", sep = ""))
mypath <- file.path(output_path, paste0("cluster_", gsub(" ", "", cluster), ".pdf"))
pdf(file = mypath, height = 12, width = 12)
heatmap.2(
x = X0,
@@ -287,7 +287,7 @@ for (i in 1:num_unique_clusts) {
dev.off()
}
if (cluster_length >= 101 && cluster_length <= 149) {
mypath <- file.path(output_path, paste("cluster_", gsub(" ", "", cluster), ".pdf", sep = ""))
mypath <- file.path(output_path, paste0("cluster_", gsub(" ", "", cluster), ".pdf"))
pdf(file = mypath, height = 12, width = 12)
heatmap.2(
x = X0,
@@ -305,7 +305,7 @@ for (i in 1:num_unique_clusts) {
dev.off()
}
if (cluster_length >= 60 && cluster_length <= 100) {
mypath <- file.path(output_path, paste("cluster_", gsub(" ", "", cluster), ".pdf", sep = ""))
mypath <- file.path(output_path, paste0("cluster_", gsub(" ", "", cluster), ".pdf"))
pdf(file = mypath, height = 12, width = 12)
heatmap.2(
x = X0,
@@ -323,7 +323,7 @@ for (i in 1:num_unique_clusts) {
dev.off()
}
if (cluster_length <= 59 && cluster_length >= 30) {
mypath <- file.path(output_path, paste("cluster_", gsub(" ", "", cluster), ".pdf", sep = ""))
mypath <- file.path(output_path, paste0("cluster_", gsub(" ", "", cluster), ".pdf"))
pdf(file = mypath, height = 9, width = 12)
heatmap.2(
x = X0,
@@ -341,7 +341,7 @@ for (i in 1:num_unique_clusts) {
dev.off()
}
if (cluster_length <= 29) {
mypath <- file.path(output_path, paste("cluster_", gsub(" ", "", cluster), ".pdf", sep = ""))
mypath <- file.path(output_path, paste0("cluster_", gsub(" ", "", cluster), ".pdf"))
pdf(file = mypath, height = 7, width = 12)
heatmap.2(
x = X0,

File diff suppressed because it is too large Load Diff

View File

@@ -55,8 +55,8 @@ print(length(input_files))
# Join the two files at a time as a function of how many inputFile
# list the larger file first ? in this example X2 has the larger number of genes
# If X1 has a larger number of genes, switch the order of X1 and X2
if (length(input_files) == 1) {
print("Only one experiment to compare, skipping join")
if (length(input_files) < 2) {
print("Note enough Exps to compare, skipping join")
stop("Exiting script")
}
@@ -65,20 +65,17 @@ if (length(input_files) >= 2) {
X2 <- read.csv(file = input_files[2], stringsAsFactors = FALSE)
X <- join(X1, X2, by = "OrfRep")
OBH <- X[, order(colnames(X))] # OrderByHeader
headSel <- select(OBH, contains("OrfRep"), matches("Gene"),
contains("Z_lm_K"), contains("Z_Shift_K"), contains("Z_lm_L"), contains("Z_Shift_L"))
headSel <- select(headSel, -"Gene.1") # remove "Gene.1 column
headSel2 <- select(OBH, contains("OrfRep"), matches("Gene")) #Frame for interleaving Z_lm with Shift colums
headSel2 <- select(headSel2, -"Gene.1") # remove "Gene.1 column #Frame for interleaving Z_lm with Shift colums
headers <- select(OBH, contains("OrfRep"), matches("Gene"),
contains("z_lm_k"), contains("z_shift_k"), contains("z_lm_l"), contains("z_shift_l"))
headSel <- select(headers, -"Gene.1") # remove "Gene.1 column
headSel2 <- select(OBH, contains("OrfRep"), matches("Gene")) # frame for interleaving Z_lm with Shift colums
headSel2 <- select(headSel2, -"Gene.1") # remove "Gene.1 column # frame for interleaving Z_lm with Shift colums
}
if (length(input_files) >= 3) {
X3 <- read.csv(file = input_files[3], stringsAsFactors = FALSE)
X <- join(X, X3, by = "OrfRep")
OBH <- X[, order(colnames(X))] # OrderByHeader
headSel <- select(OBH, contains("OrfRep"), matches("Gene"),
contains("Z_lm_K"), contains("Z_Shift_K"), contains("Z_lm_L"), contains("Z_Shift_L"))
headSel <- select(headSel, -"Gene.1", -"Gene.2")
headSel <- select(headers, -"Gene.1", -"Gene.2")
headSel2 <- select(OBH, contains("OrfRep"), matches("Gene"))
headSel2 <- select(headSel2, -"Gene.1", -"Gene.2")
}
@@ -86,16 +83,15 @@ if (length(input_files) >= 3) {
if (length(input_files) >= 4) {
X4 <- read.csv(file = input_files[4], stringsAsFactors = FALSE)
X <- join(X, X4, by = "OrfRep")
OBH <- X[, order(colnames(X))] # OrderByHeader
headSel <- select(OBH, contains("OrfRep"), matches("Gene"),
contains("Z_lm_K"), contains("Z_Shift_K"), contains("Z_lm_L"), contains("Z_Shift_L"))
headSel <- select(headSel, -"Gene.1", -"Gene.2", -"Gene.3")
headSel <- select(headers, -"Gene.1", -"Gene.2", -"Gene.3")
headSel2 <- select(OBH, contains("OrfRep"), matches("Gene"))
headSel2 <- select(headSel2, -"Gene.1", -"Gene.2", -"Gene.3")
}
print(headers)
# headSel$contains("Z_Shift") %>% replace_na(0.001)
headers <- colnames(headSel)
print(headers)
i <- 0
for (i in 1:length(headers)) {
if (grepl("Shift", headers[i])) {
@@ -107,8 +103,8 @@ for (i in 1:length(headers)) {
}
# 2SD option code to exclude Z_lm values less than 2 standard Deviations
REMcRdy <- select(headSel, contains("OrfRep"), matches("Gene"), contains("Z_lm_"))
shiftOnly <- select(headSel, contains("OrfRep"), matches("Gene"), contains("Z_Shift"))
REMcRdy <- select(headSel, contains("OrfRep"), matches("Gene"), contains("z_lm_"))
shiftOnly <- select(headSel, contains("OrfRep"), matches("Gene"), contains("z_shift"))
# Code to replace the numeric (.1 .2 .3) headers with experiment names from StudyInfo.txt
Labels <- read.csv(file = study_info, stringsAsFactors = FALSE, sep = ",")