Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
ccc407a
Automated template update to v0.6.0
scverse-bot Sep 30, 2025
95af42b
Feature: dimer detector.
SeppeDeWinter Oct 7, 2025
899d20c
Fix docstrings.
SeppeDeWinter Oct 7, 2025
7f4a600
Add `by` parameter to create_patterns.
SeppeDeWinter Oct 14, 2025
cc2b5ad
refactor distance bias detection and start write tutorial
LukasMahieu Oct 15, 2025
a5fdc85
refactored bias detection and notebooks + single pattern plotting
LukasMahieu Oct 21, 2025
a1668ec
Merge branch 'main' into dimer_detector
LukasMahieu Oct 21, 2025
bb8bdce
ruff fix
LukasMahieu Oct 21, 2025
7782099
Merge pull request #20 from aertslab/feature-create_pattern_by_any_an…
LukasMahieu Oct 23, 2025
3115ddc
Merge branch 'main' into template-update-v2-aertslab-TF-MInDi-v0.6.0
LukasMahieu Oct 23, 2025
be1dee3
Merge pull request #15 from scverse-bot/template-update-v2-aertslab-T…
LukasMahieu Oct 23, 2025
1b6a016
temp tutorial
LukasMahieu Oct 23, 2025
aaeb60b
filter legend based on colors in adata.obs[color_by]
LukasMahieu Oct 24, 2025
884423e
Merge pull request #25 from aertslab/bugfix_color_legend
LukasMahieu Oct 24, 2025
836d2fb
New features:
SeppeDeWinter Oct 24, 2025
a845b26
add missing docstring.
SeppeDeWinter Oct 24, 2025
a0b8b9b
Add plot for setting z-score threshold for distance bias detection.
SeppeDeWinter Oct 24, 2025
b77487c
:-(
SeppeDeWinter Oct 24, 2025
9174ff6
Add files via upload
LukasMahieu Nov 10, 2025
b041af3
Fix spelling of TF-MInDi to TF-MINDI in README
LukasMahieu Nov 10, 2025
18cdf27
Merge pull request #27 from aertslab/update-description
LukasMahieu Nov 10, 2025
78e410e
New features:
SeppeDeWinter Oct 24, 2025
7553f72
Add merge functionality to docs.
SeppeDeWinter Nov 11, 2025
75d7f55
Use binomial test to annotate seqlets.
SeppeDeWinter Nov 18, 2025
9166cb7
Fix doc.
SeppeDeWinter Nov 18, 2025
7ba8297
update notebooks with new assignments
LukasMahieu Nov 19, 2025
1b2ab4a
Add MAFFT-based backend for pattern creation
Nov 19, 2025
4945a04
Add iTaxoTools-mafftpy dependency and set python minimal version to 3…
SeppeDeWinter Nov 28, 2025
301d6d8
Some formatting and type annotation
SeppeDeWinter Dec 10, 2025
da3b845
Replace MIT License with Academic Non-commercial License
LukasMahieu Jan 6, 2026
2597636
Merge pull request #32 from aertslab/patch-license
LukasMahieu Jan 6, 2026
8cce2f4
Change overview figure: Remove TomTom and SCENIC+ and repalce with se…
SeppeDeWinter Jan 7, 2026
0311b73
Add logo and citation.
SeppeDeWinter Jan 15, 2026
4eb8e10
Change to absolute paths.
SeppeDeWinter Jan 15, 2026
0863ded
change logo paths and add logo to readthedocs
LukasMahieu Jan 16, 2026
29f153c
Merge pull request #36 from aertslab/add_logo
LukasMahieu Jan 16, 2026
9b4ca07
change heights
LukasMahieu Jan 16, 2026
8a5d250
upgrade sphinx tabs
LukasMahieu Jan 16, 2026
3d134d8
Merge pull request #37 from aertslab/add_logo
LukasMahieu Jan 16, 2026
94ee7f7
pin sphinx to <9
LukasMahieu Jan 16, 2026
c6cd6bf
Merge pull request #38 from aertslab/add_logo
LukasMahieu Jan 16, 2026
dd2a293
1.2.0 release
LukasMahieu Jan 16, 2026
3b200fe
Merge pull request #39 from aertslab/1.2.0
LukasMahieu Jan 16, 2026
139e1f5
Feature: dimer detector.
SeppeDeWinter Oct 7, 2025
7edf043
Fix docstrings.
SeppeDeWinter Oct 7, 2025
820d6bc
refactor distance bias detection and start write tutorial
LukasMahieu Oct 15, 2025
0d64e0d
refactored bias detection and notebooks + single pattern plotting
LukasMahieu Oct 21, 2025
8adef10
temp tutorial
LukasMahieu Oct 23, 2025
8f19d64
New features:
SeppeDeWinter Oct 24, 2025
314aed3
Add plot for setting z-score threshold for distance bias detection.
SeppeDeWinter Oct 24, 2025
a5c61c2
:-(
SeppeDeWinter Oct 24, 2025
fca83f5
Merge branch 'dimer_detector' of github.com:aertslab/TF-MInDi into di…
SeppeDeWinter Feb 9, 2026
b477fa1
Fix bug where wrong index column was used in adata.obs
SeppeDeWinter Feb 9, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .cruft.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"template": "https://github.com/scverse/cookiecutter-scverse",
"commit": "6ad2d42351bf968ef4962b2f5e664a6e29c090bc",
"checkout": null,
"commit": "d383d94fadff9e4e6fdb59d77c68cb900d7cedec",
"checkout": "v0.6.0",
"context": {
"cookiecutter": {
"project_name": "tfmindi",
Expand Down Expand Up @@ -36,8 +36,8 @@
"trim_blocks": true
},
"_template": "https://github.com/scverse/cookiecutter-scverse",
"_commit": "6ad2d42351bf968ef4962b2f5e664a6e29c090bc"
"_commit": "d383d94fadff9e4e6fdb59d77c68cb900d7cedec"
}
},
"directory": null
}
}
10 changes: 7 additions & 3 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,15 @@ jobs:
MPLBACKEND: agg
PLATFORM: ${{ matrix.os }}
DISPLAY: :42
run: uvx hatch run ${{ matrix.env.name }}:run-cov
run: uvx hatch run ${{ matrix.env.name }}:run-cov -v --color=yes -n auto
- name: generate coverage report
run: uvx hatch run ${{ matrix.env.name }}:coverage xml
run: |
# See https://coverage.readthedocs.io/en/latest/config.html#run-patch
test -f .coverage || uvx hatch run ${{ matrix.env.name }}:cov-combine
uvx hatch run ${{ matrix.env.name }}:cov-report # report visibly
uvx hatch run ${{ matrix.env.name }}:coverage xml # create report for upload
- name: Upload coverage
uses: codecov/codecov-action@v4
uses: codecov/codecov-action@v5

# Check that all tests defined above pass. This makes it easy to set a single "required" test in branch
# protection instead of having to update it frequently. See https://github.com/re-actors/alls-green#why.
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ __pycache__/
# Tests and coverage
/data/
/node_modules/
/.coverage*

# docs
/docs/generated/
Expand Down
18 changes: 2 additions & 16 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,20 @@ default_stages:
- pre-push
minimum_pre_commit_version: 2.16.0
repos:
- repo: https://github.com/biomejs/pre-commit
rev: v1.9.4
hooks:
- id: biome-format
exclude: ^\.cruft\.json$ # inconsistent indentation with cruft - file never to be modified manually.
- repo: https://github.com/tox-dev/pyproject-fmt
rev: v2.6.0
hooks:
- id: pyproject-fmt
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.11.13
rev: v0.13.2
hooks:
- id: ruff-check
types_or: [python, pyi, jupyter]
args: [--fix, --exit-non-zero-on-fix]
- id: ruff-format
types_or: [python, pyi, jupyter]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
rev: v6.0.0
hooks:
- id: detect-private-key
- id: check-ast
Expand All @@ -36,12 +31,3 @@ repos:
# Check that there are no merge conflicts (could be generated by template sync)
- id: check-merge-conflict
args: [--assume-in-merge]
- repo: local
hooks:
- id: forbid-to-commit
name: Don't commit rej files
entry: |
Cannot commit .rej files. These indicate merge conflicts that arise during automated template updates.
Fix the merge conflicts manually and remove the .rej files.
language: fail
files: '.*\.rej$'
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,26 @@ and this project adheres to [Semantic Versioning][].
[keep a changelog]: https://keepachangelog.com/en/1.0.0/
[semantic versioning]: https://semver.org/spec/v2.0.0.html

## 1.2.0

This version accompanies the human neural development paper preprint.

### Features

- updated to scverse template v0.6.0
- added parameter to select pca svd solver for running PCA instead of hardcoded "covariance_eigh"
- added functionality to save and load patterns to and from disk (`tfmindi.save_patterns` and `tfmindi.load_patterns`)
- now allows for patterns to be generated by any annotation in .obs, not only by `leiden`
- can now concatenate multiple TF-MINDI anndatas together using `tfmindi.concat`
- changed behaviour of seqlet most frequent-occurence for annotating clusters to binomial tests
- added MAFFT-based backend as option for pattern creation (much faster than TomTom or k-mer)

### Bugfixes

- fix extra 0-position being included in `Pattern.ic_trim`
- fix failure case in in `Pattern.ic_trim` when all nucleotides are above IC threshold
- plotting legends are filtered on colors in `adata.obs[color_by]`

## 1.1.0

Bugfixes, an updated seqlet calling algorithm, and new k-mer pattern tooling.
Expand Down
62 changes: 50 additions & 12 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,21 +1,59 @@
MIT License

Copyright (c) 2025, Stein Aerts Lab
Academic Non-commercial Software License Agreement

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
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.

Definitions

“Licensed Software” shall mean TF-MINDI as available on GitHub.

"Effective Date" shall mean the date on which you download or install TF-MINDI (as available on GitHub) on your system and which provide you access to the TF-MINDI tool.

“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.

License

1. Licensed Software is the work of the Aerts lab. The copyright in Licensed Software is owned by VIB.

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.

3. The user confirms to be an academic user. For academic users, there is no license fee.

4. The user shall acknowledge VIB as the provider of Licensed Software and shall include the following reference “De Winter, S., & et al. (2025). aertslab/TF-MInDi. Zenodo. https://doi.org/10.5281/zenodo.17202107” in any manuscript describing data obtained using Licensed Software.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

16. This Agreement shall be construed in accordance with the laws of Belgium. The courts of Belgium shall have exclusive jurisdiction.

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.

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.

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
19 changes: 15 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,23 @@
# TF-MInDi: Transcription Factor Motifs and Instances Discovery
<div align="center">
<img src="https://raw.githubusercontent.com/aertslab/TF-MINDI/main/docs/_static/TF-MINDI_LOGO_nobg_notext.png"
height=50%
>
</div>

# TF-MINDI: Transcription Factor Motif Instance Neighborhood Decomposition and Interpretation

[![Tests][badge-tests]][tests]
[![Documentation][badge-docs]][documentation]

[badge-tests]: https://img.shields.io/github/actions/workflow/status/aertslab/TF-MInDi/test.yaml?branch=main
[badge-docs]: https://img.shields.io/readthedocs/tf-mindi

**TF-MInDi** is a Python package for analyzing transcription factor binding patterns from deep learning model attribution scores. It identifies and clusters sequence motifs from contribution scores, maps them to DNA-binding domains, and provides comprehensive visualization tools for regulatory genomics analysis.
**TF-MINDI** is a Python package for analyzing transcription factor binding patterns from deep learning model attribution scores. It identifies and clusters sequence motifs from contribution scores, maps them to DNA-binding domains, and provides comprehensive visualization tools for regulatory genomics analysis.

<div align="center">
<img src="https://raw.githubusercontent.com/aertslab/TF-MINDI/main/docs/_static/tf_mindi_overview.png"
height=700>
</div>

## Getting Started

Expand Down Expand Up @@ -49,7 +60,7 @@ You might have to explicitly set your LD_LIBRARY_PATH for cuml as described [her

## Quick Start

TF-MInDi follows a scanpy-inspired workflow:
TF-MINDI follows a scanpy-inspired workflow:

1. **Preprocessing (`tm.pp`)**: Extract seqlets, calculate motif similarities, and create an Anndata object
2. **Tools (`tm.tl`)**: Cluster seqlets and create consensus patterns
Expand Down Expand Up @@ -114,7 +125,7 @@ If you found a bug, please use the [issue tracker](https://github.com/aertslab/T

## Citation

> t.b.a
> [De Winter S. *et al.* (2026). System-wide extraction of cis-regulatory rules from sequence-to-function models in human neural development. BioRxiv. https://doi.org/10.64898/2026.01.14.699402](https://doi.org/10.64898/2026.01.14.699402)

[uv]: https://github.com/astral-sh/uv
[issue tracker]: https://github.com/aertslab/TF-MInDi/issues
Expand Down
5 changes: 3 additions & 2 deletions biome.jsonc
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
{
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
"$schema": "https://biomejs.dev/schemas/2.2.0/schema.json",
"vcs": { "enabled": true, "clientKind": "git", "useIgnoreFile": true },
"formatter": { "useEditorconfig": true },
"overrides": [
{
"include": ["./.vscode/*.json", "**/*.jsonc"],
"includes": ["./.vscode/*.json", "**/*.jsonc"],
"json": {
"formatter": { "trailingCommas": "all" },
"parser": {
Expand Down
Binary file added docs/_static/TF-MINDI_LOGO.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_static/TF-MINDI_LOGO_nobg_notext.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_static/tf_mindi_overview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ api/io
api/datasets
api/types
api/backends
api/merge
```
12 changes: 12 additions & 0 deletions docs/api/merge.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Merge

Concatenation of TF-MInDi AnnData objects.

```{eval-rst}
.. currentmodule:: tfmindi

.. autosummary::
:toctree: ../generated

concat
```
3 changes: 3 additions & 0 deletions docs/api/plotting.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ Visualization functions for seqlet analysis and motif exploration.
pl.region_contributions
pl.dbd_logos
pl.dbd_cluster_logos
pl.pattern_logo
pl.region_topic_tsne
pl.distance_bias_profile
pl.distance_bias_heatmap
pl.render_plot
```
2 changes: 2 additions & 0 deletions docs/api/tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,7 @@ Analysis tools for clustering seqlets and pattern discovery.
tl.create_patterns
tl.run_topic_modeling
tl.evaluate_topic_models
tl.detect_distance_bias
tl.extend_biased_seqlets

```
2 changes: 2 additions & 0 deletions docs/api/types.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,6 @@ Core data types used throughout TF-MInDi.
.. autoclass:: Pattern

.. autoclass:: Seqlet

.. autoclass:: BiasDetectionResult
```
1 change: 1 addition & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@
html_theme = "sphinx_book_theme"
html_static_path = ["_static"]
html_css_files = ["css/custom.css"]
html_logo = "_static/TF-MINDI_LOGO_nobg_notext.png"

html_title = project_name

Expand Down
Loading
Loading