mantispy.pp.sphere#
- mantispy.pp.sphere(adata, method='ZCA-cor', reference='negcon', epsilon=1e-06, by=None, key_added=None, copy=False)#
Whiten profiles with a transform fitted on the reference rows.
- Parameters:
adata (
AnnData) – Object to sphere. Usually well-level profiles.method (
str(default:'ZCA-cor')) –"ZCA"and"ZCA-cor"rotate back into the original feature basis, so the output columns still correspond to features andvarstill describes them."PCA"and"PCA-cor"return principal components, whichvarno longer describes, and warn about it unlesskey_addedis set. The-corvariants whiten the correlation instead of the covariance, so high-variance features do not dominate.reference (
str|None(default:'negcon')) – Rows to fit on:"negcon"for the controls,Nonefor everything, or the name of a booleanobscolumn.epsilon (
float(default:1e-06)) – Regularization added to the singular values.by (
str|None(default:None)) – Fit and apply separately within each group of this column, e.g. per batch.key_added (
str|None(default:None)) – Write tolayers[key_added]instead of overwritingX.copy (
bool(default:False)) – Return a modified copy instead of mutating in place.
- Return type:
- Returns:
None, or the modified copy. WritesXorlayers[key_added].- Raises:
ValueError – If
methodis unknown,referenceselects no rows, a group has fewer than two reference rows, the reference holds missing or infinite values, a-cormethod meets a zero-variance feature, or the reference matrix is not full rank.