acellera-kartograf 2.0.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.
- acellera_kartograf-2.0.0/.coveragerc +14 -0
- acellera_kartograf-2.0.0/.git-blame-ignore-revs +4 -0
- acellera_kartograf-2.0.0/.github/ISSUE_TEMPLATE/bug_report.md +38 -0
- acellera_kartograf-2.0.0/.github/ISSUE_TEMPLATE/feature_request.md +20 -0
- acellera_kartograf-2.0.0/.github/PULL_REQUEST_TEMPLATE/release_template.md +13 -0
- acellera_kartograf-2.0.0/.github/dependabot.yml +6 -0
- acellera_kartograf-2.0.0/.github/pull_request_template.md +20 -0
- acellera_kartograf-2.0.0/.github/workflows/check_for_api_break.yaml +77 -0
- acellera_kartograf-2.0.0/.github/workflows/ci.yaml +127 -0
- acellera_kartograf-2.0.0/.gitignore +101 -0
- acellera_kartograf-2.0.0/.pre-commit-config.yaml +47 -0
- acellera_kartograf-2.0.0/CITATION.cff +30 -0
- acellera_kartograf-2.0.0/LICENSE +21 -0
- acellera_kartograf-2.0.0/PKG-INFO +126 -0
- acellera_kartograf-2.0.0/README.md +108 -0
- acellera_kartograf-2.0.0/conftest.py +10 -0
- acellera_kartograf-2.0.0/devtools/pypi-pkg/README.md +3 -0
- acellera_kartograf-2.0.0/devtools/pypi-pkg/kartograf/__init__.py +3 -0
- acellera_kartograf-2.0.0/devtools/pypi-pkg/pyproject.toml +27 -0
- acellera_kartograf-2.0.0/docs/CHANGELOG.rst +70 -0
- acellera_kartograf-2.0.0/docs/Makefile +20 -0
- acellera_kartograf-2.0.0/docs/_static/.gitkeep +0 -0
- acellera_kartograf-2.0.0/docs/_static/img/Kartograf_mapping_approach.png +0 -0
- acellera_kartograf-2.0.0/docs/_static/img/RHFE_cycle.png +0 -0
- acellera_kartograf-2.0.0/docs/_static/img/Topology_types.png +0 -0
- acellera_kartograf-2.0.0/docs/_static/img/alignment_benz_ol.png +0 -0
- acellera_kartograf-2.0.0/docs/_static/img/fused_ring_filtered.png +0 -0
- acellera_kartograf-2.0.0/docs/_static/img/fused_ring_partial.png +0 -0
- acellera_kartograf-2.0.0/docs/_static/img/kartograf_homepage_QR_dark.png +0 -0
- acellera_kartograf-2.0.0/docs/_static/img/kartograf_homepage_QR_light.png +0 -0
- acellera_kartograf-2.0.0/docs/_static/img/logo/Kartograf_logo_boxed_dark.ico +0 -0
- acellera_kartograf-2.0.0/docs/_static/img/logo/Kartograf_logo_boxed_dark.png +0 -0
- acellera_kartograf-2.0.0/docs/_static/img/logo/Kartograf_logo_boxed_dark_transp.png +0 -0
- acellera_kartograf-2.0.0/docs/_static/img/logo/Kartograf_logo_boxed_light.png +0 -0
- acellera_kartograf-2.0.0/docs/_static/img/logo/Kartograf_logo_boxed_light_transp.png +0 -0
- acellera_kartograf-2.0.0/docs/_static/img/logo/Kartograf_logo_light_transp.png +0 -0
- acellera_kartograf-2.0.0/docs/_static/img/logo/Squaredcircle.svg +21 -0
- acellera_kartograf-2.0.0/docs/_static/img/logo/kartograf_logo_fancy_dark.png +0 -0
- acellera_kartograf-2.0.0/docs/_static/img/logo/kartograf_logo_fancy_light.png +0 -0
- acellera_kartograf-2.0.0/docs/_static/img/mappings_visualization_tool.png +0 -0
- acellera_kartograf-2.0.0/docs/_static/img/reindexing_problem_vis.png +0 -0
- acellera_kartograf-2.0.0/docs/api/kartograf.aligners.rst +8 -0
- acellera_kartograf-2.0.0/docs/api/kartograf.filters.rst +20 -0
- acellera_kartograf-2.0.0/docs/api/kartograf.mappers.rst +8 -0
- acellera_kartograf-2.0.0/docs/api/kartograf.metrics.rst +36 -0
- acellera_kartograf-2.0.0/docs/api/kartograf.scorers.rst +8 -0
- acellera_kartograf-2.0.0/docs/api/kartograf.utils.rst +11 -0
- acellera_kartograf-2.0.0/docs/api.rst +14 -0
- acellera_kartograf-2.0.0/docs/conf.py +96 -0
- acellera_kartograf-2.0.0/docs/environment.yml +25 -0
- acellera_kartograf-2.0.0/docs/guide/application_free_energies_system_representations.rst +27 -0
- acellera_kartograf-2.0.0/docs/guide/application_reindexing_problem.rst +16 -0
- acellera_kartograf-2.0.0/docs/guide/atom_mapping.rst +38 -0
- acellera_kartograf-2.0.0/docs/guide/atom_mapping_scoring.rst +34 -0
- acellera_kartograf-2.0.0/docs/guide/molecule_alignment.rst +50 -0
- acellera_kartograf-2.0.0/docs/guide.rst +18 -0
- acellera_kartograf-2.0.0/docs/index.rst +29 -0
- acellera_kartograf-2.0.0/docs/install.rst +32 -0
- acellera_kartograf-2.0.0/docs/make.bat +35 -0
- acellera_kartograf-2.0.0/docs/requirements.txt +3 -0
- acellera_kartograf-2.0.0/docs/showcase.nblink +3 -0
- acellera_kartograf-2.0.0/docs/tutorial/comparing_mappings.rst +27 -0
- acellera_kartograf-2.0.0/docs/tutorial/custom_filters.rst +57 -0
- acellera_kartograf-2.0.0/docs/tutorial/fused_rings.rst +59 -0
- acellera_kartograf-2.0.0/docs/tutorial/mapping_tutorial.rst +81 -0
- acellera_kartograf-2.0.0/docs/tutorial/visualization_widget.rst +17 -0
- acellera_kartograf-2.0.0/docs/tutorial.rst +12 -0
- acellera_kartograf-2.0.0/environment.yml +34 -0
- acellera_kartograf-2.0.0/examples/README.md +16 -0
- acellera_kartograf-2.0.0/examples/benzenes.tar.gz +0 -0
- acellera_kartograf-2.0.0/examples/kartograf_example.ipynb +378 -0
- acellera_kartograf-2.0.0/news/TEMPLATE.rst +23 -0
- acellera_kartograf-2.0.0/pyproject.toml +83 -0
- acellera_kartograf-2.0.0/readthedocs.yaml +25 -0
- acellera_kartograf-2.0.0/rever.xsh +7 -0
- acellera_kartograf-2.0.0/setup.cfg +4 -0
- acellera_kartograf-2.0.0/src/acellera_kartograf.egg-info/PKG-INFO +126 -0
- acellera_kartograf-2.0.0/src/acellera_kartograf.egg-info/SOURCES.txt +110 -0
- acellera_kartograf-2.0.0/src/acellera_kartograf.egg-info/dependency_links.txt +1 -0
- acellera_kartograf-2.0.0/src/acellera_kartograf.egg-info/top_level.txt +1 -0
- acellera_kartograf-2.0.0/src/kartograf/__init__.py +13 -0
- acellera_kartograf-2.0.0/src/kartograf/atom_aligner.py +180 -0
- acellera_kartograf-2.0.0/src/kartograf/atom_mapper.py +899 -0
- acellera_kartograf-2.0.0/src/kartograf/filters/__init__.py +13 -0
- acellera_kartograf-2.0.0/src/kartograf/filters/bond_changes.py +64 -0
- acellera_kartograf-2.0.0/src/kartograf/filters/element_change.py +56 -0
- acellera_kartograf-2.0.0/src/kartograf/filters/ring_changes.py +215 -0
- acellera_kartograf-2.0.0/src/kartograf/mapping_metrics/__init__.py +12 -0
- acellera_kartograf-2.0.0/src/kartograf/mapping_metrics/_abstract_scorer.py +38 -0
- acellera_kartograf-2.0.0/src/kartograf/mapping_metrics/metric_mapping_rmsd.py +107 -0
- acellera_kartograf-2.0.0/src/kartograf/mapping_metrics/metric_shape_difference.py +270 -0
- acellera_kartograf-2.0.0/src/kartograf/mapping_metrics/metric_volume_ratio.py +104 -0
- acellera_kartograf-2.0.0/src/kartograf/mapping_metrics/metrics_mapping_comparisons.py +34 -0
- acellera_kartograf-2.0.0/src/kartograf/tests/__init__.py +2 -0
- acellera_kartograf-2.0.0/src/kartograf/tests/conftest.py +156 -0
- acellera_kartograf-2.0.0/src/kartograf/tests/data/2wtk_mutated_with_extra_mols.pdb +15810 -0
- acellera_kartograf-2.0.0/src/kartograf/tests/data/2wtk_trimer_with_extra_mols.pdb +15799 -0
- acellera_kartograf-2.0.0/src/kartograf/tests/data/__init__.py +0 -0
- acellera_kartograf-2.0.0/src/kartograf/tests/data/biaryl-indene.sdf +70 -0
- acellera_kartograf-2.0.0/src/kartograf/tests/data/biphenyl.sdf +55 -0
- acellera_kartograf-2.0.0/src/kartograf/tests/data/lig_E29.sdf +241 -0
- acellera_kartograf-2.0.0/src/kartograf/tests/data/lig_E6.sdf +234 -0
- acellera_kartograf-2.0.0/src/kartograf/tests/data/pfkfb3_ligands.sdf +5468 -0
- acellera_kartograf-2.0.0/src/kartograf/tests/test_atom_align.py +21 -0
- acellera_kartograf-2.0.0/src/kartograf/tests/test_atom_mapper.py +636 -0
- acellera_kartograf-2.0.0/src/kartograf/tests/test_atom_mapping_comparer.py +79 -0
- acellera_kartograf-2.0.0/src/kartograf/tests/test_atom_mapping_scorer.py +129 -0
- acellera_kartograf-2.0.0/src/kartograf/tests/test_element_filters.py +58 -0
- acellera_kartograf-2.0.0/src/kartograf/tests/test_ring_filters.py +130 -0
- acellera_kartograf-2.0.0/src/kartograf/utils/__init__.py +0 -0
- acellera_kartograf-2.0.0/src/kartograf/utils/optional_imports.py +44 -0
- acellera_kartograf-2.0.0/tools/fmt_rst_codeblocks.py +91 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Bug report
|
|
3
|
+
about: Create a report to help us improve
|
|
4
|
+
title: ''
|
|
5
|
+
labels: ''
|
|
6
|
+
assignees: ''
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
**Describe the bug**
|
|
11
|
+
A clear and concise description of what the bug is.
|
|
12
|
+
|
|
13
|
+
**To Reproduce**
|
|
14
|
+
Steps to reproduce the behavior:
|
|
15
|
+
1. Go to '...'
|
|
16
|
+
2. Click on '....'
|
|
17
|
+
3. Scroll down to '....'
|
|
18
|
+
4. See error
|
|
19
|
+
|
|
20
|
+
**Expected behavior**
|
|
21
|
+
A clear and concise description of what you expected to happen.
|
|
22
|
+
|
|
23
|
+
**Screenshots**
|
|
24
|
+
If applicable, add screenshots to help explain your problem.
|
|
25
|
+
|
|
26
|
+
**Desktop (please complete the following information):**
|
|
27
|
+
- OS: [e.g. iOS]
|
|
28
|
+
- Browser [e.g. chrome, safari]
|
|
29
|
+
- Version [e.g. 22]
|
|
30
|
+
|
|
31
|
+
**Smartphone (please complete the following information):**
|
|
32
|
+
- Device: [e.g. iPhone6]
|
|
33
|
+
- OS: [e.g. iOS8.1]
|
|
34
|
+
- Browser [e.g. stock browser, safari]
|
|
35
|
+
- Version [e.g. 22]
|
|
36
|
+
|
|
37
|
+
**Additional context**
|
|
38
|
+
Add any other context about the problem here.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Feature request
|
|
3
|
+
about: Suggest an idea for this project
|
|
4
|
+
title: ''
|
|
5
|
+
labels: ''
|
|
6
|
+
assignees: ''
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
**Is your feature request related to a problem? Please describe.**
|
|
11
|
+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
|
12
|
+
|
|
13
|
+
**Describe the solution you'd like**
|
|
14
|
+
A clear and concise description of what you want to happen.
|
|
15
|
+
|
|
16
|
+
**Describe alternatives you've considered**
|
|
17
|
+
A clear and concise description of any alternative solutions or features you've considered.
|
|
18
|
+
|
|
19
|
+
**Additional context**
|
|
20
|
+
Add any other context or screenshots about the feature request here.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
Checklist for releasing a new version of kartograf.
|
|
3
|
+
-->
|
|
4
|
+
|
|
5
|
+
Make the PR:
|
|
6
|
+
* [ ] Create a new release-prep branch corresponding to the version name, e.g. `release-prep-v1.2.0`. Note: please follow [semantic versioning](https://semver.org/).
|
|
7
|
+
* [ ] Check that all user-relevant updates are included in the `news/` rever `.rst` files. You can backfill any additional items by making a new .rst, e.g. `backfill.rst`
|
|
8
|
+
* [ ] Run [rever](https://regro.github.io/rever-docs/index.html#), e.g. `rever 1.2.0`. This will auto-commit `docs/CHANGELOG.md` and remove the `.rst` files from `news/`.
|
|
9
|
+
* [ ] Verify that`docs/CHANGELOG.md` looks correct.
|
|
10
|
+
* [ ] Make the PR and verify that CI/CD passes.
|
|
11
|
+
* [ ] Merge the PR into `main`.
|
|
12
|
+
|
|
13
|
+
After Merging the PR [follow this guide](https://github.com/OpenFreeEnergy/openfe/wiki/How-to-create-a-new-release)
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
Thank you for pull request.
|
|
3
|
+
Below are a few things we ask you kindly to self-check before getting a review. Remove checks that are not relevant.
|
|
4
|
+
-->
|
|
5
|
+
|
|
6
|
+
<!--
|
|
7
|
+
Please note any issues this fixes using [closing keywords]( https://help.github.com/articles/closing-issues-using-keywords/ ):
|
|
8
|
+
-->
|
|
9
|
+
|
|
10
|
+
<!--
|
|
11
|
+
see https://regro.github.io/rever-docs/news.html for details on how to add news entry (you do not need to run the rever command)
|
|
12
|
+
-->
|
|
13
|
+
|
|
14
|
+
Checklist
|
|
15
|
+
* [ ] All new code is appropriately documented (user-facing code _must_ have complete docstrings).
|
|
16
|
+
* [ ] Added a ``news`` entry, or the changes are not user-facing.
|
|
17
|
+
* [ ] Ran pre-commit: you can run [pre-commit](https://pre-commit.com) locally or comment on this PR with `pre-commit.ci autofix`.
|
|
18
|
+
|
|
19
|
+
## Developers certificate of origin
|
|
20
|
+
- [ ] I certify that this contribution is covered by the MIT License [here](https://github.com/OpenFreeEnergy/kartograf/blob/main/LICENSE) and the **Developer Certificate of Origin** at <https://developercertificate.org/>.
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
name: Check for API breaks
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request_target:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
check:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
permissions:
|
|
12
|
+
pull-requests: write
|
|
13
|
+
|
|
14
|
+
steps:
|
|
15
|
+
- uses: actions/checkout@v6
|
|
16
|
+
with:
|
|
17
|
+
fetch-depth: 0
|
|
18
|
+
|
|
19
|
+
- run: git fetch --depth=1 --tags
|
|
20
|
+
|
|
21
|
+
- uses: actions/setup-python@v6
|
|
22
|
+
with:
|
|
23
|
+
python-version: "3.13"
|
|
24
|
+
|
|
25
|
+
- name: Check for API breaks
|
|
26
|
+
continue-on-error: true
|
|
27
|
+
id: check
|
|
28
|
+
run: |
|
|
29
|
+
pip install griffe
|
|
30
|
+
griffe check -s src/ "kartograf" --verbose -a origin/main
|
|
31
|
+
|
|
32
|
+
- name: Manage PR Comments
|
|
33
|
+
uses: actions/github-script@v9
|
|
34
|
+
with:
|
|
35
|
+
script: |
|
|
36
|
+
const prNumber = context.payload.pull_request.number;
|
|
37
|
+
const identifier = '<!-- api-break-check -->';
|
|
38
|
+
const runUrl = `${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}`;
|
|
39
|
+
const stepUrl = `${runUrl}#step:check`;
|
|
40
|
+
|
|
41
|
+
// Determine the outcome of the check step
|
|
42
|
+
const checkStepOutcome = '${{ steps.check.outcome }}';
|
|
43
|
+
|
|
44
|
+
// List existing comments
|
|
45
|
+
const { data: comments } = await github.rest.issues.listComments({
|
|
46
|
+
owner: context.repo.owner,
|
|
47
|
+
repo: context.repo.repo,
|
|
48
|
+
issue_number: prNumber,
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
// Delete previous comments from this action
|
|
52
|
+
for (const comment of comments) {
|
|
53
|
+
if (comment.body.includes(identifier)) {
|
|
54
|
+
await github.rest.issues.deleteComment({
|
|
55
|
+
owner: context.repo.owner,
|
|
56
|
+
repo: context.repo.repo,
|
|
57
|
+
comment_id: comment.id,
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// Post a new comment only if the check step failed
|
|
63
|
+
if (checkStepOutcome === 'failure') {
|
|
64
|
+
await github.rest.issues.createComment({
|
|
65
|
+
owner: context.repo.owner,
|
|
66
|
+
repo: context.repo.repo,
|
|
67
|
+
issue_number: prNumber,
|
|
68
|
+
body: `${identifier}\n🚨 API breaking changes detected! 🚨\n[View logs for this step](${stepUrl})`
|
|
69
|
+
});
|
|
70
|
+
} else {
|
|
71
|
+
await github.rest.issues.createComment({
|
|
72
|
+
owner: context.repo.owner,
|
|
73
|
+
repo: context.repo.repo,
|
|
74
|
+
issue_number: prNumber,
|
|
75
|
+
body: `${identifier}\nNo API break detected ✅`
|
|
76
|
+
});
|
|
77
|
+
}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
name: "CI"
|
|
2
|
+
on:
|
|
3
|
+
workflow_dispatch:
|
|
4
|
+
pull_request:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
push:
|
|
8
|
+
branches:
|
|
9
|
+
- main
|
|
10
|
+
schedule:
|
|
11
|
+
# At 07:00 UTC
|
|
12
|
+
- cron: "0 7 * * *"
|
|
13
|
+
|
|
14
|
+
concurrency:
|
|
15
|
+
group: "${{ github.workflow }}-${{ github.ref }}"
|
|
16
|
+
cancel-in-progress: true
|
|
17
|
+
|
|
18
|
+
defaults:
|
|
19
|
+
run:
|
|
20
|
+
shell: bash -leo pipefail {0}
|
|
21
|
+
|
|
22
|
+
jobs:
|
|
23
|
+
tests:
|
|
24
|
+
runs-on: ${{ matrix.OS }}-latest
|
|
25
|
+
name: "tests"
|
|
26
|
+
strategy:
|
|
27
|
+
fail-fast: false
|
|
28
|
+
matrix:
|
|
29
|
+
os: ['ubuntu',]
|
|
30
|
+
python-version:
|
|
31
|
+
- "3.11"
|
|
32
|
+
- "3.12"
|
|
33
|
+
- "3.13"
|
|
34
|
+
include:
|
|
35
|
+
- os: 'macos'
|
|
36
|
+
python-version: "3.13"
|
|
37
|
+
|
|
38
|
+
steps:
|
|
39
|
+
- uses: actions/checkout@v6
|
|
40
|
+
- name: Get current date
|
|
41
|
+
id: date
|
|
42
|
+
run: echo "date=$(date +%Y-%m-%d)" >> "${GITHUB_OUTPUT}"
|
|
43
|
+
- uses: mamba-org/setup-micromamba@v3
|
|
44
|
+
with:
|
|
45
|
+
environment-file: environment.yml
|
|
46
|
+
environment-name: kartograf
|
|
47
|
+
cache-environment: true
|
|
48
|
+
cache-downloads: true
|
|
49
|
+
cache-environment-key: environment-${{ steps.date.outputs.date }}
|
|
50
|
+
cache-downloads-key: downloads-${{ steps.date.outputs.date }}
|
|
51
|
+
create-args: >-
|
|
52
|
+
python=${{ matrix.python-version }}
|
|
53
|
+
|
|
54
|
+
- name: "Install"
|
|
55
|
+
run: pip install --no-deps -e .
|
|
56
|
+
|
|
57
|
+
- name: "Test imports"
|
|
58
|
+
run: |
|
|
59
|
+
# if we add more to this, consider changing to for + env vars
|
|
60
|
+
python -Ic "import kartograf"
|
|
61
|
+
|
|
62
|
+
- name: "Environment Information"
|
|
63
|
+
run: |
|
|
64
|
+
micromamba info
|
|
65
|
+
micromamba list
|
|
66
|
+
|
|
67
|
+
- name: "Print Version"
|
|
68
|
+
run: python -c "import kartograf; print(kartograf.__version__)"
|
|
69
|
+
|
|
70
|
+
- name: "Run tests"
|
|
71
|
+
run: |
|
|
72
|
+
# run tests
|
|
73
|
+
pytest -n auto -v --cov=kartograf --cov-report=xml
|
|
74
|
+
|
|
75
|
+
- name: "Test Notebooks"
|
|
76
|
+
if: ${{ matrix.os != 'macos' }}
|
|
77
|
+
run: |
|
|
78
|
+
# Only need to test the notebook(s) in examples/
|
|
79
|
+
pytest -v --nbval-lax examples/
|
|
80
|
+
|
|
81
|
+
- name: codecov
|
|
82
|
+
if: ${{ github.repository == 'OpenFreeEnergy/kartograf' && github.event_name != 'schedule'}}
|
|
83
|
+
uses: codecov/codecov-action@v6
|
|
84
|
+
with:
|
|
85
|
+
token: ${{ secrets.CODECOV_TOKEN }}
|
|
86
|
+
fail_ci_if_error: true
|
|
87
|
+
verbose: true
|
|
88
|
+
|
|
89
|
+
check_packaging:
|
|
90
|
+
runs-on: ubuntu-latest
|
|
91
|
+
timeout-minutes: 30
|
|
92
|
+
|
|
93
|
+
steps:
|
|
94
|
+
- uses: actions/checkout@v6
|
|
95
|
+
|
|
96
|
+
- uses: mamba-org/setup-micromamba@v3
|
|
97
|
+
with:
|
|
98
|
+
environment-file: environment.yml
|
|
99
|
+
environment-name: kartograf
|
|
100
|
+
create-args: >-
|
|
101
|
+
python=3.13
|
|
102
|
+
|
|
103
|
+
- name: install_deps
|
|
104
|
+
run: |
|
|
105
|
+
python -m pip install -U pip pipx wheel build
|
|
106
|
+
|
|
107
|
+
- name: build_package_sdist
|
|
108
|
+
run: pipx run build --sdist
|
|
109
|
+
|
|
110
|
+
- name: check_package_build
|
|
111
|
+
run: |
|
|
112
|
+
DISTRIBUTION=$(ls -t1 dist/kartograf-*.tar.gz | head -n1)
|
|
113
|
+
test -n "${DISTRIBUTION}" || { echo "no distribution dist/kartograf-*.tar.gz found"; exit 1; }
|
|
114
|
+
|
|
115
|
+
- name: install sdist
|
|
116
|
+
working-directory: ./dist
|
|
117
|
+
run: |
|
|
118
|
+
ls -a .
|
|
119
|
+
python -m pip install kartograf-*.tar.gz
|
|
120
|
+
du -sh kartograf-*.tar.gz
|
|
121
|
+
|
|
122
|
+
- name: check install
|
|
123
|
+
run: pip list
|
|
124
|
+
|
|
125
|
+
- name: run tests
|
|
126
|
+
working-directory: ./dist
|
|
127
|
+
run: python -m pytest -n logical --pyargs kartograf
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
|
|
6
|
+
# Distribution / packaging
|
|
7
|
+
.Python
|
|
8
|
+
build/
|
|
9
|
+
develop-eggs/
|
|
10
|
+
dist/
|
|
11
|
+
downloads/
|
|
12
|
+
eggs/
|
|
13
|
+
.eggs/
|
|
14
|
+
lib/
|
|
15
|
+
lib64/
|
|
16
|
+
parts/
|
|
17
|
+
sdist/
|
|
18
|
+
var/
|
|
19
|
+
wheels/
|
|
20
|
+
pip-wheel-metadata/
|
|
21
|
+
share/python-wheels/
|
|
22
|
+
*.egg-info/
|
|
23
|
+
.installed.cfg
|
|
24
|
+
*.egg
|
|
25
|
+
MANIFEST
|
|
26
|
+
/src/pdbinf.egg-info/
|
|
27
|
+
|
|
28
|
+
# PyInstaller
|
|
29
|
+
# Usually these files are written by a python script from a template
|
|
30
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
31
|
+
*.manifest
|
|
32
|
+
*.spec
|
|
33
|
+
|
|
34
|
+
# Installer logs
|
|
35
|
+
pip-log.txt
|
|
36
|
+
pip-delete-this-directory.txt
|
|
37
|
+
|
|
38
|
+
# Unit test / coverage reports
|
|
39
|
+
htmlcov/
|
|
40
|
+
.tox/
|
|
41
|
+
.nox/
|
|
42
|
+
.coverage
|
|
43
|
+
.coverage.*
|
|
44
|
+
.cache
|
|
45
|
+
nosetests.xml
|
|
46
|
+
coverage.xml
|
|
47
|
+
*.cover
|
|
48
|
+
*.py,cover
|
|
49
|
+
.hypothesis/
|
|
50
|
+
.pytest_cache/
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
# Sphinx documentation
|
|
54
|
+
docs/_build/
|
|
55
|
+
|
|
56
|
+
# PyBuilder
|
|
57
|
+
target/
|
|
58
|
+
|
|
59
|
+
# Jupyter Notebook
|
|
60
|
+
.ipynb_checkpoints
|
|
61
|
+
|
|
62
|
+
# IPython
|
|
63
|
+
profile_default/
|
|
64
|
+
ipython_config.py
|
|
65
|
+
|
|
66
|
+
# pyenv
|
|
67
|
+
.python-version
|
|
68
|
+
|
|
69
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
|
|
70
|
+
__pypackages__/
|
|
71
|
+
|
|
72
|
+
# Celery stuff
|
|
73
|
+
celerybeat-schedule
|
|
74
|
+
celerybeat.pid
|
|
75
|
+
|
|
76
|
+
# Environments
|
|
77
|
+
.env
|
|
78
|
+
.venv
|
|
79
|
+
env/
|
|
80
|
+
venv/
|
|
81
|
+
ENV/
|
|
82
|
+
env.bak/
|
|
83
|
+
venv.bak/
|
|
84
|
+
|
|
85
|
+
# mypy
|
|
86
|
+
.mypy_cache/
|
|
87
|
+
.dmypy.json
|
|
88
|
+
dmypy.json
|
|
89
|
+
|
|
90
|
+
# Pyre type checker
|
|
91
|
+
.pyre/
|
|
92
|
+
|
|
93
|
+
# don't check in version
|
|
94
|
+
src/kartograf/_version.py
|
|
95
|
+
|
|
96
|
+
#IDE
|
|
97
|
+
.idea
|
|
98
|
+
/src/kartograf/dev/
|
|
99
|
+
|
|
100
|
+
# Rever
|
|
101
|
+
rever/
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# See https://pre-commit.com for more information
|
|
2
|
+
# See https://pre-commit.com/hooks.html for more hooks
|
|
3
|
+
|
|
4
|
+
# comment / label "pre-commit.ci autofix" to a pull request to manually trigger auto-fixing
|
|
5
|
+
ci:
|
|
6
|
+
autofix_prs: false
|
|
7
|
+
autoupdate_schedule: monthly
|
|
8
|
+
repos:
|
|
9
|
+
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
10
|
+
rev: v6.0.0
|
|
11
|
+
hooks:
|
|
12
|
+
- id: trailing-whitespace
|
|
13
|
+
exclude: '\.(pdb|gro|top|sdf|xml|cif|graphml)$'
|
|
14
|
+
- id: check-added-large-files
|
|
15
|
+
args: ["--maxkb=4000"]
|
|
16
|
+
- id: check-case-conflict
|
|
17
|
+
- id: check-symlinks
|
|
18
|
+
- id: check-toml
|
|
19
|
+
- id: check-yaml
|
|
20
|
+
- id: debug-statements
|
|
21
|
+
- id: destroyed-symlinks
|
|
22
|
+
- id: end-of-file-fixer
|
|
23
|
+
exclude: '\.(graphml)$'
|
|
24
|
+
|
|
25
|
+
- repo: https://github.com/tox-dev/pyproject-fmt
|
|
26
|
+
rev: "v2.21.1"
|
|
27
|
+
hooks:
|
|
28
|
+
- id: pyproject-fmt
|
|
29
|
+
args: [--max-supported-python=3.14]
|
|
30
|
+
|
|
31
|
+
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
32
|
+
rev: v0.15.12
|
|
33
|
+
hooks:
|
|
34
|
+
# Run the linter.
|
|
35
|
+
- id: ruff
|
|
36
|
+
args: [--fix ]
|
|
37
|
+
# Run the formatter.
|
|
38
|
+
- id: ruff-format
|
|
39
|
+
|
|
40
|
+
- repo: local
|
|
41
|
+
hooks:
|
|
42
|
+
- id: fmt-rst-codeblocks
|
|
43
|
+
name: Format Python code blocks in RST files
|
|
44
|
+
entry: python tools/fmt_rst_codeblocks.py
|
|
45
|
+
language: python
|
|
46
|
+
files: \.rst$
|
|
47
|
+
additional_dependencies: [ruff]
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
cff-version: 1.2.0
|
|
2
|
+
message: "If you use this software, please cite it as below."
|
|
3
|
+
authors:
|
|
4
|
+
- family-names: "Ries"
|
|
5
|
+
given-names: "Benjamin"
|
|
6
|
+
orcid: "https://orcid.org/0000-0002-0945-8304"
|
|
7
|
+
- family-names: "Alibay"
|
|
8
|
+
given-names: "Irfan"
|
|
9
|
+
orcid: "https://orcid.org/0000-0001-5787-9130"
|
|
10
|
+
- family-names: "Swenson"
|
|
11
|
+
given-names: "David W.H."
|
|
12
|
+
orcid: "https://orcid.org/0000-0001-9922-7923"
|
|
13
|
+
- family-names: "Baumann"
|
|
14
|
+
given-names: "Hannah M."
|
|
15
|
+
orcid: "https://orcid.org/0000-0002-1736-7744"
|
|
16
|
+
- family-names: "Henry"
|
|
17
|
+
given-names: "Michael M."
|
|
18
|
+
orcid: "https://orcid.org/0000-0002-3870-9993"
|
|
19
|
+
- family-names: "Eastwood"
|
|
20
|
+
given-names: "James R. B."
|
|
21
|
+
orcid: "https://orcid.org/0000-0003-3895-5227"
|
|
22
|
+
- family-names: "Gowers"
|
|
23
|
+
given-names: "Richard J."
|
|
24
|
+
orcid: "https://orcid.org/0000-0002-3241-1846"
|
|
25
|
+
title: "Kartograf: A Geometrically Accurate Atom Mapper for Hybrid-Topology Relative Free Energy Calculations"
|
|
26
|
+
version: 1.0
|
|
27
|
+
date-released: 2024-02-08
|
|
28
|
+
url: "https://openfree.energy/"
|
|
29
|
+
repository-code: "https://github.com/OpenFreeEnergy/kartograf"
|
|
30
|
+
doi: 10.1021/acs.jctc.3c01206
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023 Open Free Energy
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: acellera-kartograf
|
|
3
|
+
Version: 2.0.0
|
|
4
|
+
Summary: Kartograf is a package for geometrically mapping atoms of two molecules.
|
|
5
|
+
Author-email: The OpenFE developers <openfe@omsf.io>
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/OpenFreeEnergy/kartograf
|
|
8
|
+
Classifier: Operating System :: OS Independent
|
|
9
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
10
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
14
|
+
Requires-Python: >=3.10
|
|
15
|
+
Description-Content-Type: text/markdown
|
|
16
|
+
License-File: LICENSE
|
|
17
|
+
Dynamic: license-file
|
|
18
|
+
|
|
19
|
+
<p align="center">
|
|
20
|
+
<picture align="center">
|
|
21
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://github.com/OpenFreeEnergy/kartograf/blob/0a2ecb10f1c5ede3842fd9b92ffb232ad726426f/docs/_static/img/kartograf_logo_style5.png">
|
|
22
|
+
<source media="(prefers-color-scheme: light)" srcset="https://github.com/OpenFreeEnergy/kartograf/blob/0a2ecb10f1c5ede3842fd9b92ffb232ad726426f/docs/_static/img/kartograf_logo_style4.png">
|
|
23
|
+
<img alt="Kartografs fancy logo" src="https://github.com/OpenFreeEnergy/kartograf/blob/0a2ecb10f1c5ede3842fd9b92ffb232ad726426f/docs/_static/img/kartograf_logo_style4.png" width=35% >
|
|
24
|
+
</picture>
|
|
25
|
+
</p>
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
Kartograf: A Geometry-Based Atom Mapper
|
|
29
|
+
==================================
|
|
30
|
+
|
|
31
|
+
[//]: # (Badges)
|
|
32
|
+
[](https://openfree.energy/)
|
|
33
|
+
[](https://github.com/OpenFreeEnergy/kartograf/actions/workflows/ci.yaml)
|
|
34
|
+
[](https://codecov.io/gh/OpenFreeEnergy/kartograf)
|
|
35
|
+
[](https://kartograf.readthedocs.io/en/latest/?badge=latest)
|
|
36
|
+
[](https://doi.org/10.5281/zenodo.10566716)
|
|
37
|
+
[](https://anaconda.org/conda-forge/kartograf)
|
|
38
|
+
|
|
39
|
+
Kartograf is a package for atom mappings focussing on 3D geometries.
|
|
40
|
+
This package can be for example be used to generate hybrid topology systems, where an atom mapping is required to determine the core region of the approach.
|
|
41
|
+
But of course there exist also other use cases for this package.
|
|
42
|
+
The atom mapper takes two set of coordinates of molecules as input.
|
|
43
|
+
Optionally those set of coordinates can be aligned onto each other, checkout the `atom_aligner` module functions
|
|
44
|
+
of Kartograf that offer a shape alignment implementation and a MCS-skeleton alignment.
|
|
45
|
+
The `atom_mapper` can be used to generate the 3D geometry focused atom mapping, the algorithm is described in the related publication of Kartograf (see reference).
|
|
46
|
+
Additionally, rule based filter functions can be provided to demap atoms, that do not fulfill the desired criteria, see `filters`.
|
|
47
|
+
Several mapping scoring metrics are provided, that evaluate geometric properties of your mapping, from `mapping_metrics`, which might be useful for checking quality of your mappings.
|
|
48
|
+
|
|
49
|
+
Checkout our article on Kartograf in the Journal of Chemical Theory and Computation: [*Kartograf: A Geometrically Accurate Atom Mapper for Hybrid-Topology Relative Free Energy Calculations* - Benjamin Ries*, Irfan Alibay, David W. H. Swenson, Hannah M. Baumann, Michael M. Henry, James R. B. Eastwood, and Richard J. Gowers](https://doi.org/10.1021/acs.jctc.3c01206).
|
|
50
|
+
|
|
51
|
+
You can find a preprint on [ChemRxiv](https://doi.org/10.26434/chemrxiv-2023-0n1pq).
|
|
52
|
+
|
|
53
|
+
## Usage
|
|
54
|
+
|
|
55
|
+
```python3
|
|
56
|
+
from rdkit import Chem
|
|
57
|
+
from kartograf.atom_aligner import align_mol_shape
|
|
58
|
+
from kartograf.mapping_metrics import MappingRMSDScorer
|
|
59
|
+
from kartograf import KartografAtomMapper, SmallMoleculeComponent
|
|
60
|
+
|
|
61
|
+
# Preprocessing from Smiles - Here you can add your Input!
|
|
62
|
+
# Generate Data: START
|
|
63
|
+
smiles = ["c1ccccc1", "c1ccccc1(CO)"]
|
|
64
|
+
rdmols = [Chem.MolFromSmiles(s) for s in smiles]
|
|
65
|
+
rdmols = [Chem.AddHs(m, addCoords=True) for m in rdmols]
|
|
66
|
+
[Chem.rdDistGeom.EmbedMolecule(m, useRandomCoords=False, randomSeed = 0) for m in rdmols]
|
|
67
|
+
# Generate Data: END
|
|
68
|
+
|
|
69
|
+
# Build Small Molecule Components
|
|
70
|
+
molA, molB = [SmallMoleculeComponent.from_rdkit(m) for m in rdmols]
|
|
71
|
+
|
|
72
|
+
# Align the mols first - this might not needed, depends on input.
|
|
73
|
+
a_molB = align_mol_shape(molB, ref_mol=molA)
|
|
74
|
+
|
|
75
|
+
# Build Kartograf Atom Mapper
|
|
76
|
+
mapper = KartografAtomMapper(atom_map_hydrogens=True)
|
|
77
|
+
|
|
78
|
+
# Get Mapping
|
|
79
|
+
kartograf_mapping = next(mapper.suggest_mappings(molA, a_molB))
|
|
80
|
+
|
|
81
|
+
# Score Mapping
|
|
82
|
+
rmsd_scorer = MappingRMSDScorer()
|
|
83
|
+
score = rmsd_scorer(mapping=kartograf_mapping)
|
|
84
|
+
print(f"RMSD Score: {score}")
|
|
85
|
+
|
|
86
|
+
kartograf_mapping
|
|
87
|
+
```
|
|
88
|
+

|
|
89
|
+
|
|
90
|
+
## Installation
|
|
91
|
+
|
|
92
|
+
### Latest release
|
|
93
|
+
Kartograf can be installed via the package following package managers:
|
|
94
|
+
|
|
95
|
+
#### `conda` (conda-forge)
|
|
96
|
+
|
|
97
|
+
```shell
|
|
98
|
+
conda install -c conda-forge kartograf
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
Kartograf can be used via the OpenFE environment like:
|
|
102
|
+
|
|
103
|
+
```python
|
|
104
|
+
from openfe.setup.atom_mapping import kartograf
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### Development version
|
|
108
|
+
The developing setup of Kartograf works like this:
|
|
109
|
+
|
|
110
|
+
```shell
|
|
111
|
+
git clone https://github.com/OpenFreeEnergy/kartograf.git
|
|
112
|
+
|
|
113
|
+
cd kartograf
|
|
114
|
+
mamba env create -f environment.yml
|
|
115
|
+
|
|
116
|
+
mamba activate kartograf
|
|
117
|
+
pip install -e .
|
|
118
|
+
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
## License
|
|
122
|
+
This library is made available under the MIT open source license.
|
|
123
|
+
|
|
124
|
+
## Authors
|
|
125
|
+
|
|
126
|
+
The OpenFE development team.
|