pegasus.arcsinh_transform¶
- pegasus.arcsinh_transform(data, cofactor=5.0, jitter=False, random_state=0, backup_matrix='raw.X')[source]¶
Conduct arcsinh transform on the current matrix.
If jitter == True, jittering by adding a randomized value in U([-0.5, 0.5)). This will also make the matrix dense. Mimic Cytobank.
- Parameters
cofactor (
float
, optional, default:5.0
) – Cofactor used in cytobank, arcsinh(x / cofactor).jitter (
bool
, optional, default:False
) – Add a ‘arcsinh.jitter’ matrix in dense format, jittering by adding a randomized value in U([-0.5, 0.5)).random_state (
int
, optional, default:0
) – Random seed for generating jitters.backup_matrix (
str
, optional, default:raw.X
.) – The key name of the backup count matrix, usually the raw counts.
- Return type
None
- Returns
None
Update
data.X
with count matrix after log-normalization. In addition, back up the original count matrix asbackup_matrix
.In case of rerunning normalization while
backup_matrix
already exists, usebackup_matrix
instead ofdata.X
for normalization.
Examples
>>> pg.arcsinh_transform(data)