Skip to content

Rename tpm to cpm throughout the API (breaking) (2.1.0) - #45

Merged
YalanBi merged 2 commits into
masterfrom
feature/rename-tpm-to-cpm
Aug 5, 2026
Merged

Rename tpm to cpm throughout the API (breaking) (2.1.0)#45
YalanBi merged 2 commits into
masterfrom
feature/rename-tpm-to-cpm

Conversation

@YalanBi

@YalanBi YalanBi commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator

Summary

Everywhere "tpm" appeared in the API, the formula was count / total_reads_in_sample * 1e6 -- CPM, with no transcript-length normalization. Renamed throughout to match: transcript_table(cpm=..., cpm_pseudocount=...), _cpm/_sum_cpm columns, Gene.cpm(), estimate_cpm_threshold (was in __init__.py's __all__), the run_isotools CLI, and all docstrings/plot labels.

Clean break, no deprecated alias -- tpm= now raises TypeError. The computation itself is unchanged (still CPM), so this is a rename, not a math change.

Also updated the 6 tutorial notebooks referencing the old tpm= API/wording, so the published tutorials don't show broken code.

Bumps to 2.1.0 (minor, not patch, since this breaks existing user code).

Test plan

  • Full pytest suite passes (20 passed), including a new regression test verifying the CPM formula and Gene.cpm()
  • Confirmed old tpm= now raises TypeError
  • Verified via a fresh independent clone of the pushed branch
  • flake8/black clean
  • python -m build + twine check dist/* pass at 2.1.0
  • CI green across the full matrix

YalanBi added 2 commits August 5, 2026 16:46
Everywhere "tpm" appeared, the formula was count / total_reads * 1e6
-- CPM, with no transcript-length normalization. Only the name was
wrong; for full-length long reads this is the right metric already,
since read count is already a direct proxy for molecule count.

Also updated tutorial notebooks referencing the old tpm= API, since
there's no deprecated alias. Bumps to 2.1.0 (minor, since this breaks
existing code).
@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@YalanBi YalanBi self-assigned this Aug 5, 2026
@YalanBi YalanBi added the enhancement New feature or request label Aug 5, 2026
@YalanBi
YalanBi merged commit 1002be8 into master Aug 5, 2026
19 checks passed
@YalanBi
YalanBi deleted the feature/rename-tpm-to-cpm branch August 5, 2026 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant