pyjess 0.6.0__tar.gz → 0.7.0a1__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.

Potentially problematic release.


This version of pyjess might be problematic. Click here for more details.

Files changed (135) hide show
  1. {pyjess-0.6.0 → pyjess-0.7.0a1}/.github/workflows/package.yml +7 -2
  2. {pyjess-0.6.0 → pyjess-0.7.0a1}/CHANGELOG.md +11 -1
  3. {pyjess-0.6.0 → pyjess-0.7.0a1}/PKG-INFO +1 -1
  4. {pyjess-0.6.0 → pyjess-0.7.0a1}/include/jess/jess.pxd +1 -0
  5. {pyjess-0.6.0 → pyjess-0.7.0a1}/patches/Jess.c.patch +13 -3
  6. {pyjess-0.6.0 → pyjess-0.7.0a1}/patches/Jess.h.patch +3 -2
  7. {pyjess-0.6.0 → pyjess-0.7.0a1}/patches/Main.c.patch +38 -9
  8. {pyjess-0.6.0 → pyjess-0.7.0a1}/pyproject.toml +1 -1
  9. {pyjess-0.6.0 → pyjess-0.7.0a1}/src/pyjess/_jess.pyi +2 -2
  10. {pyjess-0.6.0 → pyjess-0.7.0a1}/src/pyjess/_jess.pyx +52 -11
  11. pyjess-0.7.0a1/src/pyjess/tests/data/1sur.qry +26 -0
  12. {pyjess-0.6.0 → pyjess-0.7.0a1}/src/pyjess/tests/test_template.py +9 -1
  13. {pyjess-0.6.0 → pyjess-0.7.0a1}/.github/workflows/requirements.txt +0 -0
  14. {pyjess-0.6.0 → pyjess-0.7.0a1}/.github/workflows/test.yml +0 -0
  15. {pyjess-0.6.0 → pyjess-0.7.0a1}/.gitignore +0 -0
  16. {pyjess-0.6.0 → pyjess-0.7.0a1}/.gitmodules +0 -0
  17. {pyjess-0.6.0 → pyjess-0.7.0a1}/.readthedocs.yaml +0 -0
  18. {pyjess-0.6.0 → pyjess-0.7.0a1}/CMakeLists.txt +0 -0
  19. {pyjess-0.6.0 → pyjess-0.7.0a1}/CONTRIBUTING.md +0 -0
  20. {pyjess-0.6.0 → pyjess-0.7.0a1}/COPYING +0 -0
  21. {pyjess-0.6.0 → pyjess-0.7.0a1}/README.md +0 -0
  22. {pyjess-0.6.0 → pyjess-0.7.0a1}/docs/.gitignore +0 -0
  23. {pyjess-0.6.0 → pyjess-0.7.0a1}/docs/Makefile +0 -0
  24. {pyjess-0.6.0 → pyjess-0.7.0a1}/docs/_static/css/main.css +0 -0
  25. {pyjess-0.6.0 → pyjess-0.7.0a1}/docs/_static/js/custom-icon.js +0 -0
  26. {pyjess-0.6.0 → pyjess-0.7.0a1}/docs/_static/json/switcher.json +0 -0
  27. {pyjess-0.6.0 → pyjess-0.7.0a1}/docs/api/index.rst +0 -0
  28. {pyjess-0.6.0 → pyjess-0.7.0a1}/docs/api/jess.rst +0 -0
  29. {pyjess-0.6.0 → pyjess-0.7.0a1}/docs/api/molecule.rst +0 -0
  30. {pyjess-0.6.0 → pyjess-0.7.0a1}/docs/api/template.rst +0 -0
  31. {pyjess-0.6.0 → pyjess-0.7.0a1}/docs/conf.py +0 -0
  32. {pyjess-0.6.0 → pyjess-0.7.0a1}/docs/guide/changes.md +0 -0
  33. {pyjess-0.6.0 → pyjess-0.7.0a1}/docs/guide/contributing.md +0 -0
  34. {pyjess-0.6.0 → pyjess-0.7.0a1}/docs/guide/copyright.rst +0 -0
  35. {pyjess-0.6.0 → pyjess-0.7.0a1}/docs/guide/index.rst +0 -0
  36. {pyjess-0.6.0 → pyjess-0.7.0a1}/docs/guide/install.rst +0 -0
  37. {pyjess-0.6.0 → pyjess-0.7.0a1}/docs/guide/optimizations.rst +0 -0
  38. {pyjess-0.6.0 → pyjess-0.7.0a1}/docs/index.rst +0 -0
  39. {pyjess-0.6.0 → pyjess-0.7.0a1}/docs/make.bat +0 -0
  40. {pyjess-0.6.0 → pyjess-0.7.0a1}/docs/requirements.txt +0 -0
  41. {pyjess-0.6.0 → pyjess-0.7.0a1}/include/jess/__init__.pxd +0 -0
  42. {pyjess-0.6.0 → pyjess-0.7.0a1}/include/jess/annulus.pxd +0 -0
  43. {pyjess-0.6.0 → pyjess-0.7.0a1}/include/jess/atom.pxd +0 -0
  44. {pyjess-0.6.0 → pyjess-0.7.0a1}/include/jess/candidate_set.pxd +0 -0
  45. {pyjess-0.6.0 → pyjess-0.7.0a1}/include/jess/join.pxd +0 -0
  46. {pyjess-0.6.0 → pyjess-0.7.0a1}/include/jess/kdtree.pxd +0 -0
  47. {pyjess-0.6.0 → pyjess-0.7.0a1}/include/jess/molecule.pxd +0 -0
  48. {pyjess-0.6.0 → pyjess-0.7.0a1}/include/jess/region.pxd +0 -0
  49. {pyjess-0.6.0 → pyjess-0.7.0a1}/include/jess/res_index.pxd +0 -0
  50. {pyjess-0.6.0 → pyjess-0.7.0a1}/include/jess/scanner.pxd +0 -0
  51. {pyjess-0.6.0 → pyjess-0.7.0a1}/include/jess/super.pxd +0 -0
  52. {pyjess-0.6.0 → pyjess-0.7.0a1}/include/jess/template.pxd +0 -0
  53. {pyjess-0.6.0 → pyjess-0.7.0a1}/include/jess/tess_atom.pxd +0 -0
  54. {pyjess-0.6.0 → pyjess-0.7.0a1}/include/jess/tess_template.pxd +0 -0
  55. {pyjess-0.6.0 → pyjess-0.7.0a1}/patches/Annulus.c.patch +0 -0
  56. {pyjess-0.6.0 → pyjess-0.7.0a1}/patches/Annulus.h.patch +0 -0
  57. {pyjess-0.6.0 → pyjess-0.7.0a1}/patches/Atom.h.patch +0 -0
  58. {pyjess-0.6.0 → pyjess-0.7.0a1}/patches/Box.c.patch +0 -0
  59. {pyjess-0.6.0 → pyjess-0.7.0a1}/patches/Box.h.patch +0 -0
  60. {pyjess-0.6.0 → pyjess-0.7.0a1}/patches/CMakeLists.txt.patch +0 -0
  61. {pyjess-0.6.0 → pyjess-0.7.0a1}/patches/CandidateSet.c.patch +0 -0
  62. {pyjess-0.6.0 → pyjess-0.7.0a1}/patches/CandidateSet.h.patch +0 -0
  63. {pyjess-0.6.0 → pyjess-0.7.0a1}/patches/Join.c.patch +0 -0
  64. {pyjess-0.6.0 → pyjess-0.7.0a1}/patches/Join.h.patch +0 -0
  65. {pyjess-0.6.0 → pyjess-0.7.0a1}/patches/KdTree.c.patch +0 -0
  66. {pyjess-0.6.0 → pyjess-0.7.0a1}/patches/KdTree.h.patch +0 -0
  67. {pyjess-0.6.0 → pyjess-0.7.0a1}/patches/Molecule.c.patch +0 -0
  68. {pyjess-0.6.0 → pyjess-0.7.0a1}/patches/Molecule.h.patch +0 -0
  69. {pyjess-0.6.0 → pyjess-0.7.0a1}/patches/ResIndex.c.patch +0 -0
  70. {pyjess-0.6.0 → pyjess-0.7.0a1}/patches/ResIndex.h.patch +0 -0
  71. {pyjess-0.6.0 → pyjess-0.7.0a1}/patches/Scanner.c.patch +0 -0
  72. {pyjess-0.6.0 → pyjess-0.7.0a1}/patches/Scanner.h.patch +0 -0
  73. {pyjess-0.6.0 → pyjess-0.7.0a1}/patches/Super.c.patch +0 -0
  74. {pyjess-0.6.0 → pyjess-0.7.0a1}/patches/Template.h.patch +0 -0
  75. {pyjess-0.6.0 → pyjess-0.7.0a1}/patches/TessAtom.c.patch +0 -0
  76. {pyjess-0.6.0 → pyjess-0.7.0a1}/patches/TessAtom.h.patch +0 -0
  77. {pyjess-0.6.0 → pyjess-0.7.0a1}/patches/TessTemplate.c.patch +0 -0
  78. {pyjess-0.6.0 → pyjess-0.7.0a1}/patches/TessTemplate.h.patch +0 -0
  79. {pyjess-0.6.0 → pyjess-0.7.0a1}/patches/qselect.h.patch +0 -0
  80. {pyjess-0.6.0 → pyjess-0.7.0a1}/pkg/aur/PKGBUILD.in +0 -0
  81. {pyjess-0.6.0 → pyjess-0.7.0a1}/src/CMakeLists.txt +0 -0
  82. {pyjess-0.6.0 → pyjess-0.7.0a1}/src/jess/CMakeLists.txt +0 -0
  83. {pyjess-0.6.0 → pyjess-0.7.0a1}/src/pyjess/.gitignore +0 -0
  84. {pyjess-0.6.0 → pyjess-0.7.0a1}/src/pyjess/CMakeLists.txt +0 -0
  85. {pyjess-0.6.0 → pyjess-0.7.0a1}/src/pyjess/__init__.py +0 -0
  86. {pyjess-0.6.0 → pyjess-0.7.0a1}/src/pyjess/py.typed +0 -0
  87. {pyjess-0.6.0 → pyjess-0.7.0a1}/src/pyjess/tests/__init__.py +0 -0
  88. {pyjess-0.6.0 → pyjess-0.7.0a1}/src/pyjess/tests/data/1.3.3.tpl +0 -0
  89. {pyjess-0.6.0 → pyjess-0.7.0a1}/src/pyjess/tests/data/1AMY+1.3.3.txt +0 -0
  90. {pyjess-0.6.0 → pyjess-0.7.0a1}/src/pyjess/tests/data/1AMY.pdb +0 -0
  91. {pyjess-0.6.0 → pyjess-0.7.0a1}/src/pyjess/tests/data/__init__.py +0 -0
  92. {pyjess-0.6.0 → pyjess-0.7.0a1}/src/pyjess/tests/data/pdb1lnb.pdb +0 -0
  93. {pyjess-0.6.0 → pyjess-0.7.0a1}/src/pyjess/tests/data/template_01.qry +0 -0
  94. {pyjess-0.6.0 → pyjess-0.7.0a1}/src/pyjess/tests/data/template_02.qry +0 -0
  95. {pyjess-0.6.0 → pyjess-0.7.0a1}/src/pyjess/tests/test_atom.py +0 -0
  96. {pyjess-0.6.0 → pyjess-0.7.0a1}/src/pyjess/tests/test_hit.py +0 -0
  97. {pyjess-0.6.0 → pyjess-0.7.0a1}/src/pyjess/tests/test_jess.py +0 -0
  98. {pyjess-0.6.0 → pyjess-0.7.0a1}/src/pyjess/tests/test_molecule.py +0 -0
  99. {pyjess-0.6.0 → pyjess-0.7.0a1}/src/pyjess/tests/test_template_atom.py +0 -0
  100. {pyjess-0.6.0 → pyjess-0.7.0a1}/src/pyjess/tests/utils.py +0 -0
  101. {pyjess-0.6.0 → pyjess-0.7.0a1}/src/scripts/apply_patch.py +0 -0
  102. {pyjess-0.6.0 → pyjess-0.7.0a1}/src/scripts/cmake/CythonExtension.cmake +0 -0
  103. {pyjess-0.6.0 → pyjess-0.7.0a1}/src/scripts/cmake/pystate_patch.h +0 -0
  104. {pyjess-0.6.0 → pyjess-0.7.0a1}/src/scripts/generate_patches.py +0 -0
  105. {pyjess-0.6.0 → pyjess-0.7.0a1}/vendor/jess/.gitignore +0 -0
  106. {pyjess-0.6.0 → pyjess-0.7.0a1}/vendor/jess/README.md +0 -0
  107. {pyjess-0.6.0 → pyjess-0.7.0a1}/vendor/jess/examples/template_01.qry +0 -0
  108. {pyjess-0.6.0 → pyjess-0.7.0a1}/vendor/jess/examples/template_02.qry +0 -0
  109. {pyjess-0.6.0 → pyjess-0.7.0a1}/vendor/jess/examples/test_pdbs/pdb1lnb.ent +0 -0
  110. {pyjess-0.6.0 → pyjess-0.7.0a1}/vendor/jess/filter_output.py +0 -0
  111. {pyjess-0.6.0 → pyjess-0.7.0a1}/vendor/jess/src/Annulus.c +0 -0
  112. {pyjess-0.6.0 → pyjess-0.7.0a1}/vendor/jess/src/Annulus.h +0 -0
  113. {pyjess-0.6.0 → pyjess-0.7.0a1}/vendor/jess/src/Atom.c +0 -0
  114. {pyjess-0.6.0 → pyjess-0.7.0a1}/vendor/jess/src/Atom.h +0 -0
  115. {pyjess-0.6.0 → pyjess-0.7.0a1}/vendor/jess/src/Jess.c +0 -0
  116. {pyjess-0.6.0 → pyjess-0.7.0a1}/vendor/jess/src/Jess.h +0 -0
  117. {pyjess-0.6.0 → pyjess-0.7.0a1}/vendor/jess/src/Join.c +0 -0
  118. {pyjess-0.6.0 → pyjess-0.7.0a1}/vendor/jess/src/Join.h +0 -0
  119. {pyjess-0.6.0 → pyjess-0.7.0a1}/vendor/jess/src/KdTree.c +0 -0
  120. {pyjess-0.6.0 → pyjess-0.7.0a1}/vendor/jess/src/KdTree.h +0 -0
  121. {pyjess-0.6.0 → pyjess-0.7.0a1}/vendor/jess/src/Main.c +0 -0
  122. {pyjess-0.6.0 → pyjess-0.7.0a1}/vendor/jess/src/Molecule.c +0 -0
  123. {pyjess-0.6.0 → pyjess-0.7.0a1}/vendor/jess/src/Molecule.h +0 -0
  124. {pyjess-0.6.0 → pyjess-0.7.0a1}/vendor/jess/src/Region.c +0 -0
  125. {pyjess-0.6.0 → pyjess-0.7.0a1}/vendor/jess/src/Region.h +0 -0
  126. {pyjess-0.6.0 → pyjess-0.7.0a1}/vendor/jess/src/Scanner.c +0 -0
  127. {pyjess-0.6.0 → pyjess-0.7.0a1}/vendor/jess/src/Scanner.h +0 -0
  128. {pyjess-0.6.0 → pyjess-0.7.0a1}/vendor/jess/src/Super.c +0 -0
  129. {pyjess-0.6.0 → pyjess-0.7.0a1}/vendor/jess/src/Super.h +0 -0
  130. {pyjess-0.6.0 → pyjess-0.7.0a1}/vendor/jess/src/Template.h +0 -0
  131. {pyjess-0.6.0 → pyjess-0.7.0a1}/vendor/jess/src/TessAtom.c +0 -0
  132. {pyjess-0.6.0 → pyjess-0.7.0a1}/vendor/jess/src/TessAtom.h +0 -0
  133. {pyjess-0.6.0 → pyjess-0.7.0a1}/vendor/jess/src/TessTemplate.c +0 -0
  134. {pyjess-0.6.0 → pyjess-0.7.0a1}/vendor/jess/src/TessTemplate.h +0 -0
  135. {pyjess-0.6.0 → pyjess-0.7.0a1}/vendor/jess/src/jess +0 -0
@@ -15,6 +15,7 @@ jobs:
15
15
  with:
16
16
  submodules: true
17
17
  - name: Build manylinux wheels
18
+ if: "!contains(github.ref, 'rc') && !contains(github.ref, 'alpha')"
18
19
  uses: pypa/cibuildwheel@v2.21.3
19
20
  env:
20
21
  CIBW_ARCHS: aarch64
@@ -35,6 +36,7 @@ jobs:
35
36
  with:
36
37
  submodules: true
37
38
  - name: Build manylinux wheels
39
+ if: "!contains(github.ref, 'rc') && !contains(github.ref, 'alpha')"
38
40
  uses: pypa/cibuildwheel@v2.21.3
39
41
  env:
40
42
  CIBW_ARCHS: x86_64
@@ -55,6 +57,7 @@ jobs:
55
57
  with:
56
58
  submodules: true
57
59
  - name: Build manylinux wheels
60
+ if: "!contains(github.ref, 'rc') && !contains(github.ref, 'alpha')"
58
61
  uses: pypa/cibuildwheel@v2.21.3
59
62
  env:
60
63
  CIBW_ARCHS: x86_64
@@ -75,6 +78,7 @@ jobs:
75
78
  with:
76
79
  submodules: true
77
80
  - name: Build manylinux wheels
81
+ if: "!contains(github.ref, 'rc') && !contains(github.ref, 'alpha')"
78
82
  uses: pypa/cibuildwheel@v2.21.3
79
83
  env:
80
84
  CIBW_ARCHS: arm64
@@ -99,6 +103,7 @@ jobs:
99
103
  with:
100
104
  arch: amd64
101
105
  - name: Build manylinux wheels
106
+ if: "!contains(github.ref, 'rc') && !contains(github.ref, 'alpha')"
102
107
  uses: pypa/cibuildwheel@v2.21.3
103
108
  env:
104
109
  CIBW_ARCHS: AMD64
@@ -187,7 +192,7 @@ jobs:
187
192
  environment: GitHub Releases
188
193
  runs-on: ubuntu-latest
189
194
  permissions: write-all
190
- if: "!contains(github.ref, 'rc')"
195
+ if: "!contains(github.ref, 'rc') && !contains(github.ref, 'alpha')"
191
196
  name: Release
192
197
  needs: upload
193
198
  steps:
@@ -201,7 +206,7 @@ jobs:
201
206
  aur:
202
207
  environment: Arch User Repository
203
208
  runs-on: ubuntu-latest
204
- if: "!contains(github.ref, 'rc')"
209
+ if: "!contains(github.ref, 'rc') && !contains(github.ref, 'alpha')"
205
210
  name: Update AUR package
206
211
  needs:
207
212
  - sdist
@@ -6,7 +6,17 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
6
6
 
7
7
 
8
8
  ## [Unreleased]
9
- [Unreleased]: https://github.com/althonos/pyjess/compare/v0.6.0...HEAD
9
+ [Unreleased]: https://github.com/althonos/pyjess/compare/v0.7.0-alpha.1...HEAD
10
+
11
+
12
+ ## [v0.7.0-alpha.1] - 2025-09-02
13
+ [v0.7.0-alpha.1]: https://github.com/althonos/pyjess/compare/v0.6.0...v0.7.0-alpha.1
14
+
15
+ ### Fixed
16
+ - **breaking**: Incorrect handling of `max_candidates` in `Jess.query`, causing PyJess to erroneously ignore some templates.
17
+
18
+ ### Changed
19
+ - **breaking**: Set the `max_candidates` default value to `None` in `Jess.query`, disabling max candidates filtering by default.
10
20
 
11
21
 
12
22
  ## [v0.6.0] - 2025-09-01
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: pyjess
3
- Version: 0.6.0
3
+ Version: 0.7.0a1
4
4
  Summary: Cython bindings and Python interface to JESS, a 3D template matching software.
5
5
  Keywords: bioinformatics,structure,template,matching
6
6
  Author-Email: Martin Larralde <martin.larralde@embl.de>
@@ -22,6 +22,7 @@ cdef extern from "Jess.h" nogil:
22
22
 
23
23
  void JessQuery_free(JessQuery*)
24
24
  int JessQuery_next(JessQuery*, int)
25
+ int JessQuery_nextTemplate(JessQuery*)
25
26
  Template* JessQuery_template(JessQuery*)
26
27
  const Molecule* JessQuery_molecule(JessQuery*)
27
28
  Atom** JessQuery_atoms(JessQuery*)
@@ -1,5 +1,5 @@
1
1
  diff --git a/src/Jess.c b/src/Jess.c
2
- index e81bda0..5601c07 100644
2
+ index e81bda0..44fa672 100644
3
3
  --- a/src/Jess.c
4
4
  +++ b/src/Jess.c
5
5
  @@ -4,15 +4,18 @@
@@ -96,7 +96,7 @@ index e81bda0..5601c07 100644
96
96
 
97
97
  return Q;
98
98
  }
99
- @@ -129,74 +151,80 @@ void JessQuery_free(JessQuery *Q)
99
+ @@ -129,74 +151,90 @@ void JessQuery_free(JessQuery *Q)
100
100
  {
101
101
  Scanner_free(Q->scanner);
102
102
  Superposition_free(Q->super);
@@ -150,6 +150,16 @@ index e81bda0..5601c07 100644
150
150
 
151
151
  - return Q->super;
152
152
  + return super;
153
+ +}
154
+ +
155
+ +int JessQuery_nextTemplate(JessQuery *Q)
156
+ +{
157
+ + Q->scan=false;
158
+ + Superposition_free(Q->super);
159
+ + Q->super=NULL;
160
+ + Q->atoms=NULL;
161
+ + Q->node=Q->node->next;
162
+ + return (Q->node) ? 1 : 0;
153
163
  }
154
164
 
155
165
  int JessQuery_next(JessQuery *Q, int ignore_chain)
@@ -191,7 +201,7 @@ index e81bda0..5601c07 100644
191
201
  }
192
202
 
193
203
  if((A=Scanner_next(Q->scanner, ignore_chain)))
194
- @@ -207,8 +235,9 @@ int JessQuery_next(JessQuery *Q, int ignore_chain)
204
+ @@ -207,8 +245,9 @@ int JessQuery_next(JessQuery *Q, int ignore_chain)
195
205
  return 1;
196
206
  }
197
207
 
@@ -1,5 +1,5 @@
1
1
  diff --git a/src/Jess.h b/src/Jess.h
2
- index c90abe6..f5e3dd4 100644
2
+ index c90abe6..704b5e8 100644
3
3
  --- a/src/Jess.h
4
4
  +++ b/src/Jess.h
5
5
  @@ -8,6 +8,8 @@
@@ -27,7 +27,7 @@ index c90abe6..f5e3dd4 100644
27
27
 
28
28
  // ==================================================================
29
29
  // Methods of type JessQuery
30
- @@ -50,10 +52,10 @@ extern JessQuery *Jess_query(Jess*,Molecule*,double,double);
30
+ @@ -50,10 +52,11 @@ extern JessQuery *Jess_query(Jess*,Molecule*,double,double);
31
31
 
32
32
  extern void JessQuery_free(JessQuery*);
33
33
  extern int JessQuery_next(JessQuery*, int);
@@ -35,6 +35,7 @@ index c90abe6..f5e3dd4 100644
35
35
  -extern const Molecule *JessQuery_molecule(JessQuery*);
36
36
  -extern Atom **JessQuery_atoms(JessQuery*);
37
37
  -extern Superposition *JessQuery_superposition(JessQuery*);
38
+ +extern int JessQuery_nextTemplate(JessQuery*);
38
39
  +extern Template *JessQuery_template(const JessQuery*);
39
40
  +extern const Molecule *JessQuery_molecule(const JessQuery*);
40
41
  +extern Atom **JessQuery_atoms(const JessQuery*);
@@ -1,8 +1,16 @@
1
1
  diff --git a/src/Main.c b/src/Main.c
2
- index dff22b9..9b09cc5 100644
2
+ index dff22b9..476cb01 100644
3
3
  --- a/src/Main.c
4
4
  +++ b/src/Main.c
5
- @@ -116,7 +116,7 @@ static void output(
5
+ @@ -14,6 +14,7 @@
6
+ #include <ctype.h>
7
+ #include <errno.h>
8
+ #include <stdarg.h>
9
+ +#include <stdint.h>
10
+
11
+ // ==================================================================
12
+ // Global constants
13
+ @@ -116,11 +117,11 @@ static void output(
6
14
  A->charge
7
15
  );
8
16
  }
@@ -11,25 +19,46 @@ index dff22b9..9b09cc5 100644
11
19
  {
12
20
  Molecule *M;
13
21
  Superposition *sup;
14
- @@ -145,7 +145,7 @@ static void search(const char *filename,Jess *J,double tRmsd,double tDistance,do
22
+ - Template *T;
23
+ + Template *T, *Tprev;
24
+ Atom **A;
25
+ FILE *file;
26
+ JessQuery *Q;
27
+ @@ -145,11 +146,21 @@ static void search(const char *filename,Jess *J,double tRmsd,double tDistance,do
15
28
  return;
16
29
  }
17
30
 
18
31
  - Q=Jess_query(J,M,tDistance,max_total_threshold);
19
32
  + Q=Jess_query(J,M,tDistance,max_total_threshold,fastScan);
33
+ + T=JessQuery_template(Q);
20
34
 
21
- while(JessQuery_next(Q, ignore_chain) && killswitch<1000)
35
+ - while(JessQuery_next(Q, ignore_chain) && killswitch<1000)
36
+ + while(JessQuery_next(Q, ignore_chain))
22
37
  {
23
- @@ -193,6 +193,8 @@ static void search(const char *filename,Jess *J,double tRmsd,double tDistance,do
38
+ + Tprev=T;
39
+ T=JessQuery_template(Q);
40
+ + // printf("current template: %s\n", T->name(T));
41
+ +
42
+ + killswitch = (T!=Tprev) ? 0 : killswitch + 1;
43
+ + if(killswitch == 1000)
44
+ + {
45
+ + JessQuery_nextTemplate(Q);
46
+ + continue;
47
+ + }
48
+
49
+ count=T->count(T);
50
+ sup = JessQuery_superposition(Q);
51
+ @@ -193,7 +204,8 @@ static void search(const char *filename,Jess *J,double tRmsd,double tDistance,do
24
52
 
25
53
  printf("ENDMDL\n\n");
26
54
  }
55
+ - killswitch+=1;
27
56
  +
28
57
  + Superposition_free(sup);
29
- killswitch+=1;
30
58
  }
31
59
 
32
- @@ -339,6 +341,7 @@ int main(int argc, char **argv)
60
+ JessQuery_free(Q);
61
+ @@ -339,6 +351,7 @@ int main(int argc, char **argv)
33
62
  int ignore_chain=0;
34
63
  int write_filename=0;
35
64
  int ignore_endmdl=0;
@@ -37,7 +66,7 @@ index dff22b9..9b09cc5 100644
37
66
 
38
67
  if(argc<7 || argc>8) help();
39
68
 
40
- @@ -354,6 +357,7 @@ int main(int argc, char **argv)
69
+ @@ -354,6 +367,7 @@ int main(int argc, char **argv)
41
70
  else if(*s=='i') ignore_chain=1;
42
71
  else if(*s=='q') write_filename=1;
43
72
  else if(*s=='e') ignore_endmdl=1;
@@ -45,7 +74,7 @@ index dff22b9..9b09cc5 100644
45
74
  else help();
46
75
  }
47
76
  }
48
- @@ -388,10 +392,11 @@ int main(int argc, char **argv)
77
+ @@ -388,10 +402,11 @@ int main(int argc, char **argv)
49
78
  if(strlen(s)==0) continue;
50
79
 
51
80
  if(feedbackQ) fprintf(stderr,"%s\n",s);
@@ -4,7 +4,7 @@ build-backend = "scikit_build_core.build"
4
4
 
5
5
  [project]
6
6
  name = "pyjess"
7
- version = "0.6.0"
7
+ version = "0.7.0-alpha.1"
8
8
  description = "Cython bindings and Python interface to JESS, a 3D template matching software."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.7"
@@ -176,7 +176,7 @@ class Query(Generic[_T], Iterator[Hit[_T]]):
176
176
  @property
177
177
  def rmsd_threshold(self) -> float: ...
178
178
  @property
179
- def max_candidates(self) -> int: ...
179
+ def max_candidates(self) -> Optional[int]: ...
180
180
  @property
181
181
  def best_match(self) -> bool: ...
182
182
  def __iter__(self) -> Query[_T]: ...
@@ -218,7 +218,7 @@ class Jess(Generic[_T], Sequence[_T]):
218
218
  distance_cutoff: float,
219
219
  max_dynamic_distance: float,
220
220
  *,
221
- max_candidates: int = 1000,
221
+ max_candidates: Optional[int] = None,
222
222
  ignore_chain: bool = False,
223
223
  best_match: bool = False,
224
224
  reorder: bool = True,
@@ -22,6 +22,7 @@ from cpython.unicode cimport PyUnicode_FromStringAndSize
22
22
 
23
23
  from libc.math cimport isnan, exp, INFINITY, NAN
24
24
  from libc.stdio cimport FILE, fclose, fdopen, printf
25
+ from libc.stdint cimport uintptr_t
25
26
  from libc.stdlib cimport calloc, realloc, free, malloc
26
27
  from libc.string cimport memcpy, memset, strncpy, strdup
27
28
 
@@ -1050,7 +1051,14 @@ cdef class Template:
1050
1051
  self._tess.distance[j][i] = dist
1051
1052
 
1052
1053
  # compute dimension
1053
- residues = { self._tess.atom[i].resSeq for i in range(count) }
1054
+ residues = {
1055
+ (
1056
+ self._tess.atom[i].resSeq ,
1057
+ self._tess.atom[i].chainID1,
1058
+ self._tess.atom[i].chainID2,
1059
+ )
1060
+ for i in range(count)
1061
+ }
1054
1062
  self._tess.dim = len(residues)
1055
1063
 
1056
1064
  def __copy__(self):
@@ -1168,8 +1176,6 @@ cdef class Query:
1168
1176
  the templates.
1169
1177
  rmsd_threshold (`float`): The RMSD threshold for reporting
1170
1178
  results.
1171
- max_candidates (`int`): The maximum number of candidate hits
1172
- to report.
1173
1179
  ignore_chain (`bool`): Whether to check or ignore the chain of
1174
1180
  the atoms to match.
1175
1181
  best_match (`bool`): Whether the query will return only the
@@ -1179,18 +1185,20 @@ cdef class Query:
1179
1185
  cdef _JessQuery* _jq
1180
1186
  cdef bint _partial
1181
1187
  cdef int _candidates
1188
+ cdef uintptr_t _prev_tpl
1189
+ cdef int _max_candidates
1182
1190
 
1183
1191
  cdef readonly Jess jess
1184
1192
  cdef readonly Molecule molecule
1185
1193
  cdef readonly bint ignore_chain
1186
1194
  cdef readonly bint best_match
1187
1195
  cdef readonly double rmsd_threshold
1188
- cdef readonly int max_candidates
1189
1196
 
1190
1197
  def __cinit__(self):
1191
1198
  self._jq = NULL
1192
1199
  self._candidates = 0
1193
1200
  self._partial = False
1201
+ self._prev_tpl = 0
1194
1202
 
1195
1203
  def __dealloc__(self):
1196
1204
  jess.jess.JessQuery_free(self._jq)
@@ -1198,6 +1206,21 @@ cdef class Query:
1198
1206
  def __iter__(self):
1199
1207
  return self
1200
1208
 
1209
+ @property
1210
+ def max_candidates(self):
1211
+ """`int`: The maximum number of candidate hits to report *by template*.
1212
+ """
1213
+ return None if self._max_candidates == -1 else self._max_candidates
1214
+
1215
+ @max_candidates.setter
1216
+ def max_candidates(self, max_candidates):
1217
+ if max_candidates is None:
1218
+ self._max_candidates = -1
1219
+ elif max_candidates >= 0:
1220
+ self._max_candidates = max_candidates
1221
+ else:
1222
+ raise ValueError(f"invalid value for `max_candidates` argument: {max_candidates!r}")
1223
+
1201
1224
  cdef bint _advance(self) noexcept nogil:
1202
1225
  if self._partial:
1203
1226
  self._partial = False
@@ -1246,15 +1269,28 @@ cdef class Query:
1246
1269
 
1247
1270
  # search the next hit without the GIL to allow parallel queries.
1248
1271
  with nogil:
1249
- while self._advance() and self._candidates < self.max_candidates:
1272
+ while self._advance():
1250
1273
  # load current iteration template, and check that the hit
1251
1274
  # was obtained with the current template and not with the
1252
1275
  # previous one
1276
+ self._prev_tpl = <uintptr_t> tpl
1253
1277
  tpl = jess.jess.JessQuery_template(self._jq)
1254
1278
  if hit_found and hit_tpl != tpl:
1255
1279
  self._rewind()
1256
1280
  break
1257
1281
 
1282
+ # check if we already made it to the next template,
1283
+ # or if we need to short-circuit the iteration and
1284
+ # force the query to move to the next template as
1285
+ # we found too many candidates already.
1286
+ if <uintptr_t> tpl != self._prev_tpl:
1287
+ self._candidates = 0
1288
+ else:
1289
+ self._candidates += 1
1290
+ if self._candidates == self._max_candidates:
1291
+ jess.jess.JessQuery_nextTemplate(self._jq)
1292
+ continue
1293
+
1258
1294
  # load superposition and compute RMSD for the current iteration
1259
1295
  sup = jess.jess.JessQuery_superposition(self._jq)
1260
1296
  rmsd = jess.super.Superposition_rmsd(sup)
@@ -1288,9 +1324,9 @@ cdef class Query:
1288
1324
  hit_tpl = tpl
1289
1325
  hit_found = True
1290
1326
 
1291
- # free superposition items that are not used in a hit, and
1292
- # return hits immediately if we are not in best match mode
1293
- self._candidates += 1
1327
+ # free superposition items (as relevant data was copied in
1328
+ # the Hit if needed) and return hits immediately if we are
1329
+ # not in best match mode
1294
1330
  jess.super.Superposition_free(sup)
1295
1331
  if hit_found and not self.best_match:
1296
1332
  break
@@ -1581,7 +1617,7 @@ cdef class Jess:
1581
1617
  double distance_cutoff,
1582
1618
  double max_dynamic_distance,
1583
1619
  *,
1584
- int max_candidates = 1000,
1620
+ object max_candidates = None,
1585
1621
  bint ignore_chain = False,
1586
1622
  bint best_match = False,
1587
1623
  bint reorder = True,
@@ -1599,6 +1635,8 @@ cdef class Jess:
1599
1635
  dynamic distance after adding the global distance cutoff
1600
1636
  and the individual atom distance cutoff defined for each
1601
1637
  atom of the template.
1638
+ max_candidates (`int` or `None`): The maximum number of candidate
1639
+ hits to report *by template*.
1602
1640
  ignore_chain (`bool`): Whether to check or ignore the chain of
1603
1641
  the atoms to match.
1604
1642
  best_match (`bool`): Pass `True` to return only the best match
@@ -1607,7 +1645,7 @@ cdef class Jess:
1607
1645
  to accelerate matching in the scanner algorithm. Pass
1608
1646
  `False` to reverse to the original, slower algorithm
1609
1647
  which matches atoms in the same order as they appear in
1610
- the template, at the cost
1648
+ the template, at the cost of longer run times.
1611
1649
 
1612
1650
  Returns:
1613
1651
  `~pyjess.Query`: An iterator over the query hits.
@@ -1624,10 +1662,13 @@ cdef class Jess:
1624
1662
  .. versionadded:: 0.6.0
1625
1663
  The ``reorder`` argument, defaulting to `True`.
1626
1664
 
1665
+ .. versionchanged:: 0.7.0
1666
+ Default value of ``max_candidates`` argument to `None`.
1667
+
1627
1668
  """
1628
1669
  cdef Query query = Query.__new__(Query)
1629
- query.ignore_chain = ignore_chain
1630
1670
  query.max_candidates = max_candidates
1671
+ query.ignore_chain = ignore_chain
1631
1672
  query.rmsd_threshold = rmsd_threshold
1632
1673
  query.best_match = best_match
1633
1674
  query.molecule = molecule
@@ -0,0 +1,26 @@
1
+ REMARK TEMPLATE
2
+ REMARK CLUSTER 1_1_1
3
+ REMARK REPRESENTING 1 CATALYTIC SITES
4
+ REMARK ID 1sur_AA204-AA208-A204-A208
5
+ REMARK MCSA_ID 279
6
+ REMARK PDB_ID 1sur
7
+ REMARK UNIPROT_ID P17854
8
+ REMARK EC 1.8.4.8
9
+ REMARK ENZYME PAPS REDUCTASE
10
+ REMARK EXPERIMENTAL_METHOD X-ray diffraction
11
+ REMARK RESOLUTION 2.0
12
+ REMARK ORGANISM_NAME Escherichia coli
13
+ REMARK ORGANISM_ID 562
14
+ ATOM 0 NE1ZTRPAA 204 38.872 1.684 110.358 W 0.00
15
+ ATOM 0 CZ2ZTRPAA 204 41.345 1.476 110.794 W 0.00
16
+ ATOM 0 CH2ZTRPAA 204 42.567 1.626 110.193 W 0.00
17
+ ATOM 3 CE1ZTYRAA 208 40.509 -1.903 99.734 Y 0.00
18
+ ATOM 3 CZ ZTYRAA 208 41.503 -1.926 98.771 Y 0.00
19
+ ATOM 1 OH ZTYRAA 208 41.320 -2.643 97.607 Y 0.00
20
+ ATOM 0 NE1ZTRP A 204 43.868 1.684 54.342 W 0.00
21
+ ATOM 0 CZ2ZTRP A 204 41.395 1.476 53.906 W 0.00
22
+ ATOM 0 CH2ZTRP A 204 40.173 1.626 54.507 W 0.00
23
+ ATOM 3 CE1ZTYR A 208 42.231 -1.903 64.966 Y 0.00
24
+ ATOM 3 CZ ZTYR A 208 41.237 -1.926 65.929 Y 0.00
25
+ ATOM 1 OH ZTYR A 208 41.420 -2.643 67.093 Y 0.00
26
+ END
@@ -6,6 +6,8 @@ import textwrap
6
6
  import sys
7
7
 
8
8
  from .._jess import Template
9
+ from .utils import files
10
+ from . import data
9
11
 
10
12
  TEMPLATE = textwrap.dedent(
11
13
  """
@@ -114,4 +116,10 @@ class TestTemplate(unittest.TestCase):
114
116
  tpl1 = Template.loads(TEMPLATE, id="tpl1")
115
117
  tpl2 = pickle.loads(pickle.dumps(tpl1))
116
118
  self.assertEqual(len(tpl1), len(tpl2))
117
- self.assertEqual(tpl1, tpl2)
119
+ self.assertEqual(tpl1, tpl2)
120
+
121
+ @unittest.skipUnless(files, "importlib.resources not available")
122
+ def test_dimension_multiple_chains(self):
123
+ with files(data).joinpath("1sur.qry").open() as f:
124
+ template1 = Template.load(f)
125
+ self.assertEqual(template1.dimension, 4)
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes