Harmonization Tools
Harmonize two datasets by extracting a subset from one dataset containing only the cells that are also present in the other dataset, and by ensuring that the metadata and gene expression measurements are compatible for comparative analysis. This process facilitates the integration of datasets from different sequencing technologies or experimental conditions, allowing for robust downstream analyses such as differential expression, clustering, and trajectory inference.
subset_common_cells
subset_common_cells (dataset1:anndata._core.anndata.AnnData, dataset2:anndata._core.anndata.AnnData)
Subset dataset1 to only include cells that are also present in dataset2.
| Type | Details | |
|---|---|---|
| dataset1 | AnnData | First dataset to be subsetted. |
| dataset2 | AnnData | Second dataset to compare with. |
| Returns | AnnData | Subset of dataset1 containing only cells also found in dataset2. |
Transfer the .obs attribute from one AnnData object to another, ensuring compatibility in .obs dimensionality and preserving the .var DataFrame. This function is designed to maintain the integrity of the target dataset’s gene expression information while enriching it with the metadata from the source dataset. It is a crucial step in the harmonization process, allowing for integrated analysis of datasets from different sources.
transfer_obs
transfer_obs (dataset1:anndata._core.anndata.AnnData, dataset2:anndata._core.anndata.AnnData)
Transfer .obs metadata from dataset1 to dataset2 one by one, while preserving the .var DataFrame of dataset2.
| Type | Details | |
|---|---|---|
| dataset1 | AnnData | Source AnnData object with .obs metadata to transfer. |
| dataset2 | AnnData | Target AnnData object to receive .obs metadata. |
| Returns | AnnData | The modified dataset2 with .obs from dataset1 transferred. |