mantispy.pl.cell_cycle_occupancy#
- mantispy.pl.cell_cycle_occupancy(adata, key='cell_cycle', by='Metadata_Perturbation', highlight=None, palette=None, legend_loc='right margin', legend_fontsize=6, seed=0, ax=None)[source]#
How the cells of each group occupy the cycle placed by
project_cell_cycle().Each cell contributes one position drawn from its own posterior, so a cell in a plateau spreads over that plateau instead of piling onto its median, and an arrest shows as a group’s curve rising above the others at one position. Cells off the cycle have no position and are left out. Dotted lines mark where S begins and ends.
- Parameters:
- adata
AnnData Single-cell object
project_cell_cycle()has run on.- key
str(default:'cell_cycle') The
key_addedprefixproject_cell_cycle()wrote.- by
str|None(default:'Metadata_Perturbation') obscolumn whose groups become curves, orNonefor one curve over every row.- highlight
str|None(default:None) A group of
by, such as the controls, drawn thicker and in black.- palette
Mapping[str,Any] |Sequence[Any] |str|None(default:None) Colours for the groups, read as in
cell_cycle_clock();Nonefor the matplotlib colour cycle.- legend_loc
str|None(default:'right margin') "right margin"for a legend beside the plot, orNonefor no legend.- legend_fontsize
float(default:6) Font size of the legend.
- seed
int(default:0) Seed for the positions drawn.
- ax
Axes|None(default:None) Axes to draw on, or
Nonefor a new figure.
- adata
- Return type:
- Returns:
The axes when the caller passed
ax, elseNonebecause the plot then owns the figure it created. They hold one density curve per group ofby.- Raises:
KeyError –
obsmhas nokey + "_quantiles".ValueError –
legend_locis not"right margin"orNone.