Learn R Programming

brainGraph (version 2.7.3)

set_brainGraph_attr: Set graph, vertex, and edge attributes common in MRI analyses

Description

This function sets a number of graph, vertex, and edge attributes for a given igraph graph object. These are all measures that are common in MRI analyses of brain networks.

Usage

set_brainGraph_attr(g, atlas = NULL, rand = FALSE,
  use.parallel = TRUE, A = NULL, xfm.type = c("1/w", "-log(w)",
  "1-w"), clust.method = "louvain", ...)

Arguments

g

An igraph graph object

atlas

Character vector indicating which atlas was used (default: NULL)

rand

Logical indicating if the graph is random or not (default: FALSE)

use.parallel

Logical indicating whether or not to use foreach (default: TRUE)

A

Numeric matrix; the (weighted) adjacency matrix, which can be used for faster calculation of local efficiency (default: NULL)

xfm.type

Character string indicating how to transform edge weights (default: 1/w [reciprocal])

clust.method

Character string indicating which method to use for community detection. Default: 'louvain'

...

Other arguments passed to make_brainGraph

Value

g An igraph graph object with the following attributes:

Graph-level

Density, connected component sizes, diameter, \# of triangles, transitivity, average path length, assortativity, global & local efficiency, modularity, vulnerability, hub score, rich-club coefficient, \# of hubs, edge asymmetry, and modality

Vertex-level

Degree, strength; betweenness, eigenvector, and leverage centralities; hubs; transitivity (local); k-core, s-core; local & nodal efficiency; color (community, lobe, component); membership (community, lobe, component); gateway and participation coefficients, within-module degree z-score; vulnerability; and coordinates (x, y, and z)

Edge-level

Color (community, lobe, component), edge betweenness, Euclidean distance (in mm), weight (if weighted)

Details

xfm.type allows you to choose from 3 options for transforming edge weights when calculating distance-based metrics (e.g., shortest paths). There is no "best-practice" for choosing one over the other, but the reciprocal is probably most common.

  • 1/w: reciprocal (default)

  • -log(w): the negative (natural) logarithm

  • 1-w: subtract weights from 1

clust.method allows you to choose from any of the clustering (community detection) functions available in igraph. These functions all begin with clust_; the function argument should not include this leading character string. The default value is louvain, which calls cluster_louvain. If there are any negative edge weights, and the selected method is anything other than spinglass or walktrap, then walktrap is used (calling cluster_walktrap). If edge_betweenness is selected and the graph is weighted, then the edges are first transformed (via xfm.weights), because the algorithm considers edges as distances.

Since v2.4.0, hubs are calculated by the new function hubness. It is calculated using edge weights in addition to the unweighted version of the graph.

See Also

components, diameter, clique_num, centr_betw, part_coeff, edge.betweenness, centr_eigen, gateway_coeff, transitivity, mean_distance, assortativity_degree, efficiency, assortativity_nominal, coreness, communities, set_edge_color, rich_club_coeff, s_core, centr_lev, within_module_deg_z_score, edge_spatial_dist, vulnerability, edge_asymmetry, graph.knn, vertex_spatial_dist