Learn R Programming

brainGraph (version 2.2.0)

brainGraph_init: Initialize variables for further use in brainGraph

Description

Initializes some variables that are important for further analysis of structural covariance networks (e.g., cortical thickness). This mostly involves loading CSV files (of covariates/demographics, cortical thickness/volumes, etc.) and returning them as data tables.

Usage

brainGraph_init(atlas, densities, datadir, modality = "thickness",
  covars = NULL, exclude.subs = NULL, custom.atlas = NULL)

Arguments

atlas

Character string indicating which brain atlas you are using. This can be an atlas present with the package or a custom atlas; in this case you must specify custom here and assign the name to the argument custom.atlas.

densities

Numeric vector of the graph densities you would like to investigate

datadir

Character string; the filesystem location of your input files

modality

Character string indicating the volumetric MRI modality/measure used to create the graphs (default: thickness)

covars

A data.table of covariates; specify this if you do not want to load your full covariates file (default: NULL)

exclude.subs

Character vector of the Study ID's of subjects who are to be excluded from the analysis (default: NULL)

custom.atlas

Character string of the name of the custom atlas you wish to use, if applicable (default: NULL)

Value

A list containing:

atlas

Character string of the brain atlas name

densities

Numeric vector of the graph densities

modality

Character string of the modality you chose

kNumDensities

Integer indicating the number of densities

covars

A data.table of covariates

groups

Character vector of subject group names

kNumGroups

Integer indicating the number of groups

kNumVertices

Integer; the number of vertices in the graphs

lhrh

A data.table of left- and right-hemispheric volumetric data

Details

You can use any atlas that is already present in the package; to check the available atlases, you can type data(package="brainGraph")$results[, 3] at the R prompt. If you have a custom atlas, specify atlas="custom" and supply the R object's name for the argument custom.atlas.

The file containing covariates should be named covars.csv. However, you may also supply a data.table using the function argument covars. This is useful if you have multiple covariates in your file and wish to subset the data on your own. It must have, at minimum, columns named Study.ID and Group (even if you have only 1 group).

The filenames of the structural MRI data should include hemisphere, atlas, and modality separated by the underscore character; e.g. lh_dkt_thickness.csv contains cortical thickness of left hemisphere regions of the DKT atlas. If you would like to include subcortical gray matter, then you will need files covars.scgm.csv and scgm.csv.

See Also

Other Structural covariance network functions: IndividualContributions, brainGraph_boot, brainGraph_permute, corr.matrix, get.resid, plot.brainGraph_resids, plot_volumetric

Examples

Run this code
# NOT RUN {
init.vars <- brainGraph_init(atlas='dkt', densities=seq(0.07, 0.50, 0.01),
  datadir='/home/cwatson/Data', modality='thickness', exclude.subs=c('Con07',
  'Con23', 'Pat15'))
# }

Run the code above in your browser using DataLab