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:

name (string, optional) – Name of the workflow.

Returns:

cwas – CWAS workflow.

Return type:

nipype.pipeline.engine.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
outputspec.z_map : string (nifti file)
    Significance p values converted to z-scores

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

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

Create a joint mask.

A joint mask is an intersection common to all the subjects in a provided list and a provided mask.

Parameters:
  • subjects (dict of strings) – A length N list of file paths of the nifti files of subjects

  • mask_file (string) – Path to a mask file in nifti format

Returns:

joint_mask – Path to joint mask file in nifti format

Return type:

string

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

Perform CWAS for a group of subjects.

Parameters:
  • subjects (dict of strings:strings) – A length N dict of id and file paths of the nifti files of subjects

  • mask_file (string) – Path to a mask file in nifti format

  • regressor_file (string) – file path to regressor CSV or TSV file (phenotypic info)

  • columns_string (string) – comma-separated string of regressor labels

  • permutations (integer) – Number of pseudo f values to sample using a random permutation test

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

Returns:

  • F_file (string) – .npy file of pseudo-F statistic calculated for every voxel

  • p_file (string) – .npy file of significance probabilities of pseudo-F values

  • voxel_range (tuple) – Passed on by the voxel_range provided in parameters, used to make parallelization easier