Skip to main content

rob-norm 🦭🧬

Python implementation of the RobNorm R package for robust normalization of quantitative omics data.

Features

  • Identical normalization results to the original R implementation.
  • Fast and efficient implementation using NumPy (57 ms vs 113 ms in R for 5000x200 data on an M1 MacBook Air)

Installation

Install via pip:

pip install rob-norm

Usage

import pandas as pd
from rob_norm import rob_norm

# load your data into a DataFrame (rows = features, columns = samples)
data = pd.read_csv('./data/simulated_measurements.txt', index_col=0, sep='\t')

# alternatively, simulate data using the provided function
# sim_dat_fn(row_frac, col_frac, mu_up, mu_down, n, m, nu_fix=True, seed=None):

# perform a normalization operation provided by the package
results = rob_norm(data, gamma_0=0.5, tol=1e-4, step=200)

normalized_data = results['norm_data']

# verify against reference results
df_results = pd.read_csv('./data/simulated_measurements_normalized.txt', index_col=0, sep='\t')

assert np.allclose(df_results, normalized_data) # == True

Development

Clone the repository and use uv for development and testing:

git clone https://github.com/Tom-Julux/rob_norm
cd rob_norm

uv run pytest
uv build
uv publish

License

The project is licensed under the GNU Lesser General Public License v3.0.

See the LICENSE file for full licensing information.

The file data/robnorm.r contains R code used to generate reference results for testing and was copied and adapted from the original R package RobNorm.

Metadata

Release files for rob-norm 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for rob-norm 1.0.1
File Size Uploaded
rob_norm-1.0.1.tar.gz 4.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for rob-norm 1.0.1
File Interpreter ABI Platform
rob_norm-1.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 11.1 kB

Release files / rob_norm-1.0.1.tar.gz

Download URL rob_norm-1.0.1.tar.gz
Size 4.9 kB
Tags Source
SHA-256 checksum
How to use checksums
46bf10d4b3994394ddc7ad3ec6de03a8d23ee979d9a8343523fc70d22b5461e8
BLAKE2b-256 checksum
How to use checksums
844aed3aeb212c8857db1f3bb5fc168dd8a516e3a9dabea1e11c7c948c90b8bc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / rob_norm-1.0.1-py3-none-any.whl

Download URL rob_norm-1.0.1-py3-none-any.whl
Size 6.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
83aa7281f1a35e16866fee0dc75676ba53d48449b09eb720ee84db40d646adaa
BLAKE2b-256 checksum
How to use checksums
bd4f6b00f7e8baed16d36e52305271f635a723b358a38426a6865c034a9af31a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page