abagen.remove_distance

abagen.remove_distance(coexpression, atlas, atlas_info=None, labels=None)[source]

Corrects for distance-dependent correlation effects in coexpression

Regresses Euclidean distance between regions in atlas from correlated gene expression array coexpression. If atlas_info is provided different connection types (e.g., cortex-cortex, cortex-subcortex, subcortex- subcortex) will be residualized independently.

Parameters:
  • coexpression ((R x R) array_like) – Correlated gene expression array, where R is the number of regions, as generated with e.g., numpy.corrcoef(expression).

  • atlas (niimg-like object) – A parcellation image in MNI space, where each parcel is identified by a unique integer ID

  • atlas_info (str or pandas.DataFrame, optional) – Filepath to or pre-loaded dataframe containing information about atlas. Must have at least columns ‘id’, ‘hemisphere’, and ‘structure’ containing information mapping atlas IDs to hemisphere (i.e, “L”, “R”) and broad structural class (i.e., “cortex”, “subcortex”, “cerebellum”). Default: None

  • labels ((N,) array_like, optional) – If only a subset N of the ROIs in atlas were used to generate the coexpression array this array should specify which to consider. Not specifying this may cause a ValueError if atlas and atlas_info do not match. Default: None

Returns:

residualized – Provided coexpression data residualized against spatial distance between region pairs

Return type:

(R, R) numpy.ndarray