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

@@ -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,