dynamo.ext.coexp_measure

dynamo.ext.coexp_measure(adata, genes, layer_x, layer_y, cores=1, skip_mi=True)[source]

Calculate co-expression measures, including mutual information (MI), pearson correlation, etc. of genes between two different layers.

Parameters:
  • adata (AnnData.) – adata object that will be used for mutual information calculation.

  • genes (List (default: None)) – Gene names from the adata object that will be used for mutual information calculation.

  • layer_x (str) – The first key of the layer from the adata object that will be used for mutual information calculation.

  • layer_y (str) – The second key of the layer from the adata object that will be used for mutual information calculation.

  • cores (int (default: 1)) – Number of cores to run the MI calculation. If cores is set to be > 1, multiprocessing will be used to parallel the calculation. cores is only applicable to MI calculation.

  • skip_mi (bool (default: True)) – Whether to skip the mutual information calculation step which is time-consuming.

Returns:

An updated adata object that updated with a new columns (mi, pearson) in .var contains the mutual information of input genes.