rnanorm.CUF¶
- class rnanorm.CUF[source]¶
Counts adjusted with Upper quartile factors normalization.
Procedure for normalization is described in Johnson & Krishnan, 2022, but in short:
Use raw counts as input
Compute normalization factors the same way as in UpperQuartile
Divide raw counts with these factors
Examples
>>> from rnanorm.datasets import load_toy_data >>> from rnanorm import CUF >>> X = load_toy_data().exp >>> X Gene_1 Gene_2 Gene_3 Gene_4 Gene_5 Sample_1 200 300 500 2000 7000 Sample_2 400 600 1000 4000 14000 Sample_3 200 300 500 2000 17000 Sample_4 200 300 500 2000 2000 >>> CUF().set_output(transform="pandas").fit_transform(X) Gene_1 Gene_2 Gene_3 Gene_4 Gene_5 Sample_1 200.0 300.0 500.0 2000.0 7000.0 Sample_2 400.0 600.0 1000.0 4000.0 14000.0 Sample_3 400.0 600.0 1000.0 4000.0 34000.0 Sample_4 100.0 150.0 250.0 1000.0 1000.0
- __init__()¶
Methods
__init__()fit(X[, y])Fit.
fit_transform(X[, y])Fit to data, then transform it.
get_feature_names_out([input_features])Get output feature names for transformation.
get_metadata_routing()Get metadata routing of this object.
get_norm_factors(X)Get UQ normalization factors (normalized with geometric mean).
get_params([deep])Get parameters for this estimator.
set_output(*[, transform])Set output container.
set_params(**params)Set the parameters of this estimator.
transform(X)Transform.