GRN
object.getTopNodes.Rd
This function requires a filtered set of connections in the GRN
object as generated by filterGRNAndConnectGenes
.
Note: This function, as all get
functions from this package, does NOT return a GRN
object.
getTopNodes(GRN, nodeType, rankType, n = 0.1, use_TF_gene_network = TRUE)
Object of class GRN
Character. One of: "gene"
or "TF"
. Node type.
Character. One of: "degree"
, "EV"
. This parameter will determine the criterion to be used to identify the "top" nodes. If set to "degree", the function will select top nodes based on the number of connections they have, i.e. based on their degree-centrality. If set to "EV" it will select the top nodes based on their eigenvector-centrality score in the network.
Numeric. Default 0.1. If this parameter is passed as a value between [0,1], it is treated as a percentage of top nodes. If the value is passed as an integer >=1 it will be treated as the number of top nodes.
TRUE
or FALSE
. Default TRUE
. Should the TF-gene network be used (TRUE
) or the TF-peak-gene network (FALSE
)?
A data frame with the node names and the corresponding scores used to rank them
# See the Workflow vignette on the GRaNIE website for examples
GRN = loadExampleObject()
#> Downloading GRaNIE example object from https://git.embl.de/grp-zaugg/GRaNIE/-/raw/master/data/GRN.rds
#> Finished successfully. You may explore the example object. Start by typing the object name to the console to see a summaty. Happy GRaNIE'ing!
topGenes = getTopNodes(GRN, nodeType = "gene", rankType = "degree", n = 3)
#> INFO [2024-09-25 19:18:09] n = 3 equals finding the top 3 degree-central genes in the network
#> INFO [2024-09-25 19:18:09] Finished successfully. Execution time: 0 secs
topTFs = getTopNodes(GRN, nodeType = "TF", rankType = "EV", n = 5)
#> INFO [2024-09-25 19:18:09] n = 5 equals finding the top 5 EV-central TFs in the network
#> This graph was created by an old(er) igraph version.
#> Call upgrade_graph() on it to use with the current igraph version
#> For now we convert it on the fly...
#> INFO [2024-09-25 19:18:10] Finished successfully. Execution time: 0.3 secs