Multivariate Distance Matrix Regression (MDMR)

CPAC.cwas.create_cwas(name='cwas', working_dir=None, crash_dir=None)[source]

Connectome Wide Association Studies

This workflow performs CWAS on a group of subjects.

Parameters:
namestring, optional

Name of the workflow.

Returns:
cwasnipype.pipeline.engine.Workflow

CWAS workflow.

Notes

Workflow Inputs:

inputspec.subjects : dict (subject id: nifti files)
    4-D timeseries of a group of subjects normalized to MNI space
inputspec.roi : string (nifti file)
    Mask of region(s) of interest
inputspec.regressor : list (float)
    Corresponding list of the regressor variable of shape (`N`) or (`N`,`1`), `N` subjects
inputspec.cols : list (int)
    todo
inputspec.f_samples : int
    Number of permutation samples to draw from the pseudo F distribution
inputspec.parallel_nodes : integer
    Number of nodes to create and potentially parallelize over

Workflow Outputs:

outputspec.F_map : string (nifti file)
    Pseudo F values of CWAS
outputspec.p_map : string (nifti file)
    Significance p values calculated from permutation tests

CWAS Procedure:

  1. Calculate spatial correlation of a voxel

  2. Correlate spatial z-score maps for every subject pair

  3. Convert matrix to distance matrix, 1-r

  4. Calculate MDMR statistics for the voxel

  5. Determine significance of MDMR statistics with permutation tests


Workflow Graph:

images/generated/cwas.png

Detailed Workflow Graph:

images/generated/cwas_detailed.png

References

[1]

Shehzad Z, Kelly C, Reiss PT, Emerson JW, McMahon K, Copland DA, Castellanos FX, Milham MP. An Analytic Framework for Connectome-Wide Association Studies. Under Review.

CPAC.cwas.joint_mask(subjects, mask_file=None)[source]

Creates a joint mask (intersection) common to all the subjects in a provided list and a provided mask

Parameters:
subjectsdict of strings

A length N list of file paths of the nifti files of subjects

mask_filestring

Path to a mask file in nifti format

Returns:
joint_maskstring

Path to joint mask file in nifti format

CPAC.cwas.nifti_cwas(subjects, mask_file, regressor_file, participant_column, columns_string, permutations, voxel_range)[source]

Performs CWAS for a group of subjects

Parameters:
subjectsdict of strings:strings

A length N dict of id and file paths of the nifti files of subjects

mask_filestring

Path to a mask file in nifti format

regressor_filestring

file path to regressor CSV or TSV file (phenotypic info)

columns_stringstring

comma-separated string of regressor labels

permutationsinteger

Number of pseudo f values to sample using a random permutation test

voxel_rangendarray

Indexes from range of voxels (inside the mask) to perform cwas on. Index ordering is based on the np.where(mask) command

Returns:
F_filestring

.npy file of pseudo-F statistic calculated for every voxel

p_filestring

.npy file of significance probabilities of pseudo-F values

voxel_rangetuple

Passed on by the voxel_range provided in parameters, used to make parallelization easier