scatrans 0.7.0.dev0__tar.gz → 0.9.1.dev0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. {scatrans-0.7.0.dev0 → scatrans-0.9.1.dev0}/.github/workflows/ci.yml +2 -0
  2. scatrans-0.9.1.dev0/.github/workflows/publish.yml +74 -0
  3. {scatrans-0.7.0.dev0 → scatrans-0.9.1.dev0}/CHANGELOG.md +65 -0
  4. scatrans-0.9.1.dev0/MANIFEST.in +24 -0
  5. {scatrans-0.7.0.dev0 → scatrans-0.9.1.dev0}/PKG-INFO +265 -167
  6. scatrans-0.7.0.dev0/src/scatrans.egg-info/PKG-INFO → scatrans-0.9.1.dev0/README.md +259 -207
  7. {scatrans-0.7.0.dev0 → scatrans-0.9.1.dev0}/pyproject.toml +4 -3
  8. {scatrans-0.7.0.dev0/src → scatrans-0.9.1.dev0}/scatrans.egg-info/SOURCES.txt +6 -7
  9. {scatrans-0.7.0.dev0 → scatrans-0.9.1.dev0}/setup.cfg +1 -0
  10. {scatrans-0.7.0.dev0 → scatrans-0.9.1.dev0}/src/scatrans/__init__.py +17 -2
  11. {scatrans-0.7.0.dev0 → scatrans-0.9.1.dev0}/src/scatrans/_de.py +30 -21
  12. {scatrans-0.7.0.dev0 → scatrans-0.9.1.dev0}/src/scatrans/_permutation.py +43 -13
  13. {scatrans-0.7.0.dev0 → scatrans-0.9.1.dev0}/src/scatrans/_utils.py +178 -17
  14. {scatrans-0.7.0.dev0 → scatrans-0.9.1.dev0}/src/scatrans/_velocity.py +36 -7
  15. {scatrans-0.7.0.dev0 → scatrans-0.9.1.dev0}/src/scatrans/_version.py +3 -3
  16. scatrans-0.9.1.dev0/src/scatrans/data/Hs_GO_Biological_Process_2026.txt +14209 -0
  17. scatrans-0.9.1.dev0/src/scatrans/data/Hs_KEGG_2026.txt +223 -0
  18. scatrans-0.9.1.dev0/src/scatrans/data/Mm_GO_Biological_Process_2026.txt +14957 -0
  19. scatrans-0.9.1.dev0/src/scatrans/data/Mm_KEGG_2026.txt +219 -0
  20. scatrans-0.9.1.dev0/src/scatrans/enrich.py +2105 -0
  21. scatrans-0.9.1.dev0/src/scatrans/pl.py +2072 -0
  22. {scatrans-0.7.0.dev0 → scatrans-0.9.1.dev0}/src/scatrans/tl.py +784 -293
  23. scatrans-0.9.1.dev0/tests/test_basic.py +1174 -0
  24. scatrans-0.7.0.dev0/.github/workflows/pypi-publish.yml +0 -28
  25. scatrans-0.7.0.dev0/README.md +0 -784
  26. scatrans-0.7.0.dev0/src/scatrans/data/Hs_KEGG_2026.txt +0 -223
  27. scatrans-0.7.0.dev0/src/scatrans/data/Mm_KEGG_2026.txt +0 -219
  28. scatrans-0.7.0.dev0/src/scatrans/enrich.py +0 -735
  29. scatrans-0.7.0.dev0/src/scatrans/pl.py +0 -1168
  30. scatrans-0.7.0.dev0/src/scatrans.egg-info/dependency_links.txt +0 -1
  31. scatrans-0.7.0.dev0/src/scatrans.egg-info/entry_points.txt +0 -2
  32. scatrans-0.7.0.dev0/src/scatrans.egg-info/requires.txt +0 -31
  33. scatrans-0.7.0.dev0/src/scatrans.egg-info/top_level.txt +0 -1
  34. scatrans-0.7.0.dev0/tests/test_basic.py +0 -600
  35. {scatrans-0.7.0.dev0 → scatrans-0.9.1.dev0}/.gitignore +0 -0
  36. {scatrans-0.7.0.dev0 → scatrans-0.9.1.dev0}/LICENSE +0 -0
  37. {scatrans-0.7.0.dev0 → scatrans-0.9.1.dev0}/examples/memento_de_example.py +0 -0
  38. {scatrans-0.7.0.dev0 → scatrans-0.9.1.dev0}/examples/real_data_template.py +0 -0
  39. {scatrans-0.7.0.dev0 → scatrans-0.9.1.dev0}/examples/synthetic_active_transcription.py +0 -0
  40. {scatrans-0.7.0.dev0 → scatrans-0.9.1.dev0}/src/scatrans/_bias.py +0 -0
  41. {scatrans-0.7.0.dev0 → scatrans-0.9.1.dev0}/src/scatrans/data/Mus_musculus.GRCm39.115_gene_features.parquet +0 -0
  42. {scatrans-0.7.0.dev0 → scatrans-0.9.1.dev0}/src/scatrans/data/README.md +0 -0
  43. {scatrans-0.7.0.dev0 → scatrans-0.9.1.dev0}/src/scatrans/data/mouse_2020A_gene_features.parquet +0 -0
  44. {scatrans-0.7.0.dev0 → scatrans-0.9.1.dev0}/src/scatrans/generate_gene_features.py +0 -0
  45. {scatrans-0.7.0.dev0 → scatrans-0.9.1.dev0}/src/scatrans/pp_bias.py +0 -0
  46. {scatrans-0.7.0.dev0 → scatrans-0.9.1.dev0}/src/scatrans/qc.py +0 -0
@@ -22,6 +22,8 @@ jobs:
22
22
 
23
23
  steps:
24
24
  - uses: actions/checkout@v4
25
+ with:
26
+ fetch-depth: 0 # Good practice for setuptools_scm (version detection)
25
27
 
26
28
  - name: Set up Python ${{ matrix.python-version }}
27
29
  uses: actions/setup-python@v5
@@ -0,0 +1,74 @@
1
+ name: Publish to PyPI
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - "v*"
7
+ release:
8
+ types: [published]
9
+ workflow_dispatch:
10
+ inputs:
11
+ version:
12
+ description: "Force a specific version (SETUPTOOLS_SCM_PRETEND_VERSION). Useful for dev releases when not on a tag."
13
+ required: false
14
+ default: ""
15
+
16
+ jobs:
17
+ build:
18
+ name: Build distribution 📦
19
+ runs-on: ubuntu-latest
20
+ steps:
21
+ - uses: actions/checkout@v4
22
+ with:
23
+ fetch-depth: 0 # Critical for setuptools_scm to detect tags and produce correct version
24
+
25
+ - name: Set up Python
26
+ uses: actions/setup-python@v5
27
+ with:
28
+ python-version: "3.11"
29
+
30
+ - name: Install build tools
31
+ run: python -m pip install --upgrade build
32
+
33
+ - name: Build source and wheel distributions
34
+ run: |
35
+ if [ -n "${{ github.event.inputs.version }}" ]; then
36
+ echo "Using forced version: ${{ github.event.inputs.version }}"
37
+ SETUPTOOLS_SCM_PRETEND_VERSION="${{ github.event.inputs.version }}" python -m build
38
+ else
39
+ python -m build
40
+ fi
41
+
42
+ - name: Upload distribution artifacts
43
+ uses: actions/upload-artifact@v4
44
+ with:
45
+ name: python-package-distributions
46
+ path: dist/
47
+
48
+ publish:
49
+ name: Publish to PyPI
50
+ needs: build
51
+ runs-on: ubuntu-latest
52
+
53
+ # Required for Trusted Publishing (OIDC) - no API token secret needed
54
+ permissions:
55
+ id-token: write
56
+
57
+ # Recommended: tie to a protected GitHub Environment (create "pypi" environment in repo settings)
58
+ # You can add required reviewers or branch restrictions in the environment settings.
59
+ # environment:
60
+ # name: pypi
61
+
62
+ steps:
63
+ - name: Download all dists
64
+ uses: actions/download-artifact@v4
65
+ with:
66
+ name: python-package-distributions
67
+ path: dist/
68
+
69
+ - name: Publish distribution 📦 to PyPI
70
+ uses: pypa/gh-action-pypi-publish@release/v1
71
+ # For publishing to TestPyPI instead (for testing the workflow):
72
+ # with:
73
+ # repository-url: https://test.pypi.org/legacy/
74
+ # verbose: true
@@ -5,6 +5,71 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [0.9.0] - 2026-06-19
9
+
10
+ ### Added
11
+ - `run_gsea(ranked_genes, gene_sets=..., nperm=..., ...)` — pre-ranked GSEA (via gseapy.prerank wrapper).
12
+ Reuses the same gene-set loading, `gene_case`, diagnostics, and `.attrs` system as ORA.
13
+ Returns DataFrame with `NES`, `ES`, `pvalue`, `p.adjust`, `leading_edge`, etc.
14
+ Optional dependency: `pip install "scatrans[gsea]"`.
15
+ - `scat.pl.gseaplot(ranked_genes, gsea_result, term=...)` — classic GSEA running enrichment score plot.
16
+ Automatically uses pre-computed RES curves + hits stored in `run_gsea` results (`.attrs["gsea_details"]`).
17
+ - `enrich_dotplot` now auto-detects GSEA results (defaults `x="NES"`, uses diverging colormap when `color_by="NES"`).
18
+ - Added `gsea` extra in `pyproject.toml`.
19
+
20
+ ### Changed
21
+ - Minor internal cleanups and test coverage for the new GSEA path.
22
+ - All new functions follow the existing consistent signatures (`ax=`, `use_style=`, `save_path=`, etc.).
23
+
24
+ ## [0.8.0] - 2026-06-14
25
+
26
+ ### Added (enrichment module — major paper-readiness upgrade)
27
+ - `run_go(ontology="BP"|"CC"|"MF"|"ALL", ...)` — direct wrapper analogous to clusterProfiler `enrichGO`. Supports `adjust_across_all=True` for a single BH correction across all GO terms when using "ALL".
28
+ - `save_enrichment_report(res, prefix=..., save_excel=True, save_csv=True, save_tsv=True, save_metadata=True, save_term_gene_table=True)` — one-call export of main table, term-gene long table (via `expand_enrichment_genes`), and rich `metadata.json` + xlsx sheet. Auto-creates parent directories. List columns (e.g. `Genes_list`) are sanitized to `;` strings for clean export.
29
+ - `expand_enrichment_genes(res)` — expands the `Genes` (semicolon) column into a long-format Term–Gene table (one row per gene). Preserves `Ontology` column when input came from `run_go(..., "ALL")`.
30
+ - Rich provenance in every result `.attrs` (success and empty):
31
+ - `analysis_info`: package, version, timestamp, module
32
+ - `gene_set_info`: `requested`/`resolved`, `requested_source` vs `actual_source` ("bundled", "gseapy", "gmt", "dict"), `library_name`, `n_terms`, `n_unique_genes`
33
+ - `universe_info`: full details of background handling (provided size, restricted, dropped_by_annotation, force_universe, mapping counts)
34
+ - Empty results now carry `reason` ("gene_list_empty", "universe_empty", "no_term_overlap_after_filters", ...) + the above fields so users can diagnose why nothing came back.
35
+ - New `run_enrichment` / `run_kegg` / `run_go` parameters: `padj_cutoff` (preferred modern name), `include_gene_list` (adds `Genes_list` python-list column), `adjust_across_all`.
36
+ - `list_bundled_gene_sets()` now clearly documents the 2026 organism-specific defaults.
37
+ - Improved low-mapping-rate warning (includes input examples + gene-set examples).
38
+ - `background` is now a documented deprecated alias of `universe`; passing both raises immediately.
39
+ - All empty-result DataFrames preserve consistent columns (including optional `Genes_list` when requested) and full diagnostic attrs.
40
+
41
+ ### Changed / Improved
42
+ - `_load_gene_sets` now returns `(term_to_genes, term_to_desc, load_info)` so `actual_source` is always recorded accurately (even on gseapy fallback after bundled attempt).
43
+ - `run_kegg` fully synchronized with new parameters (`padj_cutoff`, `include_gene_list`, etc.).
44
+ - `enrich_dotplot` (pl.py) and various tl.py flows updated for new columns/attrs.
45
+ - Version unified to 0.8.0 for this release.
46
+ - README and docstrings extensively updated with manuscript-export examples, `run_go`, provenance details, and `adjust_across_all` guidance.
47
+ - Full test coverage for new paths (per-ontology attrs, within_ontology p.adjust, save+tsv+dir creation, expand with Ontology, dual-cutoff warning, etc.). All tests pass.
48
+
49
+ ## [0.9.0] - 2026-06-18
50
+
51
+ ### Added
52
+ - **Independent permutation statistics for unspliced excess**: `unspliced_excess_pval` and `unspliced_excess_fdr` (one-sided test on bias-corrected `unspliced_excess_residual`). Computed alongside existing `active_score_pval` / `active_score_fdr` when `use_permutation=True`.
53
+ - New parameter `unspliced_excess_fdr_cutoff` (default 0.05) for the built-in `significant` gene list and `filter_active_genes`.
54
+ - `filter_active_genes` parameters `unspliced_excess_residual_cutoff` and `unspliced_excess_fdr_cutoff`; heuristic/pseudobulk presets updated accordingly.
55
+ - `adata.uns["scatrans"]["significant_criteria"]` metadata documenting the built-in significance conjunction.
56
+
57
+ ### Changed
58
+ - **Terminology**: primary result columns renamed from velocity to unspliced/nascent excess:
59
+ - `unspliced_excess_delta` (was `velocity_delta_raw`)
60
+ - `unspliced_excess_residual` (was `velocity_residual`)
61
+ - Legacy `velocity_*` columns remain in `adata.var` as deprecated aliases.
62
+ - **Built-in `significant` gene list** now requires:
63
+ - `logFC > logfc_cutoff`, `p_adj < pval_cutoff`, `unspliced_excess_residual > 0`, `unspliced_excess_fdr < unspliced_excess_fdr_cutoff`
64
+ - `active_score` is no longer used for significance (ranking/visualization only).
65
+ - Without `use_permutation=True`, the built-in `significant` list is empty (logged warning).
66
+ - Plotting functions accept primary or legacy column names; axis labels updated.
67
+ - README rewritten for the new significance model and column names.
68
+
69
+ ### Deprecated
70
+ - `active_fdr_cutoff` (no longer used for built-in significance; use `unspliced_excess_fdr_cutoff`).
71
+ - `velocity_residual_cutoff` in `filter_active_genes` (use `unspliced_excess_residual_cutoff`).
72
+
8
73
  ## [Unreleased]
9
74
 
10
75
  ### Added
@@ -0,0 +1,24 @@
1
+ # Control what goes into the source distribution (sdist).
2
+ # The wheel only contains the runtime package (src/scatrans + data).
3
+
4
+ # Standard important files
5
+ include LICENSE
6
+ include README.md
7
+ include CHANGELOG.md
8
+ include pyproject.toml
9
+
10
+ # Include the GitHub Actions workflows (requested)
11
+ include .github/workflows/ci.yml
12
+ include .github/workflows/publish.yml
13
+
14
+ # If more workflows are added in the future, this will catch them:
15
+ include .github/workflows/*.yml
16
+
17
+ # Never ship generated metadata directories inside the sdist
18
+ recursive-exclude src/scatrans.egg-info *
19
+ prune build
20
+ prune dist
21
+ global-exclude *.pyc
22
+ global-exclude __pycache__/*
23
+ global-exclude *.egg-info
24
+ global-exclude *.egg-info/*