tacco.tools.annotate_nnls¶
- annotate_nnls(adata, reference, annotation_key=None, counts_location=None)[source]¶
Annotates an
AnnData
using reference data by NNLS (non-negative least squares).This is the direct interface to this annotation method. In practice using the general wrapper
annotate()
is recommended due to its higher flexibility.- Parameters:
adata – An
AnnData
including expression data in .X.reference – Reference data to get the annotation definition from.
annotation_key – The .obs and/or .varm key where the annotation and/or profiles are stored in the reference. If None, it is inferred from reference, if possible.
counts_location – A string or tuple specifying where the count matrix is stored, e.g. ‘X’, (‘raw’,’X’), (‘raw’,’obsm’,’my_counts_key’), (‘layer’,’my_counts_key’), … For details see
counts()
.
- Returns:
Returns the annotation in a
DataFrame
.