Browse code

Bugfixes in visualizeGRN

Christian Arnold authored on 13/10/2022 16:57:09
Showing11 changed files

... ...
@@ -3000,7 +3000,7 @@ addConnections_peak_gene <- function(GRN, overlapTypeGene = "TSS", corMethod = "
3000 3000
 #' @param filterPeaks Character vector. Default \code{NULL}. Vector of peak IDs (as named in the GRN object) to retain. All peaks not listed will be filtered out.
3001 3001
 #' @param TF_peak_FDR_selectViaCorBins \code{TRUE} or \code{FALSE}.  Default \code{FALSE}. Use a modified procedure for selecting TF-peak links that is based on the user-specified FDR but that retains also links that may have a higher FDR but a more extreme correlation.
3002 3002
 #' @param silent \code{TRUE} or \code{FALSE}.  Default \code{FALSE}. Print progress messages and filter statistics.
3003
-#' @param resetGraphAndStoreInternally \code{TRUE} or \code{FALSE}.  Default \code{TRUE}. If set to \code{TRUE}, the stored eGRN graph slot graph) is reset due to the potentially changed connections that
3003
+#' @param resetGraphAndStoreInternally \code{TRUE} or \code{FALSE}.  Default \code{TRUE}. If set to \code{TRUE}, the stored eGRN graph (slot \code{graph}) is reset due to the potentially changed connections that
3004 3004
 #' would otherwise cause conflicts in the information stored in the object. Also, a GRN object is returned. If set to \code{FALSE}, only the new filtered connections are returned and the object is not altered.
3005 3005
 #' @param filterLoops  \code{TRUE} or \code{FALSE}. Default \code{TRUE}. If a TF regulates itself (i.e., the TF and the gene are the same entity), should such loops be filtered from the GRN?
3006 3006
 #' @template outputFolder
... ...
@@ -3619,7 +3619,9 @@ filterGRNAndConnectGenes <- function(GRN,
3619 3619
   
3620 3620
 }
3621 3621
 
3622
-#' Add TF-gene correlations to a \code{\linkS4class{GRN}} object. The information is currently stored in \code{GRN@connections$TF_genes.filtered}. Note that raw p-values are not adjusted.
3622
+#' Add TF-gene correlations to a \code{\linkS4class{GRN}} object. 
3623
+#' 
3624
+#' The information is currently stored in \code{GRN@connections$TF_genes.filtered}. Note that raw p-values are not adjusted.
3623 3625
 #' 
3624 3626
 #' @export
3625 3627
 #' @template GRN
... ...
@@ -343,7 +343,8 @@ performAllNetworkAnalyses <- function(GRN, ontology = c("GO_BP", "GO_MF"),
343 343
 #' and \emph{Reactome Pathways}, respectively. \code{GO} ontologies require the \code{topGO}, 
344 344
 #' \code{"KEGG"} the \code{clusterProfiler}, \code{"DO"} the \code{DOSE}, and \code{"Reactome"} the \code{ReactomePA} packages, respectively.
345 345
 #' As they are listed under \code{Suggests}, they may not yet be installed, and the function will throw an error if they are missing.
346
-#' @param algorithm Character. Default \code{"weight01"}. One of: \code{"classic"}, \code{"elim"}, \code{"weight"}, \code{"weight01"}, \code{"lea"}, \code{"parentchild"}. Only relevant if ontology is GO related (GO_BP, GO_MF, GO_CC), ignored otherwise. Name of the algorithm that handles the GO graph structures. Valid inputs are those supported by the \code{topGO} library.
346
+#' @param algorithm Character. Default \code{"weight01"}. One of: \code{"classic"}, \code{"elim"}, \code{"weight"}, \code{"weight01"}, \code{"lea"}, \code{"parentchild"}. Only relevant if ontology is GO related (GO_BP, GO_MF, GO_CC), ignored otherwise. Name of the algorithm that handles the GO graph structures. Valid inputs are those supported by the \code{topGO} library. 
347
+#' For general information about the algorithms, see \url{https://academic.oup.com/bioinformatics/article/22/13/1600/193669}. \code{weight01} is a mixture between the \code{elim} and the \code{weight} algorithms.
347 348
 #' @param statistic Character. Default \code{"fisher"}. One of: \code{"fisher"}, \code{"ks"}, \code{"t"}, \code{"globaltest"}, \code{"sum"}, \code{"ks.ties"}. Statistical test to be used. Only relevant if ontology is GO related (GO_BP, GO_MF, GO_CC), and valid inputs are those supported by the topGO library, ignored otherwise. For the other ontologies the test statistic is always Fisher. 
348 349
 #' @param background Character. Default \code{"neighborhood"}. One of: \code{"all_annotated"}, \code{"all_RNA"}, \code{"all_RNA_filtered"}, \code{"neighborhood"}. Set of genes to be used to construct the background for the enrichment analysis. This can either be all annotated genes in the reference genome (\code{all_annotated}), all genes from the provided RNA data (\code{all_RNA}), all genes from the provided RNA data excluding those marked as filtered after executing \code{filterData} (\code{all_RNA_filtered}), or all the genes that are within the neighborhood of any peak (before applying any filters except for the user-defined \code{promoterRange} value in \code{addConnections_peak_gene}) (\code{neighborhood}).
349 350
 #' @param background_geneTypes Character vector of gene types that should be considered for the background. Default \code{"all"}. 
... ...
@@ -592,6 +593,8 @@ calculateGeneralEnrichment <- function(GRN, ontology = c("GO_BP", "GO_MF"),
592 593
   
593 594
   if (ontology %in% c("GO_BP","GO_MF","GO_CC")){
594 595
       
596
+      # https://support.bioconductor.org/p/9141171/
597
+      
595 598
       # go_enrichment =  
596 599
       #     clusterProfiler::enrichGO(
597 600
       #         gene = foreground_entrez,
... ...
@@ -604,6 +607,10 @@ calculateGeneralEnrichment <- function(GRN, ontology = c("GO_BP", "GO_MF"),
604 607
       #         minGSSize = minGSSize,
605 608
       #         maxGSSize = maxGSSize,
606 609
       #         pAdjustMethod = pAdjustMethod)
610
+      
611
+      # go.res.new = .createEnichmentTable(go_enrichment)
612
+      
613
+      # The need of p-value adjustment: https://bioconductor.org/packages/devel/bioc/vignettes/topGO/inst/doc/topGO.pdf
607 614
     
608 615
     go_enrichment = suppressMessages(new("topGOdata",
609 616
                                          ontology = gsub("GO_", "", ontology),
... ...
@@ -3322,7 +3322,7 @@ plotTFEnrichment <- function(GRN, rankType = "degree", n = NULL, TF.names = NULL
3322 3322
 #' @template pdf_width
3323 3323
 #' @template pdf_height
3324 3324
 #' @param title \code{NULL} or Character. Default \code{NULL}. Title to be assigned to the plot.
3325
-#' @param maxRowsToPlot Integer > 0. Default 500. Refers to the maximum number of connections to be plotted. If the network size is above this limit, nothing will be drawn. In such a case, it may help to either increase the value of this parameter or set the filtering criteria for the network to be more stringent, so that the network becomes smaller.
3325
+#' @param maxEdgesToPlot Integer > 0. Default 500. Refers to the maximum number of connections to be plotted. If the network size is above this limit, nothing will be drawn. In such a case, it may help to either increase the value of this parameter or set the filtering criteria for the network to be more stringent, so that the network becomes smaller.
3326 3326
 #' @param nCommunitiesMax Integer > 0. Default 8. Maximum number of communities that get a distinct coloring. All additional communities will be colored with the same (gray) color.
3327 3327
 #' @param graph Character. Default \code{TF-gene}. One of: \code{TF-gene}, \code{TF-peak-gene}. Whether to plot a graph with links from TFs to peaks to gene, or the graph with the inferred TF to gene connections.
3328 3328
 #' @param colorby Character. Default \code{type}. Either \code{type} or \code{community}. Color the vertices by either type (TF/peak/gene) or community. See \code{\link{calculateCommunitiesStats}}
... ...
@@ -3336,11 +3336,11 @@ plotTFEnrichment <- function(GRN, rankType = "degree", n = NULL, TF.names = NULL
3336 3336
 #' @seealso \code{\link{build_eGRN_graph}}
3337 3337
 #' @examples
3338 3338
 #' GRN = loadExampleObject()
3339
-#' GRN = visualizeGRN(GRN, maxRowsToPlot = 700, graph = "TF-gene", colorby = "type")
3339
+#' GRN = visualizeGRN(GRN, maxEdgesToPlot = 700, graph = "TF-gene", colorby = "type")
3340 3340
 #' @return The same \code{\linkS4class{GRN}} object, without modifications.
3341 3341
 #' @export
3342 3342
 visualizeGRN <- function(GRN, outputFolder = NULL,  basenameOutput = NULL, plotAsPDF = TRUE, pdf_width = 12, pdf_height = 12,
3343
-                         title = NULL, maxRowsToPlot = 500, nCommunitiesMax = 8, graph = "TF-gene" , colorby = "type", layout = "fr",
3343
+                         title = NULL, maxEdgesToPlot = 500, nCommunitiesMax = 8, graph = "TF-gene" , colorby = "type", layout = "fr",
3344 3344
                          vertice_color_TFs = list(h = 10, c = 85, l = c(25, 95)), vertice_color_peaks = list(h = 135, c = 45, l = c(35, 95)), 
3345 3345
                          vertice_color_genes = list(h = 260, c = 80, l = c(30, 90)),
3346 3346
                          vertexLabel_cex = 0.4, vertexLabel_dist = 0, forceRerun = FALSE
... ...
@@ -3356,7 +3356,7 @@ visualizeGRN <- function(GRN, outputFolder = NULL,  basenameOutput = NULL, plotA
3356 3356
     checkmate::assertFlag(plotAsPDF)
3357 3357
     checkmate::assertNumeric(pdf_width, lower = 5, upper = 99)
3358 3358
     checkmate::assertNumeric(pdf_height, lower = 5, upper = 99)
3359
-    checkmate::assertIntegerish(maxRowsToPlot, lower = 1)
3359
+    checkmate::assertIntegerish(maxEdgesToPlot, lower = 1)
3360 3360
     checkmate::assertIntegerish(nCommunitiesMax,lower = 1)
3361 3361
     checkmate::assertChoice(graph, c("TF-gene", "TF-peak-gene"))
3362 3362
     checkmate::assertChoice(colorby, c("type", "community"))
... ...
@@ -3406,6 +3406,7 @@ visualizeGRN <- function(GRN, outputFolder = NULL,  basenameOutput = NULL, plotA
3406 3406
         
3407 3407
         grn.merged = GRN@graph$TF_peak_gene$table %>%
3408 3408
             dplyr::rename(TF.name = .data$V1_name) 
3409
+        
3409 3410
         grn.merged$V1[!is.na(grn.merged$TF.name)] = as.character(grn.merged$TF.name[!is.na(grn.merged$TF.name)]) # replace TF ensembl with TF name
3410 3411
         
3411 3412
         edges_final = grn.merged %>%
... ...
@@ -3416,22 +3417,22 @@ visualizeGRN <- function(GRN, outputFolder = NULL,  basenameOutput = NULL, plotA
3416 3417
     }
3417 3418
     
3418 3419
     edges_final = edges_final %>%
3419
-        dplyr::mutate(weight_transformed = dplyr::case_when(weight < 0.2 ~ 1,
3420
-                                                            weight < 0.4 ~ 1.5,
3421
-                                                            weight < 0.6 ~ 2,
3422
-                                                            weight < 0.8 ~ 2.5,
3423
-                                                            TRUE ~ 3),
3420
+        dplyr::mutate(weight_transformed = dplyr::case_when(abs(weight) < 0.2 ~ 0.2,
3421
+                                                            abs(weight) < 0.4 ~ 0.3,
3422
+                                                            abs(weight) < 0.6 ~ 0.4,
3423
+                                                            abs(weight) < 0.8 ~ 0.5,
3424
+                                                            TRUE ~ 0.6),
3424 3425
                       R_direction = dplyr::case_when(R < 0 ~ "neg", TRUE ~ "pos"),
3425
-                      color       = dplyr::case_when(R < 0 ~ "blue", TRUE ~ "grey")) %>%
3426
+                      color       = dplyr::case_when(R < 0 ~ "gray90", TRUE ~ "gray50")) %>%
3426 3427
         dplyr::select(.data$from, .data$to, .data$weight, .data$R, .data$linetype, .data$weight_transformed, .data$R_direction, .data$color)
3427 3428
     
3428 3429
     
3429 3430
     
3430 3431
     nRows = nrow(edges_final)
3431 3432
     
3432
-    futile.logger::flog.info(paste0("Number of rows: ",nRows))
3433
-    if (maxRowsToPlot > 500 & nRows > 500) {
3434
-        futile.logger::flog.info(paste0("Plotting many connections takes a lot of time and memory"))
3433
+    futile.logger::flog.info(paste0("Number of edges for the ", graph, " eGRN graph: ",nRows))
3434
+    if (maxEdgesToPlot > 500 & nRows > 500) {
3435
+        futile.logger::flog.info(paste0("Plotting many connections may need a lot of time and memory"))
3435 3436
     }
3436 3437
     
3437 3438
     
... ...
@@ -3443,10 +3444,10 @@ visualizeGRN <- function(GRN, outputFolder = NULL,  basenameOutput = NULL, plotA
3443 3444
         futile.logger::flog.info(paste0("Plotting GRN network"))
3444 3445
     }
3445 3446
     
3446
-    if (nRows > maxRowsToPlot) { 
3447
-        futile.logger::flog.info(paste0("Number of rows to plot (", nRows, ") exceeds limit of the maxRowsToPlot parameter. Plotting only empty page"))
3447
+    if (nRows > maxEdgesToPlot) { 
3448
+        futile.logger::flog.info(paste0("Number of edges to plot (", nRows, ") exceeds limit of the maxEdgesToPlot parameter. Plotting only empty page"))
3448 3449
         plot(c(0, 1), c(0, 1), ann = FALSE, bty = 'n', type = 'n', xaxt = 'n', yaxt = 'n', main = title)
3449
-        message = paste0(title, "\n\nPlotting omitted.\n\nThe number of rows in the GRN (", nRows, ") exceeds the maximum of ", maxRowsToPlot, ".\nSee the maxRowsToPlot parameter to increase the limit")
3450
+        message = paste0(title, "\n\nPlotting omitted.\n\nThe number of rows in the GRN (", nRows, ") exceeds the maximum of ", maxEdgesToPlot, ".\nSee the maxEdgesToPlot parameter to increase the limit")
3450 3451
         text(x = 0.5, y = 0.5, message, cex = 1.6, col = "red")
3451 3452
         
3452 3453
         if (plotAsPDF) {
... ...
@@ -3525,8 +3526,14 @@ visualizeGRN <- function(GRN, outputFolder = NULL,  basenameOutput = NULL, plotA
3525 3526
         
3526 3527
         ## VERTICES ##
3527 3528
         
3528
-        shape_vertex = c("square","circle", "circle")
3529
-        names(shape_vertex) = names(colors_categories.l)
3529
+        if (graph == "TF-peak-gene"){
3530
+            shape_vertex = c("square","circle", "circle")
3531
+            names(shape_vertex) = names(colors_categories.l)
3532
+        } else {
3533
+            shape_vertex = c("square","circle")
3534
+            names(shape_vertex) = names(colors_categories.l)
3535
+        }
3536
+        
3530 3537
         
3531 3538
         
3532 3539
         vertices = tibble::tribble(~id,
... ...
@@ -3778,7 +3785,7 @@ visualizeGRN <- function(GRN, outputFolder = NULL,  basenameOutput = NULL, plotA
3778 3785
         # TODO: E(net)$lty = edges_final$linetype
3779 3786
         # TODO: E(net)$width <- 1+E(net)$weight/12
3780 3787
         #igraph::E(net)$width <- 1+igraph::E(net)$weight/12
3781
-        igraph::E(net)$width <- igraph::E(net)$weight
3788
+        igraph::E(net)$width <- igraph::E(net)$weight_transformed
3782 3789
         #igraph::E(net)$weight <- edges_final$weight_transformed # too block-y for large networks. stick to givren weight.
3783 3790
         
3784 3791
         
... ...
@@ -3882,7 +3889,8 @@ visualizeGRN <- function(GRN, outputFolder = NULL,  basenameOutput = NULL, plotA
3882 3889
             vertex.size= igraph::V(net)$vertex.size,
3883 3890
             vertex.color=igraph::V(net)$vertex.color,
3884 3891
             edge.color = igraph::E(net)$color,
3885
-            edge.width = igraph::E(net)$weight,
3892
+            edge.width = igraph::E(net)$weight_transformed,
3893
+            #edge.width = 0.5,
3886 3894
             vertex.label=igraph::V(net)$label,
3887 3895
             vertex.label.font=1, 
3888 3896
             vertex.label.cex = vertexLabel_cex, 
... ...
@@ -2,7 +2,7 @@
2 2
 % Please edit documentation in R/core.R
3 3
 \name{add_TF_gene_correlation}
4 4
 \alias{add_TF_gene_correlation}
5
-\title{Add TF-gene correlations to a \code{\linkS4class{GRN}} object. The information is currently stored in \code{GRN@connections$TF_genes.filtered}. Note that raw p-values are not adjusted.}
5
+\title{Add TF-gene correlations to a \code{\linkS4class{GRN}} object.}
6 6
 \usage{
7 7
 add_TF_gene_correlation(
8 8
   GRN,
... ...
@@ -30,7 +30,7 @@ A value >1 requires the \code{BiocParallel} package (as it is listed under \code
30 30
 An updated \code{\linkS4class{GRN}} object, with additional information added from this function.
31 31
 }
32 32
 \description{
33
-Add TF-gene correlations to a \code{\linkS4class{GRN}} object. The information is currently stored in \code{GRN@connections$TF_genes.filtered}. Note that raw p-values are not adjusted.
33
+The information is currently stored in \code{GRN@connections$TF_genes.filtered}. Note that raw p-values are not adjusted.
34 34
 }
35 35
 \examples{
36 36
 # See the Workflow vignette on the GRaNIE website for examples
... ...
@@ -27,7 +27,8 @@ and \emph{Reactome Pathways}, respectively. \code{GO} ontologies require the \co
27 27
 \code{"KEGG"} the \code{clusterProfiler}, \code{"DO"} the \code{DOSE}, and \code{"Reactome"} the \code{ReactomePA} packages, respectively.
28 28
 As they are listed under \code{Suggests}, they may not yet be installed, and the function will throw an error if they are missing.}
29 29
 
30
-\item{algorithm}{Character. Default \code{"weight01"}. One of: \code{"classic"}, \code{"elim"}, \code{"weight"}, \code{"weight01"}, \code{"lea"}, \code{"parentchild"}. Only relevant if ontology is GO related (GO_BP, GO_MF, GO_CC), ignored otherwise. Name of the algorithm that handles the GO graph structures. Valid inputs are those supported by the \code{topGO} library.}
30
+\item{algorithm}{Character. Default \code{"weight01"}. One of: \code{"classic"}, \code{"elim"}, \code{"weight"}, \code{"weight01"}, \code{"lea"}, \code{"parentchild"}. Only relevant if ontology is GO related (GO_BP, GO_MF, GO_CC), ignored otherwise. Name of the algorithm that handles the GO graph structures. Valid inputs are those supported by the \code{topGO} library. 
31
+For general information about the algorithms, see \url{https://academic.oup.com/bioinformatics/article/22/13/1600/193669}. \code{weight01} is a mixture between the \code{elim} and the \code{weight} algorithms.}
31 32
 
32 33
 \item{statistic}{Character. Default \code{"fisher"}. One of: \code{"fisher"}, \code{"ks"}, \code{"t"}, \code{"globaltest"}, \code{"sum"}, \code{"ks.ties"}. Statistical test to be used. Only relevant if ontology is GO related (GO_BP, GO_MF, GO_CC), and valid inputs are those supported by the topGO library, ignored otherwise. For the other ontologies the test statistic is always Fisher.}
33 34
 
... ...
@@ -25,7 +25,8 @@ and \emph{Reactome Pathways}, respectively. \code{GO} ontologies require the \co
25 25
 \code{"KEGG"} the \code{clusterProfiler}, \code{"DO"} the \code{DOSE}, and \code{"Reactome"} the \code{ReactomePA} packages, respectively.
26 26
 As they are listed under \code{Suggests}, they may not yet be installed, and the function will throw an error if they are missing.}
27 27
 
28
-\item{algorithm}{Character. Default \code{"weight01"}. One of: \code{"classic"}, \code{"elim"}, \code{"weight"}, \code{"weight01"}, \code{"lea"}, \code{"parentchild"}. Only relevant if ontology is GO related (GO_BP, GO_MF, GO_CC), ignored otherwise. Name of the algorithm that handles the GO graph structures. Valid inputs are those supported by the \code{topGO} library.}
28
+\item{algorithm}{Character. Default \code{"weight01"}. One of: \code{"classic"}, \code{"elim"}, \code{"weight"}, \code{"weight01"}, \code{"lea"}, \code{"parentchild"}. Only relevant if ontology is GO related (GO_BP, GO_MF, GO_CC), ignored otherwise. Name of the algorithm that handles the GO graph structures. Valid inputs are those supported by the \code{topGO} library. 
29
+For general information about the algorithms, see \url{https://academic.oup.com/bioinformatics/article/22/13/1600/193669}. \code{weight01} is a mixture between the \code{elim} and the \code{weight} algorithms.}
29 30
 
30 31
 \item{statistic}{Character. Default \code{"fisher"}. One of: \code{"fisher"}, \code{"ks"}, \code{"t"}, \code{"globaltest"}, \code{"sum"}, \code{"ks.ties"}. Statistical test to be used. Only relevant if ontology is GO related (GO_BP, GO_MF, GO_CC), and valid inputs are those supported by the topGO library, ignored otherwise. For the other ontologies the test statistic is always Fisher.}
31 32
 
... ...
@@ -34,7 +34,8 @@ and \emph{Reactome Pathways}, respectively. \code{GO} ontologies require the \co
34 34
 \code{"KEGG"} the \code{clusterProfiler}, \code{"DO"} the \code{DOSE}, and \code{"Reactome"} the \code{ReactomePA} packages, respectively.
35 35
 As they are listed under \code{Suggests}, they may not yet be installed, and the function will throw an error if they are missing.}
36 36
 
37
-\item{algorithm}{Character. Default \code{"weight01"}. One of: \code{"classic"}, \code{"elim"}, \code{"weight"}, \code{"weight01"}, \code{"lea"}, \code{"parentchild"}. Only relevant if ontology is GO related (GO_BP, GO_MF, GO_CC), ignored otherwise. Name of the algorithm that handles the GO graph structures. Valid inputs are those supported by the \code{topGO} library.}
37
+\item{algorithm}{Character. Default \code{"weight01"}. One of: \code{"classic"}, \code{"elim"}, \code{"weight"}, \code{"weight01"}, \code{"lea"}, \code{"parentchild"}. Only relevant if ontology is GO related (GO_BP, GO_MF, GO_CC), ignored otherwise. Name of the algorithm that handles the GO graph structures. Valid inputs are those supported by the \code{topGO} library. 
38
+For general information about the algorithms, see \url{https://academic.oup.com/bioinformatics/article/22/13/1600/193669}. \code{weight01} is a mixture between the \code{elim} and the \code{weight} algorithms.}
38 39
 
39 40
 \item{statistic}{Character. Default \code{"fisher"}. One of: \code{"fisher"}, \code{"ks"}, \code{"t"}, \code{"globaltest"}, \code{"sum"}, \code{"ks.ties"}. Statistical test to be used. Only relevant if ontology is GO related (GO_BP, GO_MF, GO_CC), and valid inputs are those supported by the topGO library, ignored otherwise. For the other ontologies the test statistic is always Fisher.}
40 41
 
... ...
@@ -78,7 +78,7 @@ keeping backwards compatibility with \code{\linkS4class{GRN}} objects.}
78 78
 
79 79
 \item{outputFolder}{Character or \code{NULL}. Default \code{NULL}. If set to \code{NULL}, the default output folder as specified when initiating the object in \code{link{initializeGRN}} will be used. Otherwise, all output from this function will be put into the specified folder. We recommend specifying an absolute path.}
80 80
 
81
-\item{resetGraphAndStoreInternally}{\code{TRUE} or \code{FALSE}.  Default \code{TRUE}. If set to \code{TRUE}, the stored eGRN graph slot graph) is reset due to the potentially changed connections that
81
+\item{resetGraphAndStoreInternally}{\code{TRUE} or \code{FALSE}.  Default \code{TRUE}. If set to \code{TRUE}, the stored eGRN graph (slot \code{graph}) is reset due to the potentially changed connections that
82 82
 would otherwise cause conflicts in the information stored in the object. Also, a GRN object is returned. If set to \code{FALSE}, only the new filtered connections are returned and the object is not altered.}
83 83
 
84 84
 \item{silent}{\code{TRUE} or \code{FALSE}.  Default \code{FALSE}. Print progress messages and filter statistics.}
... ...
@@ -31,7 +31,8 @@ and \emph{Reactome Pathways}, respectively. \code{GO} ontologies require the \co
31 31
 \code{"KEGG"} the \code{clusterProfiler}, \code{"DO"} the \code{DOSE}, and \code{"Reactome"} the \code{ReactomePA} packages, respectively.
32 32
 As they are listed under \code{Suggests}, they may not yet be installed, and the function will throw an error if they are missing.}
33 33
 
34
-\item{algorithm}{Character. Default \code{"weight01"}. One of: \code{"classic"}, \code{"elim"}, \code{"weight"}, \code{"weight01"}, \code{"lea"}, \code{"parentchild"}. Only relevant if ontology is GO related (GO_BP, GO_MF, GO_CC), ignored otherwise. Name of the algorithm that handles the GO graph structures. Valid inputs are those supported by the \code{topGO} library.}
34
+\item{algorithm}{Character. Default \code{"weight01"}. One of: \code{"classic"}, \code{"elim"}, \code{"weight"}, \code{"weight01"}, \code{"lea"}, \code{"parentchild"}. Only relevant if ontology is GO related (GO_BP, GO_MF, GO_CC), ignored otherwise. Name of the algorithm that handles the GO graph structures. Valid inputs are those supported by the \code{topGO} library. 
35
+For general information about the algorithms, see \url{https://academic.oup.com/bioinformatics/article/22/13/1600/193669}. \code{weight01} is a mixture between the \code{elim} and the \code{weight} algorithms.}
35 36
 
36 37
 \item{statistic}{Character. Default \code{"fisher"}. One of: \code{"fisher"}, \code{"ks"}, \code{"t"}, \code{"globaltest"}, \code{"sum"}, \code{"ks.ties"}. Statistical test to be used. Only relevant if ontology is GO related (GO_BP, GO_MF, GO_CC), and valid inputs are those supported by the topGO library, ignored otherwise. For the other ontologies the test statistic is always Fisher.}
37 38
 
... ...
@@ -12,7 +12,7 @@ visualizeGRN(
12 12
   pdf_width = 12,
13 13
   pdf_height = 12,
14 14
   title = NULL,
15
-  maxRowsToPlot = 500,
15
+  maxEdgesToPlot = 500,
16 16
   nCommunitiesMax = 8,
17 17
   graph = "TF-gene",
18 18
   colorby = "type",
... ...
@@ -40,7 +40,7 @@ visualizeGRN(
40 40
 
41 41
 \item{title}{\code{NULL} or Character. Default \code{NULL}. Title to be assigned to the plot.}
42 42
 
43
-\item{maxRowsToPlot}{Integer > 0. Default 500. Refers to the maximum number of connections to be plotted. If the network size is above this limit, nothing will be drawn. In such a case, it may help to either increase the value of this parameter or set the filtering criteria for the network to be more stringent, so that the network becomes smaller.}
43
+\item{maxEdgesToPlot}{Integer > 0. Default 500. Refers to the maximum number of connections to be plotted. If the network size is above this limit, nothing will be drawn. In such a case, it may help to either increase the value of this parameter or set the filtering criteria for the network to be more stringent, so that the network becomes smaller.}
44 44
 
45 45
 \item{nCommunitiesMax}{Integer > 0. Default 8. Maximum number of communities that get a distinct coloring. All additional communities will be colored with the same (gray) color.}
46 46
 
... ...
@@ -70,7 +70,7 @@ This function can visualize a filtered eGRN in a very flexible manner and requir
70 70
 }
71 71
 \examples{
72 72
 GRN = loadExampleObject()
73
-GRN = visualizeGRN(GRN, maxRowsToPlot = 700, graph = "TF-gene", colorby = "type")
73
+GRN = visualizeGRN(GRN, maxEdgesToPlot = 700, graph = "TF-gene", colorby = "type")
74 74
 }
75 75
 \seealso{
76 76
 \code{\link{build_eGRN_graph}}
... ...
@@ -490,7 +490,7 @@ As you can see, some details about the TF-peak-gene and TF-gene are shown as out
490 490
 The `GRaNIE` package also offers a function to visualize a filtered *eGRN* network! It is very easy to invoke, but provides many options to customize the output and the way the graph is drawn. We recommend to explore the options in the R help (`?getGRNConnections`), and here just run the default visualization.
491 491
 
492 492
 
493
-```{r visualizeGRN, echo=TRUE, include=TRUE, eval = TRUE, fig.cap="<i>eGRN example visualization</i>", fig.height = 10, class.output="scroll-200"}
493
+```{r visualizeGRN, echo=TRUE, include=TRUE, eval = TRUE, fig.cap="<i>eGRN example visualization</i>", fig.height = 9, class.output="scroll-200"}
494 494
 GRN = visualizeGRN(GRN, plotAsPDF = FALSE)
495 495
 
496 496
 ```