make_brainGraph
is the main creation function for creating a
brainGraph
graph object. This is simply an igraph
graph
object with additional attributes (at all levels). Several of the graph-level
attributes serve the purpose of providing metadata on how the connectivity
matrices/networks were created.
make_brainGraph.bg_mediate
creates a graph only for
vertex-level analyses.
make_empty_brainGraph
creates an empty undirected brainGraph
object with vertex count equal to the atlas specified; i.e., it creates a
graph with 0 edges. Typically used to present results from an analysis in
which edges don't make sense (e.g., GLM comparing differences in a
vertex-level attribute).
make_brainGraph(x, atlas, type = c("observed", "random"),
level = c("subject", "group", "contrast"), set.attrs = TRUE,
modality = NULL, weighting = NULL, threshold = NULL, ...)# S3 method for igraph
make_brainGraph(x, atlas, type = c("observed",
"random"), level = c("subject", "group", "contrast"),
set.attrs = TRUE, modality = NULL, weighting = NULL,
threshold = NULL, name = NULL, Group = NULL, subnet = NULL, ...)
# S3 method for matrix
make_brainGraph(x, atlas, type = c("observed",
"random"), level = c("subject", "group", "contrast"),
set.attrs = TRUE, modality = NULL, weighting = NULL,
threshold = NULL, name = NULL, Group = NULL, subnet = NULL,
mode = "undirected", weighted = NULL, diag = FALSE, ...)
# S3 method for bg_mediate
make_brainGraph(x, atlas = x$atlas,
type = "observed", level = "contrast", set.attrs = FALSE,
modality = NULL, weighting = NULL, threshold = NULL, ...)
is.brainGraph(x)
# S3 method for brainGraph
summary(object, print.attrs = c("all", "graph",
"vertex", "edge", "none"), ...)
make_empty_brainGraph(atlas, type = c("observed", "random"),
level = c("subject", "group", "contrast"), modality = NULL,
weighting = NULL, threshold = NULL, name = NULL, Group = NULL,
...)
A brainGraph
graph object with additional graph-, vertex-, and
edge-level attributes (see below).
The method for bg_mediate
returns a brainGraph_mediate
object, which has extra attributes:
mediator, treat, outcome, nobs
b?.acme, p?.acme, b?.ade, p?.ade, b?.prop, p?.prop, b.tot, p.tot
make_empty_brainGraph
-- An empty brainGraph
graph
object
An igraph
graph object, numeric matrix, or bg_mediate
object
Character string specifying the brain atlas
Character string indicating the type of graphs. Default:
observed
Character string indicating whether the graphs are subject-,
group-, or contrast-specific. Default: 'subject'
Logical indicating whether to assign all graph-, vertex-,
and edge-level attributes (via set_brainGraph_attr
). Default:
TRUE
Character string indicating imaging modality (e.g. 'dti').
Default: NULL
Character string indicating how the edges are weighted
(e.g., 'fa', 'pearson', etc.). Default: NULL
Integer or number indicating the threshold used when
“sparsifying” the connectivity matrix (if any). Default: NULL
Arguments passed to set_brainGraph_attr
Character string indicating subject ID or group/contrast name,
depending on the level
. Default: NULL
Character string indicating group membership. Default:
NULL
Integer or character vector indicating the vertices to keep, if you are interested in working with a subset of an atlas. By default, all vertices are used.
Character string defining how the matrix should be interpreted.
Default: 'undirected'
Logical specifying whether to create a weighted network
Logical indicating whether to include the diagonal of the
connectivity matrix. Default: FALSE
A brainGraph
object
Character string indicating whether or not to list the
object's attributes (default: all
)
Graph-level attributes added are:
The R, brainGraph
, and igraph
package versions
used to create the graph
The creation date, from as.POSIXct
Character string denoting the brain atlas used
Character string specifying whether this is an observed or random graph
The imaging modality; you can choose anything you like,
but the summary.brainGraph
knows about dti
, fmri
,
thickness
, area
, and volume
What edge weights represent; you can choose anything you
like, but summary.brainGraph
knows about fa
, sld
(streamline density, tractography), pearson
, spearman
,
kendall
, and partial
(partial correlation coefficient)
Numeric indicating the threshold used to create the final connectivity matrix (if any)
Character string specifying the study ID or group/contrast
name, depending on the level
argument
Character string specifying the experimental group that the given subject belongs to, or if it is a group-level graph
Integer vector, if subnet
was specified in the call
Vertex-level attributes added are:
The names of the brain regions in the network
The names of the major brain lobes for each vertex
The names of the hemisphere for each vertex (either 'L'
,
'R'
, or 'B'
)
The lobe-hemisphere combination (represented as an integer vector)
The tissue class (if applicable)
The network (if the atlas is dosenbach160
)
The spatial coordinates of the (centers-of-mass) brain regions in MNI space
Same as above
Colors for vertices of their respective membership
Integer vector indicating the order (going counter-clockwise from the top) for circular layouts
Edge-level attributes added are:
Correspond to the vertex attribute of the same name. Inter-group edges will be colored gray
You can create a graph for a subset of an atlas's regions with the
subnet
argument. This can either be a numeric or character vector. If
the input object (either a matrix or an igraph
graph) has fewer
rows/columns or vertices, respectively, than the atlas then the subnet
graph attribute will also be added to the return object. This may occur if,
for example, you use make_auc_brainGraph
on graphs that were
initially created from subnetworks.
Other Graph creation functions: Creating_Graphs_GLM
,
brainGraphList
,
make_ego_brainGraph
if (FALSE) {
bg <- make_brainGraph(A, 'dkt', modality='dti', weighting='fa',
mode='undirected', diag=FALSE, weighted=TRUE)
}
Run the code above in your browser using DataLab