Registry / ai-ml / rnanorm

rnanorm

JSON →
library2.2.0pypypi✓ verified 82d ago

Rnanorm provides common RNA-seq normalization methods (TPM, CPM, FPKM, TMM, etc.) with a scikit-learn-like API. Current version 2.2.0 requires Python >=3.9, <3.14. The library is actively maintained with regular releases.

pip install rnanorm
INSTALL
IMPORT
SIG · RNANORM
R
rnanorm
ai-mlpythonv2.2.0
Install
16.7s avg
Import
Disk
369MB
Pass rate
5/ 10
Env Coverage5 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v2.2.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
build_error
glibc
py 3.103.95 runs
installs and imports cleanly · install 16.7s · import 0.000s · 357MB
369MB installed
● package 369MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

CPM
from rnanorm import CPM
from rnanorm.datasets import CountData
TMM
from rnanorm import TMM
TPM
from rnanorm import TPM

Basic usage: load example count data, apply TPM normalization with dummy gene lengths.

import pandas as pd from rnanorm import TPM from rnanorm.datasets import CountData # Load example dataset counts = CountData() exp = counts.expression # TPM normalization (requires gene lengths) # For demo, use dummy lengths (1 for all genes) lengths = pd.Series(1.0, index=exp.columns) tpm = TPM().set_output(transform='pandas').fit_transform(exp, lengths) print(tpm.iloc[:5, :5])
Debug
Known issues
breakingIn version 2.0.0, the API changed from fit/transform on raw counts to requiring explicit gene lengths for length-dependent methods (TPM, FPKM). The 'expression' attribute of CountData now returns a DataFrame, not an object with .counts.
fix
Upgrade code to pass lengths to fit_transform. See migration guide: https://rnanorm.readthedocs.io/en/latest/migration.html
affects: <2.0.0
breakingCountData is no longer importable directly from rnanorm; it must be imported from rnanorm.datasets.
fix
Change 'from rnanorm import CountData' to 'from rnanorm.datasets import CountData'
affects: >=2.0.0
gotchaLength-dependent methods (TPM, FPKM) require gene lengths as a pandas Series or array with the same index as the expression DataFrame columns. Using wrong or missing lengths will silently produce incorrect results.
fix
Always provide correct gene lengths; verify by checking that the sum of each sample's TPM is approximately 1e6.
affects: >=2.0.0
gotchaThe set_output(transform='pandas') method must be called before fit_transform to get a DataFrame output; otherwise output is a numpy array.
fix
Chain .set_output(transform='pandas') on the estimator before calling fit_transform.
affects: >=2.0.0
deprecatedThe 'log1p' parameter in some normalizers is deprecated and will be removed in future versions.
fix
Apply log transformation manually after normalization using numpy.log1p.
affects: >=2.0.0
Upgrade
Version history
2.2.0latest on PyPI · released Jan 29, 2025
Audit
Dependencies
scikit-learnrequiredAPI design and base classes
pandasrequiredData handling
numpyrequiredArray operations
Agent activity
11 hits · last 30 days
node
9
OpenAI (training)
1
Resources
rnanorm — pip install rnanorm · libregistry