tacco.tools.annotate_NMFreg¶
- annotate_NMFreg(adata, reference, annotation_key, K=30, random_state=42, counts_location=None, min_counts_per_cell=0, min_counts_per_gene=0)[source]¶
Annotates an
AnnData
using reference data by NMFreg [Rodriques19].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 key where the annotation is stored in the reference. If None, it is inferred from reference, if possible.
K – Number of NMF factors
random_state – Random seed
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()
.min_counts_per_cell – Minimum number of counts per cell
min_counts_per_gene – Minimum number of counts per gene
- Returns:
Returns the annotation in a
DataFrame
.