mmc.landmark_register_adts()

mmochi.landmarking.landmark_register_adts(adata, batch_key=utils.BATCH_KEY, data_key='protein', key_added='landmark_protein', show=False, single_peaks=[], marker_bandwidths={}, peak_overrides={}, inclusion_mask=None, **kwargs)

Batch correction for expression of all ADTs.

Performs negative and positive peak alignment on histograms of ADT expression. Currently expects log or arcsine normalized ADTs (e.g. log2(CP1k)). This was developed in parallel with ADTnorm, a similar function which uses arcsine transformed ADTs https://doi.org/10.1101/2022.04.29.489989

Parameters:
  • adata (AnnData) – object with [batch_key] in .obs, [data_key] log or arcsine normalized data in .obsm to be batch corrected

  • batch_key (str (default: utils.BATCH_KEY)) – column in the .obs of the adata, corresponding to batch information

  • data_key (str (default: 'protein')) – key of the DataFrame in the .obsm of the adata, corresponding to the ADT expression information

  • key_added (str (default: 'landmark_protein')) – key of the DataFrame in the .obsm of the adata to insert landmark registered ADT expression

  • show (Union[bool, int] (default: False)) – Whether to show plotted intermediates to better reveal peak detection. Note, this disables parallel processing. Integers (up to 3) correspond to increased verbosity level.

  • single_peaks (List[str] (default: [])) – Columns in adata.obsm[data_key] corresponding to ADTs to only align a single peak of. If multiple peaks are found, the maximum on the histogram will be used.

  • marker_bandwidths (dict (default: {})) – In the format {‘marker_1’:0.5}, to override bandwidths used for individual markers

  • peak_overrides (Union[dict, str] (default: {})) – In the format { ‘batch_1’:{‘marker_1’:[0.1,0.5]} }, to override peak detection for individual markers in individual batches. To force a positive peak, pass [None,float] as the override. To force a negative peak, you can pass simply [float]. Can also be passed as a str, corresponding to the file path of a JSON saved with this same format.

  • inclusion_mask (Union[str, List, None] (default: None)) – Mask events included in landmark registration warping calculation or a column in the .obs with such a mask

  • **kwargs – Other key word arguments are passed to _detect_landmarks

Return type:

Adata with batch corrected [data_key], correcting over [batch_key]