External API: Preprocessing
scanpy.external.pp.harmony_integrate()
https://scanpy.readthedocs.io/en/stable/generated/scanpy.external.pp.harmony_integrate.html
integrate data sets (correct batch effect )
Notes:
- before integration, all data sets should be
store in the same AnnData object
- the whole operation is about
adjusting the principal components
- this function should be run
after performing PCA
butbefore computing the neighbor graph (KNN)
scanpy.external.pp.harmony_integrate(adata, key=, basis=, adjusted_basis=)
key=
: column of.obs
to be used (the source of the batch effect)
basis=
: the field name that PCA results were stored in.obsm
;default='X_pca'
adjusted_basis=
: the field name that the result will be stored in.obsm
;default='X_pca_harmony'
Note: 整合后的结果存放在
.obsm['X_pca_harmony']
中;维度与.obsm['X_pca']
相同