View source: R/network_analysis.R
chooseNodeStats | R Documentation |
Create a vector specifying node-level network properties to compute.
Intended for use with buildRepSeqNetwork()
or
addNodeNetworkStats
.
node_stat_settings()
is a deprecated equivalent of
chooseNodeStats()
.
chooseNodeStats(
degree = TRUE,
cluster_id = FALSE,
transitivity = TRUE,
closeness = FALSE,
centrality_by_closeness = FALSE,
eigen_centrality = TRUE,
centrality_by_eigen = TRUE,
betweenness = TRUE,
centrality_by_betweenness = TRUE,
authority_score = TRUE,
coreness = TRUE,
page_rank = TRUE,
all_stats = FALSE
)
exclusiveNodeStats(
degree = FALSE,
cluster_id = FALSE,
transitivity = FALSE,
closeness = FALSE,
centrality_by_closeness = FALSE,
eigen_centrality = FALSE,
centrality_by_eigen = FALSE,
betweenness = FALSE,
centrality_by_betweenness = FALSE,
authority_score = FALSE,
coreness = FALSE,
page_rank = FALSE
)
degree |
Logical. Whether to compute network degree. |
cluster_id |
Logical. Whether to perform cluster analysis and record the cluster
membership of each node.
See |
transitivity |
Logical. Whether to compute node-level network transitivity using
|
closeness |
Logical. Whether to compute network closeness using
|
centrality_by_closeness |
Logical. Whether to compute network centrality by closeness. The values are
the entries of the |
eigen_centrality |
Logical. Whether to compute the eigenvector centrality scores of node network
positions. The scores are the entries of the |
centrality_by_eigen |
Logical. Whether to compute node-level network centrality scores based on
eigenvector centrality scores. The scores are the entries of the |
betweenness |
Logical. Whether to compute network betweenness using
|
centrality_by_betweenness |
Logical. Whether to compute network centrality scores by betweenness. The
scores are the entires of the |
authority_score |
Logical. Whether to compute the authority score using
|
coreness |
Logical. Whether to compute network coreness using
|
page_rank |
Logical. Whether to compute page rank. The page rank values are the entries of
the |
all_stats |
Logical. If |
These functions return a vector that can be passed to the stats_to_include
argument of addNodeStats()
(or buildRepSeqNetwork()
, if
node_stats = TRUE
)
in order to specify which node-level network properties to compute.
chooseNodeStats
and exclusiveNodeStats
each have default
argument values suited to a different use case,
in order to reduce the number of argument values that must be set manually.
chooseNodeStats
has most arguments TRUE
by default.
It is best suited for including a majority of the available properties.
It can be called with all_stats = TRUE
to set all values to TRUE
.
exclusiveNodeStats
has all of its arguments set to FALSE
by
default. It is best suited for including only a few properties.
A named logical vector with one entry for each of the function's arguments
(except for all_stats
).
Each entry has the same name as the corresponding argument, and its value
matches the argument's value.
Brian Neal (Brian.Neal@ucsf.edu)
Hai Yang, Jason Cham, Brian Neal, Zenghua Fan, Tao He and Li Zhang. (2023). NAIR: Network Analysis of Immune Repertoire. Frontiers in Immunology, vol. 14. doi: 10.3389/fimmu.2023.1181825
addNodeStats()
set.seed(42)
toy_data <- simulateToyData()
net <- generateNetworkObjects(
toy_data, "CloneSeq"
)
# Add default set of node properties
net <- addNodeStats(net)
# Modify default set of node properties
net <- addNodeStats(
net,
stats_to_include =
chooseNodeStats(
closeness = TRUE,
page_rank = FALSE
)
)
# Add only the spepcified node properties
net <- addNodeStats(
net,
stats_to_include =
exclusiveNodeStats(
degree = TRUE,
transitivity = TRUE
)
)
# Add all node-level network properties
net <- addNodeStats(
net,
stats_to_include = "all"
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.