deepscenic 0.1.0__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 (110) hide show
  1. deepscenic-0.1.0/.github/ISSUE_TEMPLATE/bug_report.yml +48 -0
  2. deepscenic-0.1.0/.github/ISSUE_TEMPLATE/config.yml +5 -0
  3. deepscenic-0.1.0/.github/ISSUE_TEMPLATE/feature_request.yml +11 -0
  4. deepscenic-0.1.0/.github/dependabot.yml +10 -0
  5. deepscenic-0.1.0/.github/workflows/build.yaml +38 -0
  6. deepscenic-0.1.0/.github/workflows/release.yaml +33 -0
  7. deepscenic-0.1.0/.github/workflows/ruff.yaml +33 -0
  8. deepscenic-0.1.0/.github/workflows/test.yaml +95 -0
  9. deepscenic-0.1.0/.gitignore +37 -0
  10. deepscenic-0.1.0/.pre-commit-config.yaml +10 -0
  11. deepscenic-0.1.0/.readthedocs.yaml +16 -0
  12. deepscenic-0.1.0/CITATION.cff +34 -0
  13. deepscenic-0.1.0/LICENSE +60 -0
  14. deepscenic-0.1.0/PKG-INFO +203 -0
  15. deepscenic-0.1.0/README.md +136 -0
  16. deepscenic-0.1.0/docs/_static/css/custom.css +1 -0
  17. deepscenic-0.1.0/docs/_templates/.gitkeep +1 -0
  18. deepscenic-0.1.0/docs/api/data.md +32 -0
  19. deepscenic-0.1.0/docs/api/datasets.md +44 -0
  20. deepscenic-0.1.0/docs/api/genome.md +33 -0
  21. deepscenic-0.1.0/docs/api/io.md +31 -0
  22. deepscenic-0.1.0/docs/api/plotting.md +67 -0
  23. deepscenic-0.1.0/docs/api/preprocessing.md +43 -0
  24. deepscenic-0.1.0/docs/api/tools.md +101 -0
  25. deepscenic-0.1.0/docs/api.md +43 -0
  26. deepscenic-0.1.0/docs/architecture.md +101 -0
  27. deepscenic-0.1.0/docs/changelog.md +38 -0
  28. deepscenic-0.1.0/docs/conf.py +213 -0
  29. deepscenic-0.1.0/docs/contributing.md +118 -0
  30. deepscenic-0.1.0/docs/deepSCENIC.png +0 -0
  31. deepscenic-0.1.0/docs/index.md +18 -0
  32. deepscenic-0.1.0/docs/installation.md +83 -0
  33. deepscenic-0.1.0/docs/notebooks/01_data_preparation.ipynb +1029 -0
  34. deepscenic-0.1.0/docs/notebooks/02_training.ipynb +16838 -0
  35. deepscenic-0.1.0/docs/notebooks/03_model_diagnosis.ipynb +384 -0
  36. deepscenic-0.1.0/docs/notebooks/04_grn_analysis.ipynb +1826 -0
  37. deepscenic-0.1.0/docs/notebooks/05_perturbation_analysis.ipynb +533 -0
  38. deepscenic-0.1.0/docs/notebooks/06_sequence_interpretation.ipynb +357 -0
  39. deepscenic-0.1.0/docs/notebooks/07_legacy_migration.ipynb +329 -0
  40. deepscenic-0.1.0/docs/references.bib +52 -0
  41. deepscenic-0.1.0/docs/references.md +4 -0
  42. deepscenic-0.1.0/docs/tutorials.md +37 -0
  43. deepscenic-0.1.0/pyproject.toml +186 -0
  44. deepscenic-0.1.0/src/deepscenic/__init__.py +90 -0
  45. deepscenic-0.1.0/src/deepscenic/_data.py +131 -0
  46. deepscenic-0.1.0/src/deepscenic/_datasets.py +486 -0
  47. deepscenic-0.1.0/src/deepscenic/_genome.py +501 -0
  48. deepscenic-0.1.0/src/deepscenic/_io.py +364 -0
  49. deepscenic-0.1.0/src/deepscenic/_types.py +304 -0
  50. deepscenic-0.1.0/src/deepscenic/models/__init__.py +21 -0
  51. deepscenic-0.1.0/src/deepscenic/models/_decoder.py +60 -0
  52. deepscenic-0.1.0/src/deepscenic/models/_encoder.py +79 -0
  53. deepscenic-0.1.0/src/deepscenic/models/_layers.py +135 -0
  54. deepscenic-0.1.0/src/deepscenic/models/_motifnet.py +94 -0
  55. deepscenic-0.1.0/src/deepscenic/models/_vae.py +226 -0
  56. deepscenic-0.1.0/src/deepscenic/pl/__init__.py +59 -0
  57. deepscenic-0.1.0/src/deepscenic/pl/_colors.py +118 -0
  58. deepscenic-0.1.0/src/deepscenic/pl/_embedding.py +155 -0
  59. deepscenic-0.1.0/src/deepscenic/pl/_utils.py +149 -0
  60. deepscenic-0.1.0/src/deepscenic/pl/genomics/__init__.py +9 -0
  61. deepscenic-0.1.0/src/deepscenic/pl/genomics/_arc.py +183 -0
  62. deepscenic-0.1.0/src/deepscenic/pl/genomics/_browser.py +304 -0
  63. deepscenic-0.1.0/src/deepscenic/pl/grn/__init__.py +12 -0
  64. deepscenic-0.1.0/src/deepscenic/pl/grn/_heatmap.py +306 -0
  65. deepscenic-0.1.0/src/deepscenic/pl/grn/_network.py +388 -0
  66. deepscenic-0.1.0/src/deepscenic/pl/perturbation/__init__.py +12 -0
  67. deepscenic-0.1.0/src/deepscenic/pl/perturbation/_heatmap.py +254 -0
  68. deepscenic-0.1.0/src/deepscenic/pl/perturbation/_pca.py +292 -0
  69. deepscenic-0.1.0/src/deepscenic/pl/perturbation/_volcano.py +137 -0
  70. deepscenic-0.1.0/src/deepscenic/pl/sequence/__init__.py +10 -0
  71. deepscenic-0.1.0/src/deepscenic/pl/sequence/_ism.py +109 -0
  72. deepscenic-0.1.0/src/deepscenic/pl/sequence/_logo.py +201 -0
  73. deepscenic-0.1.0/src/deepscenic/pl/training/__init__.py +13 -0
  74. deepscenic-0.1.0/src/deepscenic/pl/training/_diagnostics.py +389 -0
  75. deepscenic-0.1.0/src/deepscenic/pp/__init__.py +391 -0
  76. deepscenic-0.1.0/src/deepscenic/pp/basic.py +416 -0
  77. deepscenic-0.1.0/src/deepscenic/pp/search_space.py +387 -0
  78. deepscenic-0.1.0/src/deepscenic/tl/__init__.py +75 -0
  79. deepscenic-0.1.0/src/deepscenic/tl/_dataloaders.py +334 -0
  80. deepscenic-0.1.0/src/deepscenic/tl/_grn.py +1181 -0
  81. deepscenic-0.1.0/src/deepscenic/tl/_inference.py +136 -0
  82. deepscenic-0.1.0/src/deepscenic/tl/_logging.py +172 -0
  83. deepscenic-0.1.0/src/deepscenic/tl/_loss.py +343 -0
  84. deepscenic-0.1.0/src/deepscenic/tl/_model.py +920 -0
  85. deepscenic-0.1.0/src/deepscenic/tl/_perturbation.py +313 -0
  86. deepscenic-0.1.0/src/deepscenic/tl/_sequence.py +242 -0
  87. deepscenic-0.1.0/src/deepscenic/tl/_train.py +1378 -0
  88. deepscenic-0.1.0/src/deepscenic/tl/_training_state.py +182 -0
  89. deepscenic-0.1.0/tests/__init__.py +1 -0
  90. deepscenic-0.1.0/tests/conftest.py +490 -0
  91. deepscenic-0.1.0/tests/data/allTFs_test.txt +20 -0
  92. deepscenic-0.1.0/tests/data/fragment_matrix_train.h5ad +0 -0
  93. deepscenic-0.1.0/tests/data/genome.fa +6251 -0
  94. deepscenic-0.1.0/tests/data/r2g_mask.npz +0 -0
  95. deepscenic-0.1.0/tests/data/raw_exprMat_train.h5ad +0 -0
  96. deepscenic-0.1.0/tests/test_datasets.py +232 -0
  97. deepscenic-0.1.0/tests/test_genome.py +336 -0
  98. deepscenic-0.1.0/tests/test_io.py +550 -0
  99. deepscenic-0.1.0/tests/test_pipeline_integration.py +584 -0
  100. deepscenic-0.1.0/tests/test_pl_perturbation_pca.py +146 -0
  101. deepscenic-0.1.0/tests/test_pp.py +927 -0
  102. deepscenic-0.1.0/tests/test_schema.py +103 -0
  103. deepscenic-0.1.0/tests/test_tl_dataloaders.py +222 -0
  104. deepscenic-0.1.0/tests/test_tl_grn.py +775 -0
  105. deepscenic-0.1.0/tests/test_tl_integration.py +234 -0
  106. deepscenic-0.1.0/tests/test_tl_loss.py +224 -0
  107. deepscenic-0.1.0/tests/test_tl_perturbation.py +282 -0
  108. deepscenic-0.1.0/tests/test_tl_sequence.py +93 -0
  109. deepscenic-0.1.0/tests/test_tl_training_state.py +33 -0
  110. deepscenic-0.1.0/tests/test_types.py +205 -0
@@ -0,0 +1,48 @@
1
+ name: Bug report
2
+ description: Report something that is broken or incorrect
3
+ labels: bug
4
+ body:
5
+ - type: markdown
6
+ attributes:
7
+ value: |
8
+ **Note**: Please read [this guide](https://matthewrocklin.com/blog/work/2018/02/28/minimal-bug-reports)
9
+ detailing how to provide the necessary information for us to reproduce your bug. In brief:
10
+ * Please provide exact steps how to reproduce the bug in a clean Python environment.
11
+ * In case it's not clear what's causing this bug, please provide the data or the data generation procedure.
12
+ * Sometimes it is not possible to share the data, but usually it is possible to replicate problems on publicly
13
+ available datasets or to share a subset of your data.
14
+
15
+ - type: textarea
16
+ id: report
17
+ attributes:
18
+ label: Report
19
+ description: A clear and concise description of what the bug is.
20
+ validations:
21
+ required: true
22
+
23
+ - type: textarea
24
+ id: versions
25
+ attributes:
26
+ label: Versions
27
+ description: |
28
+ Which version of packages are you using?
29
+ Please install `session-info2` and run the following command in a notebook:
30
+ ```python
31
+ import session_info2
32
+ session_info2.session_info(
33
+ "deepscenic", "anndata", "mudata",
34
+ "torch", "enformer_pytorch",
35
+ "scanpy", "numpy", "scipy", "pandas",
36
+ )
37
+ ```
38
+ render: python
39
+ placeholder: |
40
+ deepscenic 0.1.0
41
+ anndata 0.11.3
42
+ mudata 0.3.1
43
+ torch 2.6.0
44
+ enformer_pytorch 0.8.12
45
+ scanpy 1.10.4
46
+ numpy 2.2.2
47
+ scipy 1.15.0
48
+ pandas 2.2.3
@@ -0,0 +1,5 @@
1
+ blank_issues_enabled: false
2
+ contact_links:
3
+ - name: Scverse Community Forum
4
+ url: https://discourse.scverse.org/
5
+ about: If you have questions about "How to do X", please ask them here.
@@ -0,0 +1,11 @@
1
+ name: Feature request
2
+ description: Propose a new feature for deepSCENIC
3
+ labels: enhancement
4
+ body:
5
+ - type: textarea
6
+ id: description
7
+ attributes:
8
+ label: Description of feature
9
+ description: Please describe your suggestion for a new feature. It might help to describe a problem or use case, plus any alternatives that you have considered.
10
+ validations:
11
+ required: true
@@ -0,0 +1,10 @@
1
+ version: 2
2
+ updates:
3
+ # Keep the SHA-pinned actions in .github/workflows up to date
4
+ - package-ecosystem: github-actions
5
+ directory: /
6
+ schedule:
7
+ interval: monthly
8
+ groups:
9
+ actions:
10
+ patterns: ["*"]
@@ -0,0 +1,38 @@
1
+ name: Check Build
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ branches: [main]
8
+
9
+ concurrency:
10
+ group: ${{ github.workflow }}-${{ github.ref }}
11
+ # Cancel superseded PR runs, but let every push to main finish
12
+ cancel-in-progress: ${{ github.event_name == 'pull_request' }}
13
+
14
+ permissions:
15
+ contents: read
16
+
17
+ defaults:
18
+ run:
19
+ # to fail on error in multiline statements (-e), in pipes (-o pipefail), and on unset variables (-u).
20
+ shell: bash -euo pipefail {0}
21
+
22
+ jobs:
23
+ package:
24
+ runs-on: ubuntu-latest
25
+ steps:
26
+ - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
27
+ with:
28
+ filter: blob:none
29
+ fetch-depth: 0
30
+ persist-credentials: false
31
+ - name: Install uv
32
+ uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
33
+ with:
34
+ cache-dependency-glob: pyproject.toml
35
+ - name: Build package
36
+ run: uv build
37
+ - name: Check package
38
+ run: uvx twine check --strict dist/*
@@ -0,0 +1,33 @@
1
+ name: Release
2
+
3
+ on:
4
+ release:
5
+ types: [published]
6
+
7
+ # Use "trusted publishing", see https://docs.pypi.org/trusted-publishers/
8
+ permissions: {}
9
+
10
+ jobs:
11
+ release:
12
+ name: Upload release to PyPI
13
+ runs-on: ubuntu-latest
14
+ environment:
15
+ name: pypi
16
+ url: https://pypi.org/p/deepscenic
17
+ permissions:
18
+ contents: read
19
+ id-token: write
20
+ steps:
21
+ - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
22
+ with:
23
+ filter: blob:none
24
+ fetch-depth: 0
25
+ persist-credentials: false
26
+ - name: Install uv
27
+ uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
28
+ with:
29
+ enable-cache: false
30
+ - name: Build package
31
+ run: uv build
32
+ - name: Publish package distributions to PyPI
33
+ uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # v1.14.2
@@ -0,0 +1,33 @@
1
+ name: Ruff
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ branches: [main]
8
+
9
+ concurrency:
10
+ group: ${{ github.workflow }}-${{ github.ref }}
11
+ # Cancel superseded PR runs, but let every push to main finish
12
+ cancel-in-progress: ${{ github.event_name == 'pull_request' }}
13
+
14
+ permissions:
15
+ contents: read
16
+
17
+ jobs:
18
+ ruff:
19
+ name: Lint and format check
20
+ runs-on: ubuntu-latest
21
+ steps:
22
+ - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
23
+ with:
24
+ persist-credentials: false
25
+ - name: Install uv
26
+ uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
27
+ with:
28
+ enable-cache: false
29
+ # Config (incl. pydocstyle "D" rules, numpy convention) lives in pyproject.toml
30
+ - name: Ruff lint
31
+ run: uvx ruff check --output-format=github src tests
32
+ - name: Ruff format
33
+ run: uvx ruff format --check src tests
@@ -0,0 +1,95 @@
1
+ name: Test
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ branches: [main]
8
+
9
+ concurrency:
10
+ group: ${{ github.workflow }}-${{ github.ref }}
11
+ # Cancel superseded PR runs, but let every push to main finish
12
+ cancel-in-progress: ${{ github.event_name == 'pull_request' }}
13
+
14
+ permissions:
15
+ contents: read
16
+
17
+ defaults:
18
+ run:
19
+ # to fail on error in multiline statements (-e), in pipes (-o pipefail), and on unset variables (-u).
20
+ shell: bash -euo pipefail {0}
21
+
22
+ jobs:
23
+ get-environments:
24
+ runs-on: ubuntu-latest
25
+ outputs:
26
+ envs: ${{ steps.get-envs.outputs.envs }}
27
+ steps:
28
+ - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
29
+ with:
30
+ filter: blob:none
31
+ fetch-depth: 0
32
+ persist-credentials: false
33
+ - name: Install uv
34
+ uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
35
+ - name: Get test environments
36
+ id: get-envs
37
+ run: |
38
+ ENVS_JSON=$(uvx hatch env show --json | jq -c 'to_entries
39
+ | map(
40
+ select(.key | startswith("hatch-test"))
41
+ | {
42
+ name: .key,
43
+ label: (if (.key | contains("pre")) then .key + " (PRE-RELEASE DEPENDENCIES)" else .key end),
44
+ python: .value.python
45
+ }
46
+ )')
47
+ echo "envs=${ENVS_JSON}" | tee $GITHUB_OUTPUT
48
+
49
+ # Run tests through hatch. Spawns a separate runner for each environment defined in the hatch matrix obtained above.
50
+ test:
51
+ needs: get-environments
52
+
53
+ strategy:
54
+ fail-fast: false
55
+ matrix:
56
+ os: [ubuntu-latest]
57
+ env: ${{ fromJSON(needs.get-environments.outputs.envs) }}
58
+
59
+ name: ${{ matrix.env.label }}
60
+ runs-on: ${{ matrix.os }}
61
+ env:
62
+ # Runners have no GPU: install CPU-only torch instead of the multi-GB CUDA build
63
+ UV_TORCH_BACKEND: cpu
64
+
65
+ steps:
66
+ - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
67
+ with:
68
+ filter: blob:none
69
+ fetch-depth: 0
70
+ persist-credentials: false
71
+ - name: Install uv
72
+ uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
73
+ with:
74
+ python-version: ${{ matrix.env.python }}
75
+ cache-dependency-glob: pyproject.toml
76
+ - name: create hatch environment
77
+ run: uvx hatch env create ${{ matrix.env.name }}
78
+ - name: run tests using hatch
79
+ env:
80
+ MPLBACKEND: agg
81
+ run: uvx hatch run ${{ matrix.env.name }}:run -v --color=yes
82
+
83
+ # Check that all tests defined above pass. This makes it easy to set a single "required" test in branch
84
+ # protection instead of having to update it frequently. See https://github.com/re-actors/alls-green#why.
85
+ check:
86
+ name: Tests pass in all hatch environments
87
+ if: always()
88
+ needs:
89
+ - get-environments
90
+ - test
91
+ runs-on: ubuntu-latest
92
+ steps:
93
+ - uses: re-actors/alls-green@b5b5b37504aa4183270bd3d855c52a67f212be35 # v1.3.0
94
+ with:
95
+ jobs: ${{ toJSON(needs) }}
@@ -0,0 +1,37 @@
1
+ # Project-specific
2
+ .claude
3
+ thoughts/
4
+ archived/
5
+ scripts/
6
+ *.slurm
7
+ CLAUDE.md
8
+ pyrightconfig.json
9
+ docs/notebooks/data
10
+
11
+ # Python
12
+ *__pycache__*
13
+ *.py[cod]
14
+ *.egg-info/
15
+ dist/
16
+ build/
17
+ .eggs/
18
+
19
+ # Jupyter
20
+ *.ipynb_checkpoints*
21
+
22
+ # Documentation
23
+ docs/_build/
24
+ docs/api/_autosummary/
25
+
26
+ # Testing
27
+ .pytest_cache/
28
+
29
+ # IDE
30
+ .vscode/
31
+ .idea/
32
+
33
+ # Environment
34
+ .env
35
+ .venv/
36
+ venv/
37
+ uv.lock
@@ -0,0 +1,10 @@
1
+ # Install once with `pre-commit install`; hooks then run on every commit.
2
+ # Ruff config lives in pyproject.toml. Scope matches the CI ruff workflow (src/ and tests/).
3
+ files: ^(src|tests)/
4
+ repos:
5
+ - repo: https://github.com/astral-sh/ruff-pre-commit
6
+ rev: v0.16.10
7
+ hooks:
8
+ - id: ruff-check
9
+ args: [--fix]
10
+ - id: ruff-format
@@ -0,0 +1,16 @@
1
+ version: 2
2
+
3
+ build:
4
+ os: ubuntu-24.04
5
+ tools:
6
+ python: "3.12"
7
+ nodejs: latest
8
+ jobs:
9
+ create_environment:
10
+ - asdf plugin add uv
11
+ - asdf install uv latest
12
+ - asdf global uv latest
13
+ build:
14
+ html:
15
+ - uvx hatch run docs:build
16
+ - mv docs/_build $READTHEDOCS_OUTPUT
@@ -0,0 +1,34 @@
1
+ cff-version: 1.2.0
2
+ message: "If you use deepSCENIC in your research, please cite the paper below."
3
+ title: "deepSCENIC"
4
+ abstract: "Deep learning for single-cell Gene Regulatory Networks"
5
+ type: software
6
+ authors:
7
+ - family-names: Partel
8
+ given-names: Gabriele
9
+ repository-code: "https://github.com/aertslab/deepSCENIC"
10
+ url: "https://deepscenic.readthedocs.io"
11
+ keywords:
12
+ - single-cell
13
+ - gene regulatory networks
14
+ - deep learning
15
+ - multiomics
16
+ - scverse
17
+ preferred-citation:
18
+ type: article
19
+ title: "DeepSCENIC: transfer learning from sequence-to-function models enables causal gene regulatory network inference"
20
+ authors:
21
+ - family-names: Partel
22
+ given-names: Gabriele
23
+ - family-names: De Winter
24
+ given-names: Seppe
25
+ - family-names: Konstantakos
26
+ given-names: Vasileios
27
+ - family-names: Blaauw
28
+ given-names: Casper H.
29
+ - family-names: Aerts
30
+ given-names: Stein
31
+ journal: "bioRxiv"
32
+ year: 2026
33
+ doi: "10.64898/2026.09.18.752607"
34
+ url: "https://www.biorxiv.org/content/10.64898/2026.09.18.752607v1"
@@ -0,0 +1,60 @@
1
+
2
+ Academic Non-commercial Software License Agreement
3
+
4
+ The Licensed Software is developed by and on behalf of the Laboratory of Computational Biology of VIB-KU Leuven and is owned by VIB vzw, located at Rijvisschestraat 120, B-9052 Zwijnaarde, Belgium (hereinafter referred to as "VIB"). By downloading or installing the Licensed Software, the user agrees with the terms and conditions below.
5
+
6
+ Definitions
7
+
8
+ “Licensed Software” shall mean deepSCENIC as available on GitHub.
9
+
10
+ "Effective Date" shall mean the date on which you download or install deepSCENIC (as available on GitHub) on your system and which provide you access to the deepSCENIC tool.
11
+
12
+ “Commercial Purposes” shall include (1) the use of Licensed Software to provide a service, information or data that is directly or indirectly conveyed to any third party against compensation, (2) any type of transfer of the Licensed Software for compensation, and (3) any other use of Licensed Software that supports commercial entities.
13
+
14
+ License
15
+
16
+ 1. Licensed Software is the work of the Aerts lab. The copyright in Licensed Software is owned by VIB.
17
+
18
+ 2. Subject to the terms and conditions of this Agreement, VIB hereby grants and the user accepts a non-exclusive, non-transferable license to use the Licensed Software for strictly internal academic research use only, on your own behalf or on behalf of your institution, and not for Commercial Purposes.
19
+
20
+ 3. The user confirms to be an academic user. For academic users, there is no license fee.
21
+
22
+ 4. The user shall acknowledge VIB as the provider of Licensed Software and shall include the following reference “SCENIC+: single-cell multiomic inference of enhancers and gene regulatory networks Carmen Bravo González-Blas, Seppe De Winter, Gert Hulselmans, Nikolai Hecker, Irina Matetovici, Valerie Christiaens, Suresh Poovathingal, Jasper Wouters, Sara Aibar, Stein Aerts bioRxiv 2022.08.19.504505 (doi: https://doi.org/10.1101/2022.08.19.504505)” in any manuscript describing data obtained using Licensed Software.
23
+
24
+ 5. This license does not entitle the user to receive from VIB hard-copy documentation, technical support, telephone assistance, or enhancements or updates to the Licensed Software, and nothing contained herein shall be interpreted as to require VIB, its faculty, employees or students to provide maintenance, installation services, debugging, consultation or end-user support of any kind.
25
+
26
+ 6. The title and copyright to Licensed Software and any associated programs and documentation shall remain with VIB. The user agrees to preserve the same.
27
+
28
+ 7. The user agrees not to make any copies of Licensed Software except for use in the user’s laboratory, without VIB’s prior written consent. The user agrees to place the appropriate copyright notice on any such copies.
29
+
30
+ 8. The user shall not distribute Licensed Software to other laboratories within user’s institution. The user shall not transfer Licensed Software to another location or person outside of user’s institution without VIB’s prior and written permission.
31
+
32
+ 9. The user shall not market or otherwise benefit commercially from any product utilizing any portion of Licensed Software, nor any derivative works of Licensed Software, without first entering into a separate commercial license with VIB.
33
+
34
+ 10. Except as otherwise expressly permitted in this Agreement, the user must not (i) modify or create any derivative works of the Licensed Software or documentation, including customization, translation or localization; (ii) decompile, disassemble, reverse engineer, or otherwise attempt to derive the source code for the Licensed Software; (iii) remove or alter any trademark, logo, copyright or other proprietary notices, legends, symbols or labels in the Licensed Software.
35
+
36
+ 11. The user acknowledges that the Licensed Software is proprietary to VIB. The software code shall be treated as trade secrets and confidential information of VIB, and the user agrees to use all reasonable efforts to hold the same in confidence. The user’s obligation for confidentiality shall not extend to any information which (i) is or becomes generally available to the public, (ii) is already known to or subsequently disclosed by third parties to the user and at its free disposal, or (iii) is independently developed by the user or its affiliates without the use of the confidential information disclosed by VIB, or (iv) is required by law or legal process to be disclosed.
37
+
38
+ 12. The user acknowledges that Licensed Software is a research tool and provided free of charge, it is only provided “as is”. VIB makes no representations or warranties of any type whatsoever, express or implied, regarding the Licensed Software. VIB expressly disclaims all representations and warranties regarding the Licensed Software, including but not limited to any representations or warranties of merchantability or fitness for any particular application or that the use of the Licensed Software will not infringe any patents, copyrights or trademarks or other rights of third parties, or any warranty that the rights and licenses granted hereunder comprise all the rights and licenses necessary or desirable to use the Licensed Software for internal non-commercial research purposes as permitted by this Agreement. The entire risk as to the quality and performance of the Licensed Software is borne by the user.
39
+
40
+ 13. VIB shall not be responsible for losses of any kind resulting from the use of Licensed Software, and can in no way provide compensation for any losses sustained, including but not limited to, any obligation, liability, right, claim or remedy for tort, or for any actual or alleged infringement of patents, copyrights, trade secrets, or similar rights of third parties, nor any business expense, machine downtime or damages caused by any deficiency, defect or error in Licensed Software or mal-function thereof, nor any incidental or consequential damages, however caused.
41
+
42
+ 14. The user will indemnify, defend and hold harmless VIB, its directors, officers, employees and agents from and against all liability, losses, damages and expenses (including attorney’s fees and costs) arising out of any claims, demands, actions or other proceedings made or instituted by any third party against any of them and arising out of or relating to any breach of this Agreement by the user, or any use of the Licensed Software by the user, except insofar as such claims or liability result from VIB’s gross negligence or willful misconduct.
43
+
44
+ 15. This Agreement and the license rights granted herein shall become effective as of the date the user downloaded the Licensed Software and shall continue in full force until the user deletes the Licensed Software and any and all related files from the user’s computing system, unless terminated in accordance with this Section. Upon one party's breach of any agreement, covenant, or representation made in this Agreement, the agreement will automatically end thirty (30) days after such breach. Either party shall have the right, at any time, to terminate this Agreement without cause by written notice to the other party specifying the date of termination. Upon termination, the user shall destroy all full and partial copies of the Licensed Software. The user shall forward written notice to VIB that all programs containing Licensed Software have been deleted from all computer libraries and storage or memory devices and are no longer stored therein.
45
+
46
+ 16. This Agreement shall be construed in accordance with the laws of Belgium. The courts of Belgium shall have exclusive jurisdiction.
47
+
48
+ 17. The parties agree that this Agreement is the complete and exclusive agreement among the parties and supersedes all proposals and prior agreements whether written or oral, and all other communications among the parties relating to the subject matter of this Agreement. This Agreement cannot be modified except in writing and signed by both parties. Failure by either party at any time to enforce any of the provisions of this Agreement shall not constitute a waiver by such party of such provision nor in any way affect the validity of this Agreement.
49
+
50
+ 18. The invalidity of singular provisions does not affect the validity of the entire understanding. The parties are obligated, however, to replace the invalid provisions by a regulation, which comes closest to the economic intent of the invalid provision. The same shall apply mutatis mutandis in case of a gap.
51
+
52
+
53
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
54
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
55
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
56
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
57
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
58
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
59
+ THE SOFTWARE.
60
+
@@ -0,0 +1,203 @@
1
+ Metadata-Version: 2.5
2
+ Name: deepscenic
3
+ Version: 0.1.0
4
+ Summary: Deep learning for single-cell Gene Regulatory Networks
5
+ Project-URL: Homepage, https://github.com/aertslab/deepSCENIC
6
+ Project-URL: Documentation, https://deepscenic.readthedocs.io
7
+ Project-URL: Repository, https://github.com/aertslab/deepSCENIC
8
+ Project-URL: Issues, https://github.com/aertslab/deepSCENIC/issues
9
+ Author-email: Gabriele Partel <gabriele.partel@kuleuven.be>
10
+ Maintainer-email: Gabriele Partel <gabriele.partel@kuleuven.be>, Lukas Mahieu <lukas.mahieu@kuleuven.be>
11
+ License-File: LICENSE
12
+ Keywords: GRN,deep-learning,gene-regulation,multiomics,scverse,single-cell
13
+ Classifier: Intended Audience :: Science/Research
14
+ Classifier: Operating System :: OS Independent
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.12
17
+ Classifier: Programming Language :: Python :: 3.13
18
+ Classifier: Programming Language :: Python :: 3.14
19
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
20
+ Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
21
+ Requires-Python: >=3.12
22
+ Requires-Dist: anndata>=0.12
23
+ Requires-Dist: matplotlib>=3.7
24
+ Requires-Dist: mudata>=0.2.3
25
+ Requires-Dist: networkx>=3.0
26
+ Requires-Dist: numpy>=2.1
27
+ Requires-Dist: pandas<3.0,>=2.0
28
+ Requires-Dist: pooch>=1.6
29
+ Requires-Dist: pyarrow>=14.0
30
+ Requires-Dist: pybiomart>=0.2
31
+ Requires-Dist: pyfaidx>=0.9
32
+ Requires-Dist: requests>=2.28
33
+ Requires-Dist: scanpy>=1.11
34
+ Requires-Dist: scikit-learn>=1.2
35
+ Requires-Dist: scipy>=1.14
36
+ Requires-Dist: seaborn>=0.12
37
+ Requires-Dist: torch-geometric>=2.7
38
+ Requires-Dist: torch>=2.6
39
+ Requires-Dist: tqdm>=4.65
40
+ Provides-Extra: dev
41
+ Requires-Dist: pre-commit>=3.0; extra == 'dev'
42
+ Requires-Dist: ruff>=0.1.0; extra == 'dev'
43
+ Requires-Dist: twine>=4.0; extra == 'dev'
44
+ Provides-Extra: doc
45
+ Requires-Dist: docutils!=0.18.*,!=0.19.*,>=0.8; extra == 'doc'
46
+ Requires-Dist: enformer-pytorch>=0.8.12; extra == 'doc'
47
+ Requires-Dist: ipykernel; extra == 'doc'
48
+ Requires-Dist: ipython; extra == 'doc'
49
+ Requires-Dist: ipywidgets; extra == 'doc'
50
+ Requires-Dist: myst-nb>=1.1; extra == 'doc'
51
+ Requires-Dist: pandas; extra == 'doc'
52
+ Requires-Dist: setuptools; extra == 'doc'
53
+ Requires-Dist: sphinx-autodoc-typehints; extra == 'doc'
54
+ Requires-Dist: sphinx-book-theme>=1; extra == 'doc'
55
+ Requires-Dist: sphinx-copybutton; extra == 'doc'
56
+ Requires-Dist: sphinx-tabs; extra == 'doc'
57
+ Requires-Dist: sphinx>=8.1; extra == 'doc'
58
+ Requires-Dist: sphinxcontrib-bibtex>=1; extra == 'doc'
59
+ Requires-Dist: sphinxext-opengraph; extra == 'doc'
60
+ Provides-Extra: enformer
61
+ Requires-Dist: enformer-pytorch>=0.8.12; extra == 'enformer'
62
+ Provides-Extra: test
63
+ Requires-Dist: debugpy; extra == 'test'
64
+ Requires-Dist: enformer-pytorch>=0.8.12; extra == 'test'
65
+ Requires-Dist: pytest>=7.0; extra == 'test'
66
+ Description-Content-Type: text/markdown
67
+
68
+ # deepSCENIC
69
+
70
+ **Deep learning for single-cell Gene Regulatory Networks**
71
+
72
+ [![Documentation](https://readthedocs.org/projects/deepscenic/badge/?version=latest)](https://deepscenic.readthedocs.io)
73
+ [![PyPI](https://img.shields.io/pypi/v/deepscenic.svg)](https://pypi.org/project/deepscenic)
74
+ [![Python](https://img.shields.io/pypi/pyversions/deepscenic.svg)](https://pypi.org/project/deepscenic)
75
+
76
+ <img src="https://raw.githubusercontent.com/aertslab/deepSCENIC/main/docs/deepSCENIC.png" width=100%>
77
+
78
+ deepSCENIC learns hierarchical TF→region→gene regulatory cascades by integrating scRNA-seq, scATAC-seq, and DNA sequence data. It combines a VAE-based multimodal framework with Enformer-derived sequence embeddings to infer cell-type-specific gene regulatory networks.
79
+
80
+ ## Key Features
81
+
82
+ - **Multimodal integration**: Jointly models RNA expression and chromatin accessibility
83
+ - **Sequence-informed**: Uses Enformer to learn TF binding patterns from DNA sequence
84
+ - **Perturbation prediction**: Simulates TF knockdown/overexpression effects
85
+ - **scverse compatible**: Works with AnnData, MuData, and scanpy workflows
86
+
87
+ ## Installation
88
+
89
+ ```bash
90
+ pip install deepscenic
91
+ ```
92
+ If you want to use the [enformer](https://github.com/lucidrains/enformer-pytorch) model as the sequence model (this is the default):
93
+
94
+ ```bash
95
+ pip install deepscenic[enformer]
96
+ ```
97
+
98
+ **Requirements**: Python ≥3.12, PyTorch ≥2.6
99
+
100
+ ## Documentation
101
+
102
+ Full documentation including tutorials and API reference: [deepscenic.readthedocs.io](https://deepscenic.readthedocs.io)
103
+
104
+ ## Quick Start
105
+
106
+ deepSCENIC follows the scanpy-style API with modules for preprocessing (`ds.pp`), tools (`ds.tl`), and plotting (`ds.pl`).
107
+
108
+ ### Data Preparation
109
+
110
+ ```python
111
+ import deepscenic as ds
112
+
113
+ # Annotate transcription factors on the RNA data
114
+ tfs = ds.fetch_tf_collection(species="human")
115
+ ds.pp.mark_tfs(adata_rna, tf_list=tfs)
116
+
117
+ # Add gene annotations (for chromosome-based splitting)
118
+ annot, chromsizes = ds.fetch_gene_annotation(species="hsapiens")
119
+ ds.pp.add_gene_annotation(adata_rna, gene_annotation=annot)
120
+
121
+ mdata = ds.pp.create_mudata(rna=adata_rna, atac=adata_atac)
122
+
123
+ # Compute region-to-gene search space (regions within 1Mb of gene TSS)
124
+ ds.pp.compute_r2g_penalty(mdata)
125
+
126
+ # Split cells and features for training/evaluation
127
+ ds.pp.split_cells(mdata, test_fraction=0.2, stratify_key="cell_type")
128
+ ds.pp.split_features_by_chromosome(mdata, test_chromosomes=["chr7", "chr11"])
129
+ ```
130
+
131
+ ### Model Training
132
+
133
+ ```python
134
+ # Register genome for sequence extraction
135
+ ds.register_genome("/path/to/hg38.fa")
136
+
137
+ # Phase 1: Train full model (VAE + MotifNet + Enformer)
138
+ model = ds.tl.train(mdata, epochs=100, device="cuda")
139
+
140
+ # Phase 2: Recompute tf2r and finetune all r2g links
141
+ model = ds.tl.finetune_r2g(
142
+ model,
143
+ mdata,
144
+ epochs=500,
145
+ )
146
+
147
+ # Save trained model
148
+ model.save("my_model.pt")
149
+ ```
150
+
151
+ ### GRN Extraction & Analysis
152
+
153
+ ```python
154
+ # Extract gene regulatory network
155
+ grn = ds.tl.extract_grn(model)
156
+
157
+ # Get targets of a specific TF
158
+ targets = ds.tl.get_tf_targets(model, tf_name="SOX10", top_k=100)
159
+
160
+ # Visualize GRN heatmap
161
+ ds.pl.heatmap_grn(model, tfs=["SOX10", "MITF", "PAX3"])
162
+ ```
163
+
164
+ ### Perturbation Simulation
165
+
166
+ ```python
167
+ # Simulate TF knockdown (level=0) or overexpression (level=2)
168
+ perturbed, logFC = ds.tl.simulate_perturbation(
169
+ model,
170
+ mdata,
171
+ tf_name="SOX10",
172
+ level=0, # knockdown
173
+ )
174
+
175
+ # Summarize and visualize perturbation effects
176
+ results = ds.tl.process_perturbation_results(logFC, mdata, tf_name="SOX10")
177
+ ds.pl.waterfall_perturbation(results)
178
+ ```
179
+
180
+ For complete workflows, see the [tutorials](https://deepscenic.readthedocs.io/en/latest/tutorials.html).
181
+
182
+ ## Citation
183
+
184
+ If you use deepSCENIC in your research, please cite:
185
+
186
+ > Partel G, et al. DeepSCENIC: transfer learning from sequence-to-function models enables causal gene regulatory network inference. *bioRxiv* (2026). [doi:10.64898/2026.09.18.752607](https://doi.org/10.64898/2026.09.18.752607)
187
+
188
+ ```bibtex
189
+ @article{partel2026deepscenic,
190
+ title={DeepSCENIC: transfer learning from sequence-to-function models enables causal gene regulatory network inference},
191
+ author={Partel, Gabriele and De Winter, Seppe and Konstantakos, Vasileios and Blaauw, Casper H. and Aerts, Stein},
192
+ journal={bioRxiv},
193
+ year={2026},
194
+ doi={10.64898/2026.09.18.752607}
195
+ }
196
+ ```
197
+
198
+ ## Links
199
+
200
+ - [Documentation](https://deepscenic.readthedocs.io)
201
+ - [GitHub Repository](https://github.com/aertslab/deepSCENIC)
202
+ - [Issue Tracker](https://github.com/aertslab/deepSCENIC/issues)
203
+ - [Enformer PyTorch](https://github.com/lucidrains/enformer-pytorch) - Sequence model implementation