mantispy.tl.dna_state#
- mantispy.tl.dna_state(adata, key='Metadata_DNAContent', cutoffs=(1.25, 1.75), key_added='Metadata_DNAState', copy=False)[source]#
Call each cell 2N, S or 4N from fixed gates on its DNA content.
- Parameters:
- adata
AnnData Single-cell object carrying the output of
dna_content().- key
str(default:'Metadata_DNAContent') obscolumn holding the DNA content, in doublings of the G1 peak.- cutoffs
tuple[float,float] (default:(1.25, 1.75)) The lower and upper gate, in multiples of the G1 peak intensity. A cell below the lower gate is 2N, at or above the upper gate 4N, and in between S. The defaults sit a quarter of the way from each peak towards the other, the usual gates on a DNA content histogram.
- key_added
str(default:'Metadata_DNAState') obscolumn written.- copy
bool(default:False) Return a modified copy instead of mutating in place.
- adata
- Return type:
- Returns:
None, or the modified copy. Writesobs[key_added]as a categorical overDNA_STATES,NaNwhere the DNA content isNaN. Writesuns["mantispy"]["dna_state"]with thekeyread and thecutoffsapplied, so the call can be reproduced.- Raises:
KeyError –
obshas no columnkey.ValueError –
cutoffsis not two finite, positive, increasing values.
Notes
Fixed gates cannot tell G0 from G1, or a late-S cell from a G2 cell whose stain is a little dim. A cell above 4N, from polyploidy or a doublet, is called 4N.