nichecompass.utils.generate_multimodal_mapping_dict

nichecompass.utils.generate_multimodal_mapping_dict(adata, adata_atac, gene_region='combined', promoter_len=2000, extend_range=0, extend_fn=None, uppercase=True)

Build a mapping dict to map peaks to genes based on chromosomal bp position overlaps.

Parts of the implementation are adapted from Cao, Z.-J. & Gao, G. Multi-omics single-cell data integration and regulatory inference with graph-linked embedding. Nat. Biotechnol. 40, 1458–1466 (2022) -> https://github.com/gao-lab/GLUE/blob/master/scglue/genomics.py#L473; 14.04.23.

Parameters:
  • adata (AnnData) – AnnData rna object with genes as features.

  • adata_atac (AnnData) – AnnData atac object with peaks as features.

  • gene_region (Literal['combined', 'promoter', 'gene_body'] (default: 'combined')) – Defines what should be considered to determine the bp positions for genes. Allowed values are ´gene_body´, ´promoter´, or ´combined´.

  • promoter_len (int (default: 2000)) – Defines the length of gene promoters (bp upstream of TSS).

  • extend_range (int (default: 0)) – Maximum extended bidirectional range in bps beyond overlap for peaks and genes to be mapped (an edge to be created in the mapping graph).

  • extend_fn (Optional[Callable[[int], float]] (default: None)) – Distance-decreasing weight function for the extended regions (edges will have a weight lower than 1, but for now this is ignored).

  • uppercase (bool (default: True)) – Convert genes to upper case in the returned mapping dict.

Return type:

dict

Returns:

multimodal_mapping_dict: Dictionary that maps genes to atac omics features (peaks).