regdiffusion 0.2.2__tar.gz → 0.2.4__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 (84) hide show
  1. {regdiffusion-0.2.2 → regdiffusion-0.2.4}/.github/workflows/documentation.yml +11 -12
  2. {regdiffusion-0.2.2 → regdiffusion-0.2.4}/.gitignore +2 -0
  3. regdiffusion-0.2.4/CITATION.cff +32 -0
  4. regdiffusion-0.2.4/NEWS.md +63 -0
  5. regdiffusion-0.2.4/PKG-INFO +111 -0
  6. regdiffusion-0.2.2/PKG-INFO → regdiffusion-0.2.4/README.md +20 -27
  7. {regdiffusion-0.2.2 → regdiffusion-0.2.4}/docs/BUILD.md +21 -1
  8. regdiffusion-0.2.4/docs/_static/grn_mono_full.html +2488 -0
  9. regdiffusion-0.2.4/docs/_static/grn_pbmc_bcell.html +2488 -0
  10. regdiffusion-0.2.4/docs/_static/grn_pbmc_full.html +2488 -0
  11. regdiffusion-0.2.4/docs/_templates/layout.html +18 -0
  12. regdiffusion-0.2.4/docs/conf.py +106 -0
  13. regdiffusion-0.2.4/docs/faq.md +71 -0
  14. {regdiffusion-0.2.2 → regdiffusion-0.2.4}/docs/index.rst +37 -16
  15. {regdiffusion-0.2.2 → regdiffusion-0.2.4}/docs/quick_tour.md +19 -4
  16. regdiffusion-0.2.4/docs/requirements.txt +6 -0
  17. regdiffusion-0.2.4/docs/visualizing_grn.md +628 -0
  18. {regdiffusion-0.2.2 → regdiffusion-0.2.4}/example.ipynb +10 -10
  19. {regdiffusion-0.2.2 → regdiffusion-0.2.4}/pyproject.toml +8 -3
  20. {regdiffusion-0.2.2 → regdiffusion-0.2.4}/regdiffusion/__init__.py +3 -3
  21. {regdiffusion-0.2.2 → regdiffusion-0.2.4}/regdiffusion/cli.py +7 -1
  22. {regdiffusion-0.2.2 → regdiffusion-0.2.4}/regdiffusion/data/beeline.py +9 -9
  23. {regdiffusion-0.2.2 → regdiffusion-0.2.4}/regdiffusion/data/microglia.py +5 -6
  24. {regdiffusion-0.2.2 → regdiffusion-0.2.4}/regdiffusion/data/utils.py +1 -1
  25. {regdiffusion-0.2.2 → regdiffusion-0.2.4}/regdiffusion/evaluator.py +10 -0
  26. {regdiffusion-0.2.2 → regdiffusion-0.2.4}/regdiffusion/grn.py +75 -60
  27. {regdiffusion-0.2.2 → regdiffusion-0.2.4}/regdiffusion/logger.py +13 -0
  28. {regdiffusion-0.2.2 → regdiffusion-0.2.4}/regdiffusion/models/regdiffusion.py +43 -19
  29. {regdiffusion-0.2.2 → regdiffusion-0.2.4}/regdiffusion/models/regdiffusion_me.py +40 -21
  30. {regdiffusion-0.2.2 → regdiffusion-0.2.4}/regdiffusion/plot/__init__.py +2 -2
  31. regdiffusion-0.2.4/regdiffusion/plot/interactive.py +104 -0
  32. {regdiffusion-0.2.2 → regdiffusion-0.2.4}/regdiffusion/trainer.py +98 -48
  33. regdiffusion-0.2.2/NEWS.md +0 -28
  34. regdiffusion-0.2.2/README.md +0 -74
  35. regdiffusion-0.2.2/docs/conf.py +0 -53
  36. regdiffusion-0.2.2/regdiffusion/plot/pyvis.py +0 -108
  37. {regdiffusion-0.2.2 → regdiffusion-0.2.4}/LICENSE +0 -0
  38. {regdiffusion-0.2.2 → regdiffusion-0.2.4}/docs/.gitignore +0 -0
  39. {regdiffusion-0.2.2 → regdiffusion-0.2.4}/docs/Makefile +0 -0
  40. {regdiffusion-0.2.2 → regdiffusion-0.2.4}/docs/REG_PySCENIC.ipynb +0 -0
  41. {regdiffusion-0.2.2 → regdiffusion-0.2.4}/docs/_static/rd_logo_horizontal.png +0 -0
  42. {regdiffusion-0.2.2 → regdiffusion-0.2.4}/docs/_static/rd_logo_horizontal@2x.png +0 -0
  43. {regdiffusion-0.2.2 → regdiffusion-0.2.4}/docs/_static/regdiffusion.png +0 -0
  44. {regdiffusion-0.2.2 → regdiffusion-0.2.4}/docs/_static/regdiffusion@2x.png +0 -0
  45. {regdiffusion-0.2.2 → regdiffusion-0.2.4}/docs/_templates/autosummary/class.rst +0 -0
  46. {regdiffusion-0.2.2 → regdiffusion-0.2.4}/docs/_templates/autosummary/classnoinheritance.rst +0 -0
  47. {regdiffusion-0.2.2 → regdiffusion-0.2.4}/docs/data_module.rst +0 -0
  48. {regdiffusion-0.2.2 → regdiffusion-0.2.4}/docs/downstream_with_pyscenic.md +0 -0
  49. {regdiffusion-0.2.2 → regdiffusion-0.2.4}/docs/large_networks.md +0 -0
  50. {regdiffusion-0.2.2 → regdiffusion-0.2.4}/docs/main_api.rst +0 -0
  51. {regdiffusion-0.2.2 → regdiffusion-0.2.4}/docs/make.bat +0 -0
  52. {regdiffusion-0.2.2 → regdiffusion-0.2.4}/docs/models.rst +0 -0
  53. {regdiffusion-0.2.2 → regdiffusion-0.2.4}/docs/supplements/googled258341a97f33073.html +0 -0
  54. {regdiffusion-0.2.2 → regdiffusion-0.2.4}/docs/supplements/rd_hammond_Cx3cr1.html +0 -0
  55. {regdiffusion-0.2.2 → regdiffusion-0.2.4}/docs/supplements/rd_hammond_Fcrls.html +0 -0
  56. {regdiffusion-0.2.2 → regdiffusion-0.2.4}/docs/supplements/rd_hammond_Hexb.html +0 -0
  57. {regdiffusion-0.2.2 → regdiffusion-0.2.4}/docs/supplements/rd_hammond_Mertk.html +0 -0
  58. {regdiffusion-0.2.2 → regdiffusion-0.2.4}/docs/supplements/rd_hammond_P2ry12.html +0 -0
  59. {regdiffusion-0.2.2 → regdiffusion-0.2.4}/docs/supplements/rd_hammond_Pros1.html +0 -0
  60. {regdiffusion-0.2.2 → regdiffusion-0.2.4}/docs/supplements/rd_hammond_Sall1.html +0 -0
  61. {regdiffusion-0.2.2 → regdiffusion-0.2.4}/docs/supplements/rd_hammond_Siglech.html +0 -0
  62. {regdiffusion-0.2.2 → regdiffusion-0.2.4}/docs/supplements/rd_hammond_Tmem119.html +0 -0
  63. {regdiffusion-0.2.2 → regdiffusion-0.2.4}/docs/supplements/rd_hammond_Trem2.html +0 -0
  64. {regdiffusion-0.2.2 → regdiffusion-0.2.4}/docs/supplements.rst +0 -0
  65. {regdiffusion-0.2.2 → regdiffusion-0.2.4}/regdiffusion/data/__init__.py +0 -0
  66. {regdiffusion-0.2.2 → regdiffusion-0.2.4}/regdiffusion/models/__init__.py +0 -0
  67. {regdiffusion-0.2.2 → regdiffusion-0.2.4}/regdiffusion/plot/static.py +0 -0
  68. {regdiffusion-0.2.2 → regdiffusion-0.2.4}/resources/apoe_net.png +0 -0
  69. {regdiffusion-0.2.2 → regdiffusion-0.2.4}/resources/aucell_mtx.png +0 -0
  70. {regdiffusion-0.2.2 → regdiffusion-0.2.4}/resources/aucell_umap.png +0 -0
  71. {regdiffusion-0.2.2 → regdiffusion-0.2.4}/resources/biomarkers.png +0 -0
  72. {regdiffusion-0.2.2 → regdiffusion-0.2.4}/resources/cellnames.png +0 -0
  73. {regdiffusion-0.2.2 → regdiffusion-0.2.4}/resources/edgelist.png +0 -0
  74. {regdiffusion-0.2.2 → regdiffusion-0.2.4}/resources/heatmap.png +0 -0
  75. {regdiffusion-0.2.2 → regdiffusion-0.2.4}/resources/mecs.png +0 -0
  76. {regdiffusion-0.2.2 → regdiffusion-0.2.4}/resources/mecs_cluster.png +0 -0
  77. {regdiffusion-0.2.2 → regdiffusion-0.2.4}/resources/regdiffusion_structure.png +0 -0
  78. {regdiffusion-0.2.2 → regdiffusion-0.2.4}/resources/regulon_scores.png +0 -0
  79. {regdiffusion-0.2.2 → regdiffusion-0.2.4}/resources/shinygo.png +0 -0
  80. {regdiffusion-0.2.2 → regdiffusion-0.2.4}/resources/umap_comparison.png +0 -0
  81. {regdiffusion-0.2.2 → regdiffusion-0.2.4}/test_scripts/test_beeline_benchmark.py +0 -0
  82. {regdiffusion-0.2.2 → regdiffusion-0.2.4}/test_scripts/test_beeline_worker.py +0 -0
  83. {regdiffusion-0.2.2 → regdiffusion-0.2.4}/test_scripts/test_memory_benchmark.py +0 -0
  84. {regdiffusion-0.2.2 → regdiffusion-0.2.4}/test_scripts/test_sparse_support.py +0 -0
@@ -13,27 +13,25 @@ jobs:
13
13
  runs-on: ubuntu-latest
14
14
 
15
15
  steps:
16
- - uses: actions/checkout@v3
16
+ - uses: actions/checkout@v5
17
17
  with:
18
- persist-credentials: false
18
+ persist-credentials: false
19
19
 
20
20
  - name: Set up Python
21
- uses: actions/setup-python@v3
21
+ uses: actions/setup-python@v6
22
22
  with:
23
23
  python-version: '3.10'
24
24
 
25
25
  - name: Install dependencies
26
26
  run: |
27
27
  python -m pip install --upgrade pip
28
- pip install sphinx sphinx_book_theme sphinx myst-parser sphinx-copybutton --upgrade
29
- pip install numpy
30
- pip install pandas
28
+ pip install -r docs/requirements.txt
29
+ # Install the CPU build of torch first so the package install below
30
+ # does not pull the much larger CUDA wheels.
31
31
  pip install torch --index-url https://download.pytorch.org/whl/cpu
32
- pip install tqdm
33
- pip install scanpy
34
- pip install scikit-learn
35
- pip install h5py
36
- pip install pyvis
32
+ # Install regdiffusion itself so autodoc can import it and so runtime
33
+ # dependencies stay in sync with pyproject.toml.
34
+ pip install .
37
35
 
38
36
  - name: Build documentation
39
37
  run: |
@@ -41,7 +39,8 @@ jobs:
41
39
  make html
42
40
 
43
41
  - name: Deploy to GitHub Pages
44
- uses: peaceiris/actions-gh-pages@v3
42
+ if: github.event_name == 'push' && github.ref == 'refs/heads/master'
43
+ uses: peaceiris/actions-gh-pages@v4
45
44
  with:
46
45
  github_token: ${{ secrets.GITHUB_TOKEN }}
47
46
  publish_dir: ./docs/_build/html
@@ -1,3 +1,5 @@
1
+ .claude/
2
+ .venv/
1
3
  dist/
2
4
  /data/
3
5
  results/
@@ -0,0 +1,32 @@
1
+ cff-version: 1.2.0
2
+ message: "If you use RegDiffusion, please cite the paper listed below."
3
+ type: software
4
+ title: RegDiffusion
5
+ abstract: "Gene regulatory network inference from single-cell RNA-seq using probabilistic diffusion models."
6
+ authors:
7
+ - family-names: Zhu
8
+ given-names: Hao
9
+ - family-names: Slonim
10
+ given-names: Donna
11
+ repository-code: "https://github.com/TuftsBCB/RegDiffusion"
12
+ url: "https://tuftsbcb.github.io/RegDiffusion/"
13
+ license: Apache-2.0
14
+ keywords:
15
+ - gene regulatory network
16
+ - single-cell RNA-seq
17
+ - diffusion model
18
+ preferred-citation:
19
+ type: article
20
+ title: "From Noise to Knowledge: Diffusion Probabilistic Model-Based Neural Inference of Gene Regulatory Networks"
21
+ authors:
22
+ - family-names: Zhu
23
+ given-names: Hao
24
+ - family-names: Slonim
25
+ given-names: Donna
26
+ journal: Journal of Computational Biology
27
+ year: 2024
28
+ volume: 31
29
+ issue: 11
30
+ start: 1087
31
+ end: 1103
32
+ doi: "10.1089/cmb.2024.0607"
@@ -0,0 +1,63 @@
1
+ # RegDiffusion News / Changelog
2
+
3
+ ## 0.2.4 [unreleased]
4
+
5
+ ### New Features
6
+ - Replaced the `pyvis` visualization backend and dependency with `lightgraph>=1.2.0`. `GRN.visualize_local_neighborhood()` now uses `lightgraph`, and `regdiffusion.plot.plot_lightgraph()` supports notebook display and standalone HTML export via `.save(path)`.
7
+ - Added automatic community grouping, node-size mapping from metrics, force and circular layouts, and edge-width or opacity scaling by absolute regulatory strength. Duplicate edges in visualizations are collapsed to the strongest copy.
8
+
9
+ ### API Changes
10
+ - Removed `plot_pyvis()` and support for `plot_engine='pyvis'`. Use `plot_lightgraph()` or the default `GRN.visualize_local_neighborhood()` instead; plotting calls now return a `lightgraph.NetworkVisualization` object.
11
+ - Deprecated `edge_widths` in `GRN.visualize_local_neighborhood()`. It is ignored with a deprecation warning; edge widths now reflect absolute regulatory strength rather than hop level.
12
+
13
+ ### Bug Fixes
14
+ - Excluded zero-weight edges from `GRN.extract_edgelist()`, preventing removed edges from reappearing during top-k extraction.
15
+ - Fixed sparse HDF5 export of float16 adjacency matrices by converting to float32 before constructing the SciPy sparse matrix.
16
+ - Decoded gene and transcription-factor names as strings when reading HDF5 files, so they can be matched directly to annotations.
17
+
18
+ ### Documentation
19
+ - Added a human PBMC network visualization tutorial with Reactome pathway annotations and interactive whole-network and local views, and updated the quick tour for `lightgraph`.
20
+ - Added an FAQ and citation metadata, improved package and documentation metadata, and made the documentation version follow `pyproject.toml`.
21
+
22
+
23
+ ## 0.2.3
24
+
25
+ ### New Features
26
+ - Added a `seed` argument to `RegDiffusionTrainer` for fully reproducible runs. When set, Python, NumPy, and PyTorch RNGs are seeded and cuDNN is put in deterministic mode. Two runs with the same seed now produce bit-identical adjacency matrices, verified across separate processes and under AMP, `torch.compile`, gradient accumulation, and `train_split < 1.0`. Without a seed (the default), runs remain non-deterministic.
27
+
28
+ ### Bug Fixes
29
+ - Fixed `RegDiffusionTrainer.train(n_steps=...)` silently ignoring its argument. Both the normal and gradient-accumulation branches hardcoded `n_steps=None`, so training always ran for the `n_steps` given at initialization.
30
+ - Fixed the L1 sparsity penalty being computed on *signed* adjacency values in the base `RegDiffusion` model. Soft thresholding preserves sign, so the penalty could in principle be reduced by making inhibitory (negative) edges more negative. Both models now share a single `get_sparse_loss()` that takes the mean absolute value over off-diagonal entries. In practice this does not change results — negative entries land in the soft-threshold dead zone, where both the output and its gradient are zero — and BEELINE metrics are unchanged; the penalty is now correct by construction rather than by accident.
31
+ - `RegDiffusionME.get_sampled_sparse_loss()` is renamed to `get_sparse_loss()` and now excludes diagonal samples, matching the base model, whose `get_adj_()` masks the diagonal.
32
+ - Registered the sampled adjacency index tensors (`sampled_adj_row/col_nonparam`) as buffers instead of `nn.Parameter`. These are integer indices, not learnable weights, and they no longer appear in `model.parameters()`. `state_dict` keys are unchanged, so existing checkpoints still load.
33
+ - The sparse loss is no longer computed during the warmup window, where it is discarded.
34
+ - Extended the `tqdm.auto` progress-bar fix from 0.2.2 (which covered `trainer.py`) to the remaining progress bars in `grn.py` and the `data` module, so dataset downloads and edgelist extraction also render properly in notebooks.
35
+
36
+
37
+ ## 0.2.2
38
+
39
+ - Avoid large progress printing in terminal
40
+
41
+
42
+ ## 0.2.1
43
+
44
+ ### New Features
45
+ - Added sparse matrix support for `RegDiffusionTrainer`. The `exp_array` argument now accepts scipy sparse matrices (e.g. `adata.X`) directly. Normalization statistics are computed in chunks and each sample is normalized on-the-fly during training, so the full dense matrix is never materialized. This enables training on datasets with 1M+ cells without excessive memory usage.
46
+ - Updated CLI (`regdiffusion` command) to handle sparse `adata.X` from H5AD files, including sparse-safe data validation and log-transform via `log1p` on non-zero entries.
47
+
48
+
49
+ ## 0.2.0
50
+
51
+ ### Memory Optimization
52
+ - Removed three `(n_gene, n_gene)` helper matrices (`zeros_nonparam`, `eye_nonparam`, `mask_nonparam`) from `RegDiffusion`, replacing them with inline computations. Saves ~4.8 GB persistent GPU memory for 20K genes with no impact on model accuracy.
53
+
54
+ ### New Features
55
+ - Added `RegDiffusionME`, a memory-efficient model variant enabled via `memory_efficient=True` in `RegDiffusionTrainer`. Reduces peak GPU memory by ~45% with no impact on accuracy. Uses a custom autograd function for soft thresholding (boolean masks instead of float32 tensors) and sampled sparse loss (avoids materializing full adjacency matrix for L1 regularization). Benchmarked on all 7 BEELINE datasets with identical AUROC/AUPRR/EPR.
56
+ - Added automatic mixed precision (AMP) support via `use_amp=True` in `RegDiffusionTrainer`. Uses bfloat16 for forward pass and loss computation, reducing memory for autograd-saved activations while keeping model parameters in float32. Requires Ampere or newer GPU.
57
+
58
+ ### Bug Fixes
59
+ - Fixed `I_minus_A()` using `self.train` instead of `self.training`, causing dropout to always apply during inference
60
+ - Fixed missing `self` parameter in `GRN.remove_weak_edges()`
61
+ - Fixed `GRN.get_edgelist()` incorrectly passing `self` to `extract_edgelist()`
62
+ - Fixed external logger not being assigned in `RegDiffusionTrainer.__init__()`
63
+ - Fixed `forward()` crash when `n_celltype=None` by adding conditional cell type embedding
@@ -0,0 +1,111 @@
1
+ Metadata-Version: 2.4
2
+ Name: regdiffusion
3
+ Version: 0.2.4
4
+ Summary: Gene regulatory network inference from single-cell RNA-seq using diffusion models
5
+ Keywords: gene regulatory network,GRN inference,single-cell RNA-seq,diffusion model,bioinformatics
6
+ Author-email: Hao Zhu <haozhu233@gmail.com>, Donna Slonim <donna.slonim@tufts.edu>
7
+ Maintainer-email: Hao Zhu <haozhu233@gmail.com>
8
+ Description-Content-Type: text/markdown
9
+ Classifier: License :: OSI Approved :: Apache Software License
10
+ License-File: LICENSE
11
+ Requires-Dist: numpy>=1.16.5
12
+ Requires-Dist: pandas>=1.1.1
13
+ Requires-Dist: torch
14
+ Requires-Dist: tqdm
15
+ Requires-Dist: scanpy
16
+ Requires-Dist: scikit-learn
17
+ Requires-Dist: h5py
18
+ Requires-Dist: lightgraph>=1.2.0
19
+ Project-URL: Documentation, https://tuftsbcb.github.io/RegDiffusion/
20
+ Project-URL: Home, https://github.com/TuftsBCB/RegDiffusion
21
+ Project-URL: Issues, https://github.com/TuftsBCB/RegDiffusion/issues
22
+ Project-URL: Publication, https://doi.org/10.1089/cmb.2024.0607
23
+ Project-URL: Source, https://github.com/TuftsBCB/RegDiffusion
24
+
25
+ # RegDiffusion <a href="https://tuftsbcb.github.io/RegDiffusion/"><img src="https://raw.githubusercontent.com/TuftsBCB/RegDiffusion/master/docs/_static/rd_logo_horizontal.png" align="right" alt="logo" width="200" height = "56" style = "border: none; float: right;"></a>
26
+
27
+ [![Downloads](https://static.pepy.tech/badge/regdiffusion)](https://pepy.tech/project/regdiffusion)
28
+ [![Downloads](https://static.pepy.tech/badge/regdiffusion/month)](https://pepy.tech/project/regdiffusion)
29
+ ![PyPI - Version](https://img.shields.io/pypi/v/regdiffusion)
30
+
31
+ RegDiffusion is an open-source Python package for **gene regulatory network (GRN) inference from single-cell RNA-seq data** using probabilistic diffusion models. It learns candidate regulatory relationships from gene expression data without requiring a ground-truth network for training, and includes tools to evaluate, export, and visualize inferred networks.
32
+
33
+ [Documentation](https://tuftsbcb.github.io/RegDiffusion/) · [Quick start](https://tuftsbcb.github.io/RegDiffusion/quick_tour.html) · [FAQ](https://tuftsbcb.github.io/RegDiffusion/faq.html) · [PyPI](https://pypi.org/project/regdiffusion/) · [Paper](https://doi.org/10.1089/cmb.2024.0607)
34
+
35
+ ## What can RegDiffusion do?
36
+
37
+ - Infer GRNs from a cells-by-genes expression matrix with GPU acceleration or on CPU.
38
+ - Accept log-transformed NumPy arrays or SciPy sparse matrices through the Python API. The CLI accepts raw counts in CSV or H5AD files and performs the log transformation.
39
+ - Work with large gene sets using [memory-efficient training](https://tuftsbcb.github.io/RegDiffusion/large_networks.html).
40
+ - Export inferred edges for [downstream pySCENIC analysis](https://tuftsbcb.github.io/RegDiffusion/downstream_with_pyscenic.html).
41
+
42
+ The project reports inference on a 15,000-gene network in under five minutes on an NVIDIA A100 GPU. Runtime and memory use depend on dataset size, hardware, and training settings; see the [large-network guide](https://tuftsbcb.github.io/RegDiffusion/large_networks.html) for memory benchmarks. Inferred edges are hypotheses for follow-up analysis, not experimental proof of regulation.
43
+
44
+ ```
45
+ Zhu H, Slonim D. From Noise to Knowledge: Diffusion Probabilistic Model-Based Neural Inference of Gene Regulatory Networks. J Comput Biol. 2024 Nov;31(11):1087-1103. doi: 10.1089/cmb.2024.0607. Epub 2024 Oct 10. PMID: 39387266; PMCID: PMC11698671.
46
+ ```
47
+
48
+ ## Installation
49
+
50
+ RegDiffusion is on pypi.
51
+
52
+ ```
53
+ pip install regdiffusion
54
+ ```
55
+
56
+ Check out [this tutorial](https://tuftsbcb.github.io/RegDiffusion/quick_tour.html) for a quick tour of how to use RegDiffusion! If you would like to integrate results from RegDiffusion into the SCENIC pipeline, checkout [this tutorial](https://tuftsbcb.github.io/RegDiffusion/downstream_with_pyscenic.html).
57
+
58
+ ## New in v0.2
59
+ - **Memory-efficient mode**: Set `memory_efficient=True` in `RegDiffusionTrainer` to reduce peak GPU memory by ~45%, making it easier to work with large gene sets on consumer GPUs (You can now fit 20k genes on a 16GB GPU).
60
+ - **Sparse matrix support**: `RegDiffusionTrainer` now accepts scipy sparse matrices directly (e.g., `adata.X`), enabling training on datasets with 1M+ cells without excessive memory usage.
61
+
62
+ ## Inferred Networks from RegDiffusion
63
+ Here are two examples of inferred networks from regdiffusion. The networks are coherent with existing literature and across datasets.
64
+
65
+ ![Inferred gene regulatory networks around APOE](https://raw.githubusercontent.com/TuftsBCB/RegDiffusion/master/resources/apoe_net.png)
66
+
67
+ ## Inference Speed
68
+ The project reports inference on a 15,000-gene network in under five minutes on
69
+ an NVIDIA A100 GPU, or roughly three hours on a 12-core CPU. These timings depend
70
+ on the dataset and training settings. See the [paper](https://doi.org/10.1089/cmb.2024.0607)
71
+ for the method's evaluation and the [large-network guide](https://tuftsbcb.github.io/RegDiffusion/large_networks.html)
72
+ for memory benchmarks.
73
+
74
+ ## CLI tool
75
+ regdiffusion has a CLI tool now! It takes a count matrix as the input (different from the main API, which needs the data to be log transformed) and returns a table of inferred edges.
76
+
77
+ ```
78
+ usage: regdiffusion [-h] [--output OUTPUT] [--top_gene_percentile TOP_GENE_PERCENTILE] [--k K] [--workers WORKERS] input
79
+
80
+ Infer a gene regulatory network (GRN) from a single-cell count dataset.
81
+
82
+ positional arguments:
83
+ input Input single-cell count dataset file (CSV or H5AD format).
84
+
85
+ options:
86
+ -h, --help show this help message and exit
87
+ --output OUTPUT Output file path for the edgelist (CSV). Default: rd_grn.csv
88
+ --top_gene_percentile TOP_GENE_PERCENTILE
89
+ Percentile cutoff to filter weak edges (e.g., 50 for the top 50%). Default: 50
90
+ --k K Number of edges per gene to extract (-1 for all edges). Default: -1
91
+ --workers WORKERS Number of workers to use for edgelist extraction. Default: 4
92
+ ```
93
+
94
+ ## Citation
95
+
96
+ If you find our package useful, consider citing our paper! =)
97
+
98
+ ```
99
+ @article{zhu2024noise,
100
+ title={From Noise to Knowledge: Diffusion Probabilistic Model-Based Neural Inference of Gene Regulatory Networks},
101
+ author={Zhu, Hao and Slonim, Donna},
102
+ journal={Journal of Computational Biology},
103
+ volume={31},
104
+ number={11},
105
+ pages={1087--1103},
106
+ year={2024},
107
+ doi={10.1089/cmb.2024.0607},
108
+ url={https://doi.org/10.1089/cmb.2024.0607}
109
+ }
110
+ ```
111
+
@@ -1,29 +1,21 @@
1
- Metadata-Version: 2.4
2
- Name: regdiffusion
3
- Version: 0.2.2
4
- Summary: Gene Regulatory Networks Inference using diffusion model
5
- Author-email: Hao Zhu <haozhu233@gmail.com>, Donna Slonim <donna.slonim@tufts.edu>
6
- Maintainer-email: Hao Zhu <haozhu233@gmail.com>
7
- Description-Content-Type: text/markdown
8
- Classifier: License :: OSI Approved :: Apache Software License
9
- License-File: LICENSE
10
- Requires-Dist: numpy>=1.16.5
11
- Requires-Dist: pandas>=1.1.1
12
- Requires-Dist: torch
13
- Requires-Dist: tqdm
14
- Requires-Dist: scanpy
15
- Requires-Dist: scikit-learn
16
- Requires-Dist: h5py
17
- Requires-Dist: pyvis
18
- Project-URL: Home, https://github.com/TuftsBCB/RegDiffusion
19
-
20
1
  # RegDiffusion <a href="https://tuftsbcb.github.io/RegDiffusion/"><img src="https://raw.githubusercontent.com/TuftsBCB/RegDiffusion/master/docs/_static/rd_logo_horizontal.png" align="right" alt="logo" width="200" height = "56" style = "border: none; float: right;"></a>
21
2
 
22
3
  [![Downloads](https://static.pepy.tech/badge/regdiffusion)](https://pepy.tech/project/regdiffusion)
23
4
  [![Downloads](https://static.pepy.tech/badge/regdiffusion/month)](https://pepy.tech/project/regdiffusion)
24
5
  ![PyPI - Version](https://img.shields.io/pypi/v/regdiffusion)
25
6
 
26
- RegDiffusion is a very fast unsupervised regulatory network inference algorithm (just like GENIE3 and GRNBoost2), based on probabilistic diffusion model. It works well on genes and is capable to rapidly (<5min) predict biologically verifiable links from large single cell RNA-seq data with 40,000+ genes.
7
+ RegDiffusion is an open-source Python package for **gene regulatory network (GRN) inference from single-cell RNA-seq data** using probabilistic diffusion models. It learns candidate regulatory relationships from gene expression data without requiring a ground-truth network for training, and includes tools to evaluate, export, and visualize inferred networks.
8
+
9
+ [Documentation](https://tuftsbcb.github.io/RegDiffusion/) · [Quick start](https://tuftsbcb.github.io/RegDiffusion/quick_tour.html) · [FAQ](https://tuftsbcb.github.io/RegDiffusion/faq.html) · [PyPI](https://pypi.org/project/regdiffusion/) · [Paper](https://doi.org/10.1089/cmb.2024.0607)
10
+
11
+ ## What can RegDiffusion do?
12
+
13
+ - Infer GRNs from a cells-by-genes expression matrix with GPU acceleration or on CPU.
14
+ - Accept log-transformed NumPy arrays or SciPy sparse matrices through the Python API. The CLI accepts raw counts in CSV or H5AD files and performs the log transformation.
15
+ - Work with large gene sets using [memory-efficient training](https://tuftsbcb.github.io/RegDiffusion/large_networks.html).
16
+ - Export inferred edges for [downstream pySCENIC analysis](https://tuftsbcb.github.io/RegDiffusion/downstream_with_pyscenic.html).
17
+
18
+ The project reports inference on a 15,000-gene network in under five minutes on an NVIDIA A100 GPU. Runtime and memory use depend on dataset size, hardware, and training settings; see the [large-network guide](https://tuftsbcb.github.io/RegDiffusion/large_networks.html) for memory benchmarks. Inferred edges are hypotheses for follow-up analysis, not experimental proof of regulation.
27
19
 
28
20
  ```
29
21
  Zhu H, Slonim D. From Noise to Knowledge: Diffusion Probabilistic Model-Based Neural Inference of Gene Regulatory Networks. J Comput Biol. 2024 Nov;31(11):1087-1103. doi: 10.1089/cmb.2024.0607. Epub 2024 Oct 10. PMID: 39387266; PMCID: PMC11698671.
@@ -46,14 +38,14 @@ Check out [this tutorial](https://tuftsbcb.github.io/RegDiffusion/quick_tour.htm
46
38
  ## Inferred Networks from RegDiffusion
47
39
  Here are two examples of inferred networks from regdiffusion. The networks are coherent with existing literature and across datasets.
48
40
 
49
- ![](https://raw.githubusercontent.com/TuftsBCB/RegDiffusion/master/resources/apoe_net.png)
41
+ ![Inferred gene regulatory networks around APOE](https://raw.githubusercontent.com/TuftsBCB/RegDiffusion/master/resources/apoe_net.png)
50
42
 
51
43
  ## Inference Speed
52
- Inference on networks with 15,000 genes takes under 5 minutes on an A100 GPU.
53
- In contrast, previous VAE based models would take more than 4 hours on the same
54
- device. Even if you don't have access to those fancy GPU cards, RegDiffusion
55
- still works. Inference on the same large network takes roughly 3 hours on a
56
- mid-range 12-core CPU.
44
+ The project reports inference on a 15,000-gene network in under five minutes on
45
+ an NVIDIA A100 GPU, or roughly three hours on a 12-core CPU. These timings depend
46
+ on the dataset and training settings. See the [paper](https://doi.org/10.1089/cmb.2024.0607)
47
+ for the method's evaluation and the [large-network guide](https://tuftsbcb.github.io/RegDiffusion/large_networks.html)
48
+ for memory benchmarks.
57
49
 
58
50
  ## CLI tool
59
51
  regdiffusion has a CLI tool now! It takes a count matrix as the input (different from the main API, which needs the data to be log transformed) and returns a table of inferred edges.
@@ -88,6 +80,7 @@ If you find our package useful, consider citing our paper! =)
88
80
  number={11},
89
81
  pages={1087--1103},
90
82
  year={2024},
91
- publisher={Mary Ann Liebert, Inc., publishers 140 Huguenot Street, 3rd Floor New~…}
83
+ doi={10.1089/cmb.2024.0607},
84
+ url={https://doi.org/10.1089/cmb.2024.0607}
92
85
  }
93
86
  ```
@@ -46,7 +46,7 @@ python -m sphinx -b html . _build/html
46
46
  ### If dependencies are missing:
47
47
  Install required packages:
48
48
  ```bash
49
- pip install sphinx sphinx-book-theme sphinx-copybutton myst-parser sphinxext-napoleon
49
+ pip install -r requirements.txt
50
50
  ```
51
51
 
52
52
  ### If autodoc fails to import modules:
@@ -64,3 +64,23 @@ pip install -e ..
64
64
  - `_build/` - Build output directory (generated)
65
65
  - `_static/` - Static assets (images, CSS, etc.)
66
66
  - `_templates/` - Custom templates
67
+
68
+ ## Search and discovery
69
+
70
+ The HTML build generates page descriptions, Open Graph metadata, canonical URLs,
71
+ a `sitemap.xml`, and software structured data on the homepage. The documentation
72
+ version is read from `pyproject.toml`. Update `page_descriptions` in `conf.py` when
73
+ adding a landing page, and keep structured data consistent with visible content.
74
+
75
+ After deployment, submit `https://tuftsbcb.github.io/RegDiffusion/sitemap.xml` in
76
+ Google Search Console and Bing Webmaster Tools. Inspect the homepage and FAQ to
77
+ confirm that the deployed pages can be indexed. Track non-brand queries such as
78
+ "single-cell gene regulatory network inference" and referrals from AI search,
79
+ alongside branded RegDiffusion queries. Record dates and cited URLs when manually
80
+ checking AI answers; one answer is not a reliable ranking measurement.
81
+
82
+ This project is hosted under `/RegDiffusion/`. A robots.txt in this repository's
83
+ published directory would not control crawling: robots.txt must be served from
84
+ the origin root (`https://tuftsbcb.github.io/robots.txt`), managed by the organization
85
+ site. Review that root file if crawling is blocked. Special AI files or metadata
86
+ do not guarantee indexing or AI citations.