From c1278a99df4618e6d7bb5b3b632bfe7f99fed6fe Mon Sep 17 00:00:00 2001 From: Karin Schork Date: Fri, 1 Dec 2023 14:37:27 +0100 Subject: [PATCH] option to have kepp labels of the protein nodes in the plot in the original order --- R/plotBipartiteGraph.R | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/R/plotBipartiteGraph.R b/R/plotBipartiteGraph.R index 2bef535..87c5f84 100644 --- a/R/plotBipartiteGraph.R +++ b/R/plotBipartiteGraph.R @@ -51,11 +51,18 @@ plotBipartiteGraph <- function(G, vertex.label.dist = 0, legend = TRUE, pos_peptides <- Layout[,1][Layout[,2] == 0] if (node_labels_proteins == "letters") { + #### TODO: was ist, wenn es mehr als 26 Proteine gibt? names_G[Layout[,2] == 1] <- LETTERS[rank(pos_proteins)] } if (node_labels_proteins == "accessions") { names_G[Layout[,2] == 1] <- limma::strsplit2(V(G)$name[Layout[,2] == 1], ";")[,1] } + # nicht geordnete Zahlen + if (node_labels_proteins == "numbers_noord") { + names_G[Layout[,2] == 1] <- 1:length(pos_proteins) + } + + if (node_labels_peptides == "numbers") { names_peptides <- 1:sum(Layout[,2] == 0)