Learn R Programming

brainGraph (version 1.0.0)

brainGraph_init: Initialize variables for further use in brainGraph

Description

This function initializes some variables that are important for further analysis with the brainGraph package. This mostly involves loading CSV files (of covariates/demographics, cortical thickness/volumes, etc.) and returning them as data tables.

Usage

brainGraph_init(atlas = c("aal116", "aal2.120", "aal2.94", "aal90",
  "brainsuite", "craddock200", "destrieux", "destrieux.scgm", "dk", "dk.scgm",
  "dkt", "dkt.scgm", "dosenbach160", "hoa112", "lpba40"), densities, datadir,
  modality = c("thickness", "volume", "lgi", "area"), use.mean = FALSE,
  covars = NULL, exclude.subs = NULL)

Arguments

atlas
A character string indicating which brain atlas you are using
densities
A numeric vector of the graph densities you would like to investigate
datadir
A character string; the filesystem location of your input files
modality
A character string indicating the volumetric MRI modality/measure you are using to create the graphs ('thickness', 'volume', 'lgi', or 'area')
use.mean
A logical indicating whether or not you would like to calculate the mean hemispheric volumetric measure (for later use in linear models) (default: FALSE)
covars
(optional) A data.table of covariates; specify this if you do not want to load your full covariates file (default: NULL)
exclude.subs
(optional) A character vector of the Study ID's of subjects who are to be excluded from the analysis

Value

A list containing:
atlas
A character string of the brain atlas name
densities
A numeric vector of the graph densities
modality
A character string of the modality you chose
kNumDensities
An integer indicating the number of densities
covars
A data.table of covariates
groups
A character vector of subject group names
kNumGroups
An integer indicating the number of groups
kNumVertices
An integer; the number of vertices in the graphs
lhrh
A data.table of left- and right-hemispheric volumetric data
all.dat
A merged data.table of covars and lhrh
all.dat.tidy
A 'tidied' version of all.dat

Details

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. The files containing volumetric data should include hemisphere, atlas, and modality, e.g. lh_dkt_thickness.csv. If you would like to include subcortical gray matter, then you will need files covars.scgm.csv and scgm.csv.

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'), use.mean=FALSE)
## ---------------------------------------------

Run the code above in your browser using DataLab