Learn R Programming

brainGraph (version 0.48.0)

dti_create_mats: Create connection matrices for tractography analysis

Description

This function will take a vector of filenames which contain connection matrices (e.g. the fdt_network_matrix files from FSL) and create arrays of this data. You may choose to normalize these matrices by the waytotal or region size (which both require a character vector of filenames), or not at all.

Usage

dti_create_mats(A.files, Nv, divisor = c("none", "waytotal", "size",
  "rowSums"), div.files, mat.thresh = 0, sub.thresh = 0.5, groups = NULL)

Arguments

A.files
A character vector of the filenames with connection matrices
Nv
Integer representing the number of vertices (rows/columns)
divisor
A character string indicating how to normalize the connection matrices; either 'none', 'waytotal', 'size', or 'rowSums'
div.files
A character vector of the filenames with the data to normalize by (e.g. a list of waytotal files)
mat.thresh
A numeric (vector) for thresholding connection matrices
sub.thresh
A numeric (between 0 and 1) for thresholding by subject numbers
groups
A character vector of group names

Value

  • A list containing:
  • AA 3-d array of the raw connection matrices
  • A.normA 3-d array of the normalized connection matrices
  • A.binA 3-d array of binarized connection matrices
  • A.bin.sumsA list of 2-d arrays of connection matrices, with each entry signifying the number of subjects with a connection present; the number of list elements equals the length of mat.thresh
  • A.indsA list of arrays of binarized connection matrices, containing 1 if that entry is to be included
  • A.norm.subA list of 3-d arrays of the normalized connection matrices for all given thresholds
  • A.norm.meanA list of 2-d arrays of the normalized connection matrices averaged for each group

Details

The argument mat.thresh allows you to choose a numeric threshold, below which the connections will be replaced with 0; this argument will also accept a numeric vector. The argument sub.thresh will keep only those connections for which at least X% of subjects have a positive entry (the default is 0.5, or 50%).

Examples

Run this code
thresholds <- seq(from=0.001, to=0.01, by=0.001)
my.mats <- dti_create_mats(f.A, Nv, 'waytotal', f.way, thresholds,
  sub.thresh=0.5, groups)
my.mats <- dti_create_mats(f.A, Nv, 'size', f.size, thresholds,
  sub.thresh=0.5, groups)

Run the code above in your browser using DataLab