chrysalis.integrate_adatas
- chrysalis.integrate_adatas(adatas: List[AnnData], sample_names: Optional[List[str]] = None, calculate_svgs: bool = False, sample_col: str = 'sample', **kwargs)
Integrate multiple samples stored in AnnData objects.
If ENSEMBL IDs are present in the`.var[‘gene_ids’]` column, that will be used instead of gene symbols. .var[‘spatially_variable’] will be outer joined.
- Parameters:
adatas – List of AnnData objects.
sample_names – List of sample names. If not defined, a list of integers [0, 1, …] will be used instead.
calculate_svgs – If True, the function also runs chrysalis.detect_svgs for every sample.
sample_col – .obs column name to store the sample labels.
kwargs – Keyword arguments for chrysalis.detect_svgs.
- Returns:
Integrated AnnData object. Sample IDs are stored in .obs[sample_col]. `.var[‘spatially_variable’] contains the union of`.var[‘spatially_variable’]` from the input AnnData objects. Sample-wise SVG data is stored in .varm[‘spatially_variable’] and Moran’s I is stored in .varm[“Moran’s I”].