pyjess 0.7.0a1__tar.gz → 0.7.0a3__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 (139) hide show
  1. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/CHANGELOG.md +24 -1
  2. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/PKG-INFO +11 -8
  3. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/README.md +8 -7
  4. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/include/jess/atom.pxd +2 -2
  5. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/include/jess/jess.pxd +2 -2
  6. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/include/jess/scanner.pxd +2 -2
  7. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/include/jess/template.pxd +6 -0
  8. pyjess-0.7.0a3/patches/Atom.c.patch +13 -0
  9. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/patches/Jess.c.patch +3 -2
  10. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/patches/Jess.h.patch +5 -3
  11. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/patches/Main.c.patch +39 -12
  12. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/patches/ResIndex.c.patch +7 -11
  13. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/patches/Scanner.c.patch +5 -3
  14. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/patches/Scanner.h.patch +3 -2
  15. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/patches/Template.h.patch +15 -5
  16. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/patches/TessAtom.c.patch +40 -12
  17. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/patches/TessAtom.h.patch +23 -6
  18. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/patches/TessTemplate.c.patch +34 -9
  19. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/patches/TessTemplate.h.patch +2 -2
  20. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/pyproject.toml +2 -1
  21. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/src/pyjess/_jess.pyi +22 -6
  22. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/src/pyjess/_jess.pyx +248 -56
  23. pyjess-0.7.0a3/src/pyjess/tests/data/1AMY.cif +6259 -0
  24. pyjess-0.7.0a3/src/pyjess/tests/data/4.1.2.tpl +23 -0
  25. pyjess-0.7.0a3/src/pyjess/tests/data/5ayx.EF.pdb +63 -0
  26. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/src/pyjess/tests/test_jess.py +62 -1
  27. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/src/pyjess/tests/test_molecule.py +30 -0
  28. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/.github/workflows/package.yml +0 -0
  29. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/.github/workflows/requirements.txt +0 -0
  30. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/.github/workflows/test.yml +0 -0
  31. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/.gitignore +0 -0
  32. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/.gitmodules +0 -0
  33. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/.readthedocs.yaml +0 -0
  34. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/CMakeLists.txt +0 -0
  35. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/CONTRIBUTING.md +0 -0
  36. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/COPYING +0 -0
  37. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/docs/.gitignore +0 -0
  38. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/docs/Makefile +0 -0
  39. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/docs/_static/css/main.css +0 -0
  40. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/docs/_static/js/custom-icon.js +0 -0
  41. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/docs/_static/json/switcher.json +0 -0
  42. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/docs/api/index.rst +0 -0
  43. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/docs/api/jess.rst +0 -0
  44. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/docs/api/molecule.rst +0 -0
  45. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/docs/api/template.rst +0 -0
  46. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/docs/conf.py +0 -0
  47. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/docs/guide/changes.md +0 -0
  48. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/docs/guide/contributing.md +0 -0
  49. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/docs/guide/copyright.rst +0 -0
  50. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/docs/guide/index.rst +0 -0
  51. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/docs/guide/install.rst +0 -0
  52. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/docs/guide/optimizations.rst +0 -0
  53. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/docs/index.rst +0 -0
  54. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/docs/make.bat +0 -0
  55. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/docs/requirements.txt +0 -0
  56. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/include/jess/__init__.pxd +0 -0
  57. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/include/jess/annulus.pxd +0 -0
  58. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/include/jess/candidate_set.pxd +0 -0
  59. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/include/jess/join.pxd +0 -0
  60. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/include/jess/kdtree.pxd +0 -0
  61. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/include/jess/molecule.pxd +0 -0
  62. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/include/jess/region.pxd +0 -0
  63. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/include/jess/res_index.pxd +0 -0
  64. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/include/jess/super.pxd +0 -0
  65. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/include/jess/tess_atom.pxd +0 -0
  66. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/include/jess/tess_template.pxd +0 -0
  67. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/patches/Annulus.c.patch +0 -0
  68. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/patches/Annulus.h.patch +0 -0
  69. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/patches/Atom.h.patch +0 -0
  70. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/patches/Box.c.patch +0 -0
  71. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/patches/Box.h.patch +0 -0
  72. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/patches/CMakeLists.txt.patch +0 -0
  73. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/patches/CandidateSet.c.patch +0 -0
  74. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/patches/CandidateSet.h.patch +0 -0
  75. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/patches/Join.c.patch +0 -0
  76. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/patches/Join.h.patch +0 -0
  77. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/patches/KdTree.c.patch +0 -0
  78. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/patches/KdTree.h.patch +0 -0
  79. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/patches/Molecule.c.patch +0 -0
  80. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/patches/Molecule.h.patch +0 -0
  81. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/patches/ResIndex.h.patch +0 -0
  82. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/patches/Super.c.patch +0 -0
  83. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/patches/qselect.h.patch +0 -0
  84. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/pkg/aur/PKGBUILD.in +0 -0
  85. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/src/CMakeLists.txt +0 -0
  86. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/src/jess/CMakeLists.txt +0 -0
  87. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/src/pyjess/.gitignore +0 -0
  88. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/src/pyjess/CMakeLists.txt +0 -0
  89. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/src/pyjess/__init__.py +0 -0
  90. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/src/pyjess/py.typed +0 -0
  91. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/src/pyjess/tests/__init__.py +0 -0
  92. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/src/pyjess/tests/data/1.3.3.tpl +0 -0
  93. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/src/pyjess/tests/data/1AMY+1.3.3.txt +0 -0
  94. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/src/pyjess/tests/data/1AMY.pdb +0 -0
  95. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/src/pyjess/tests/data/1sur.qry +0 -0
  96. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/src/pyjess/tests/data/__init__.py +0 -0
  97. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/src/pyjess/tests/data/pdb1lnb.pdb +0 -0
  98. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/src/pyjess/tests/data/template_01.qry +0 -0
  99. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/src/pyjess/tests/data/template_02.qry +0 -0
  100. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/src/pyjess/tests/test_atom.py +0 -0
  101. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/src/pyjess/tests/test_hit.py +0 -0
  102. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/src/pyjess/tests/test_template.py +0 -0
  103. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/src/pyjess/tests/test_template_atom.py +0 -0
  104. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/src/pyjess/tests/utils.py +0 -0
  105. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/src/scripts/apply_patch.py +0 -0
  106. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/src/scripts/cmake/CythonExtension.cmake +0 -0
  107. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/src/scripts/cmake/pystate_patch.h +0 -0
  108. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/src/scripts/generate_patches.py +0 -0
  109. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/vendor/jess/.gitignore +0 -0
  110. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/vendor/jess/README.md +0 -0
  111. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/vendor/jess/examples/template_01.qry +0 -0
  112. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/vendor/jess/examples/template_02.qry +0 -0
  113. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/vendor/jess/examples/test_pdbs/pdb1lnb.ent +0 -0
  114. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/vendor/jess/filter_output.py +0 -0
  115. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/vendor/jess/src/Annulus.c +0 -0
  116. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/vendor/jess/src/Annulus.h +0 -0
  117. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/vendor/jess/src/Atom.c +0 -0
  118. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/vendor/jess/src/Atom.h +0 -0
  119. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/vendor/jess/src/Jess.c +0 -0
  120. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/vendor/jess/src/Jess.h +0 -0
  121. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/vendor/jess/src/Join.c +0 -0
  122. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/vendor/jess/src/Join.h +0 -0
  123. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/vendor/jess/src/KdTree.c +0 -0
  124. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/vendor/jess/src/KdTree.h +0 -0
  125. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/vendor/jess/src/Main.c +0 -0
  126. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/vendor/jess/src/Molecule.c +0 -0
  127. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/vendor/jess/src/Molecule.h +0 -0
  128. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/vendor/jess/src/Region.c +0 -0
  129. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/vendor/jess/src/Region.h +0 -0
  130. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/vendor/jess/src/Scanner.c +0 -0
  131. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/vendor/jess/src/Scanner.h +0 -0
  132. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/vendor/jess/src/Super.c +0 -0
  133. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/vendor/jess/src/Super.h +0 -0
  134. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/vendor/jess/src/Template.h +0 -0
  135. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/vendor/jess/src/TessAtom.c +0 -0
  136. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/vendor/jess/src/TessAtom.h +0 -0
  137. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/vendor/jess/src/TessTemplate.c +0 -0
  138. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/vendor/jess/src/TessTemplate.h +0 -0
  139. {pyjess-0.7.0a1 → pyjess-0.7.0a3}/vendor/jess/src/jess +0 -0
@@ -6,7 +6,29 @@ 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.7.0-alpha.1...HEAD
9
+ [Unreleased]: https://github.com/althonos/pyjess/compare/v0.7.0-alpha.3...HEAD
10
+
11
+
12
+ ## [v0.7.0-alpha.3] - 2025-09-03
13
+ [v0.7.0-alpha.3]: https://github.com/althonos/pyjess/compare/v0.7.0-alpha.2...v0.7.0-alpha.3
14
+
15
+ ### Added
16
+ - Support for parsing `Molecule` objects from CIF files using [`gemmi`](https://gemmi.readthedocs.io/).
17
+
18
+ ### Changed
19
+ - **breaking**: Make `id` and `ignore_endmdl` arguments of `Molecule.load` and `Molecule.loads` keyword-only.
20
+ - Make `altloc` and `insertion_code` arguments of `Atom` optional.
21
+
22
+
23
+ ## [v0.7.0-alpha.2] - 2025-09-02
24
+ [v0.7.0-alpha.2]: https://github.com/althonos/pyjess/compare/v0.7.0-alpha.1...v0.7.0-alpha.2
25
+
26
+ ### Fixed
27
+ - `max_candidates` causing `Query` to stop before reaching the actual number of maximum candidates.
28
+
29
+ ### Changed
30
+ - **breaking**: Use string variants instead of `bool` to control the behaviour of `ignore_chain` argument.
31
+ - Use unrolled string comparison to compare atom names instead of `strcasecmp` in Jess code.
10
32
 
11
33
 
12
34
  ## [v0.7.0-alpha.1] - 2025-09-02
@@ -14,6 +36,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
14
36
 
15
37
  ### Fixed
16
38
  - **breaking**: Incorrect handling of `max_candidates` in `Jess.query`, causing PyJess to erroneously ignore some templates.
39
+ - `Template.dimension` reporting incorrect numbers for identical residues across different residues.
17
40
 
18
41
  ### Changed
19
42
  - **breaking**: Set the `max_candidates` default value to `None` in `Jess.query`, disabling max candidates filtering by default.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: pyjess
3
- Version: 0.7.0a1
3
+ Version: 0.7.0a3
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>
@@ -56,6 +56,8 @@ Project-URL: PiWheels, https://piwheels.org/project/pyjess/
56
56
  Requires-Python: >=3.7
57
57
  Provides-Extra: test
58
58
  Requires-Dist: importlib-resources; python_version < "3.9" and extra == "test"
59
+ Provides-Extra: cif
60
+ Requires-Dist: gemmi~=0.7.0; extra == "cif"
59
61
  Description-Content-Type: text/markdown
60
62
 
61
63
  # 🐍🔍 PyJess [![Stars](https://img.shields.io/github/stars/althonos/pyjess.svg?style=social&maxAge=3600&label=Star)](https://github.com/althonos/pyjess/stargazers)
@@ -115,7 +117,7 @@ package:
115
117
  $ conda install -c bioconda pyjess
116
118
  ```
117
119
 
118
- Check the [*install* page](https://pyjess.readthedocs.io/en/stable/install.html)
120
+ Check the [*install* page](https://pyjess.readthedocs.io/en/stable/guide/install.html)
119
121
  of the documentation for other ways to install PyJess on your machine.
120
122
 
121
123
 
@@ -183,9 +185,9 @@ If running Jess in parallel, make sure to use `v0.2.1` or later to use the code
183
185
 
184
186
  ## ⏱️ Benchmarks
185
187
 
186
- The following table reports the runtime of PyJess to match $n=132$ protein
187
- structures to the $m=7607$ templates of
188
- [EnzyMM](https://github.com/RayHackett/enzymm), using $J=12$ threads to parallelize.
188
+ The following table reports the runtime of PyJess to match N=132 protein
189
+ structures to the M=7607 templates of
190
+ [EnzyMM](https://github.com/RayHackett/enzymm), using J=12 threads to parallelize.
189
191
 
190
192
  | Version | Runtime (s) | Match Speed (N * M / s * J) | Speedup |
191
193
  | ----------- | ----------- | --------------------------- | ----------- |
@@ -193,10 +195,11 @@ structures to the $m=7607$ templates of
193
195
  | ``v0.5.0`` | 586.3 | 142.7 | x1.05 |
194
196
  | ``v0.5.1`` | 365.6 | 228.9 | x1.69 |
195
197
  | ``v0.5.2`` | 327.2 | 255.7 | x1.88 |
196
- | ``v0.6.0`` | 54.5 | 1535.4 | **x11.34** |
198
+ | ``v0.6.0`` | 54.5 | 1535.4 | x11.34 |
199
+ | ``v0.7.0`` | 52.4 | 1597.5 | **x11.80** |
197
200
 
198
- *Benchmarks were run on a quiet [i7-1255U](https://www.intel.com/content/www/us/en/products/sku/226259/intel-core-i71255u-processor-12m-cache-up-to-4-70-ghz/specifications.html) CPU running @4.70GHz with 10 physical cores / 12 logical
199
- cores.*
201
+ *Benchmarks were run on a quiet [i7-1255U](https://www.intel.com/content/www/us/en/products/sku/226259/intel-core-i71255u-processor-12m-cache-up-to-4-70-ghz/specifications.html)
202
+ CPU running @4.70GHz with 10 physical cores / 12 logical cores.*
200
203
 
201
204
  ## 💭 Feedback
202
205
 
@@ -55,7 +55,7 @@ package:
55
55
  $ conda install -c bioconda pyjess
56
56
  ```
57
57
 
58
- Check the [*install* page](https://pyjess.readthedocs.io/en/stable/install.html)
58
+ Check the [*install* page](https://pyjess.readthedocs.io/en/stable/guide/install.html)
59
59
  of the documentation for other ways to install PyJess on your machine.
60
60
 
61
61
 
@@ -123,9 +123,9 @@ If running Jess in parallel, make sure to use `v0.2.1` or later to use the code
123
123
 
124
124
  ## ⏱️ Benchmarks
125
125
 
126
- The following table reports the runtime of PyJess to match $n=132$ protein
127
- structures to the $m=7607$ templates of
128
- [EnzyMM](https://github.com/RayHackett/enzymm), using $J=12$ threads to parallelize.
126
+ The following table reports the runtime of PyJess to match N=132 protein
127
+ structures to the M=7607 templates of
128
+ [EnzyMM](https://github.com/RayHackett/enzymm), using J=12 threads to parallelize.
129
129
 
130
130
  | Version | Runtime (s) | Match Speed (N * M / s * J) | Speedup |
131
131
  | ----------- | ----------- | --------------------------- | ----------- |
@@ -133,10 +133,11 @@ structures to the $m=7607$ templates of
133
133
  | ``v0.5.0`` | 586.3 | 142.7 | x1.05 |
134
134
  | ``v0.5.1`` | 365.6 | 228.9 | x1.69 |
135
135
  | ``v0.5.2`` | 327.2 | 255.7 | x1.88 |
136
- | ``v0.6.0`` | 54.5 | 1535.4 | **x11.34** |
136
+ | ``v0.6.0`` | 54.5 | 1535.4 | x11.34 |
137
+ | ``v0.7.0`` | 52.4 | 1597.5 | **x11.80** |
137
138
 
138
- *Benchmarks were run on a quiet [i7-1255U](https://www.intel.com/content/www/us/en/products/sku/226259/intel-core-i71255u-processor-12m-cache-up-to-4-70-ghz/specifications.html) CPU running @4.70GHz with 10 physical cores / 12 logical
139
- cores.*
139
+ *Benchmarks were run on a quiet [i7-1255U](https://www.intel.com/content/www/us/en/products/sku/226259/intel-core-i71255u-processor-12m-cache-up-to-4-70-ghz/specifications.html)
140
+ CPU running @4.70GHz with 10 physical cores / 12 logical cores.*
140
141
 
141
142
  ## 💭 Feedback
142
143
 
@@ -10,8 +10,8 @@ cdef extern from "Atom.h" nogil:
10
10
  int resSeq
11
11
  char iCode
12
12
  double[3] x
13
- double occupancy
14
- double tempFactor
13
+ float occupancy
14
+ float tempFactor
15
15
  char[4] segID
16
16
  char[3] element
17
17
  int charge
@@ -1,7 +1,7 @@
1
1
  from .atom cimport Atom
2
2
  from .molecule cimport Molecule
3
3
  from .super cimport Superposition
4
- from .template cimport Template
4
+ from .template cimport Template, IgnoreType
5
5
 
6
6
 
7
7
  cdef extern from "Jess.h" nogil:
@@ -21,7 +21,7 @@ cdef extern from "Jess.h" nogil:
21
21
  JessQuery* Jess_query(Jess*, Molecule*, double, double, bint)
22
22
 
23
23
  void JessQuery_free(JessQuery*)
24
- int JessQuery_next(JessQuery*, int)
24
+ int JessQuery_next(JessQuery*, IgnoreType)
25
25
  int JessQuery_nextTemplate(JessQuery*)
26
26
  Template* JessQuery_template(JessQuery*)
27
27
  const Molecule* JessQuery_molecule(JessQuery*)
@@ -1,5 +1,5 @@
1
1
  from .molecule import Molecule
2
- from .template import Template
2
+ from .template import Template, IgnoreType
3
3
 
4
4
 
5
5
  cdef extern from "Scanner.h" nogil:
@@ -10,6 +10,6 @@ cdef extern from "Scanner.h" nogil:
10
10
 
11
11
  Scanner* Scanner_create(Molecule*, Template*, double, double)
12
12
  void Scanner_free(Scanner*)
13
- Atom** Scanner_next(Scanner*, int)
13
+ Atom** Scanner_next(Scanner*, IgnoreType)
14
14
  double Scanner_rmsd(Scanner*)
15
15
 
@@ -5,6 +5,12 @@ from .candidate_set cimport CandidateSet
5
5
  cdef extern from "Template.h" nogil:
6
6
 
7
7
  ctypedef _Template Template
8
+
9
+ ctypedef enum IgnoreType:
10
+ ignoreNone
11
+ ignoreResidues
12
+ ignoreAtoms
13
+
8
14
  cdef struct _Template:
9
15
  void (*free)(Template*) nogil
10
16
  int (*count)(const Template*) nogil
@@ -0,0 +1,13 @@
1
+ diff --git a/src/Atom.c b/src/Atom.c
2
+ index ab602d7..6285beb 100644
3
+ --- a/src/Atom.c
4
+ +++ b/src/Atom.c
5
+ @@ -25,7 +25,7 @@ static void Atom_copyToken(char *d,const char *s,int n)
6
+ d[n]=0;
7
+ for(i=0; i<n; i++)
8
+ {
9
+ - if(isspace(d[i])) d[i]='_';
10
+ + if(isspace(d[i]) || !d[i]) d[i]='_';
11
+ }
12
+ }
13
+
@@ -1,5 +1,5 @@
1
1
  diff --git a/src/Jess.c b/src/Jess.c
2
- index e81bda0..44fa672 100644
2
+ index e81bda0..a0929cd 100644
3
3
  --- a/src/Jess.c
4
4
  +++ b/src/Jess.c
5
5
  @@ -4,15 +4,18 @@
@@ -162,7 +162,8 @@ index e81bda0..44fa672 100644
162
162
  + return (Q->node) ? 1 : 0;
163
163
  }
164
164
 
165
- int JessQuery_next(JessQuery *Q, int ignore_chain)
165
+ -int JessQuery_next(JessQuery *Q, int ignore_chain)
166
+ +int JessQuery_next(JessQuery *Q, IgnoreType ignore_chain)
166
167
  {
167
168
  Template *T;
168
169
  Atom **A;
@@ -1,5 +1,5 @@
1
1
  diff --git a/src/Jess.h b/src/Jess.h
2
- index c90abe6..704b5e8 100644
2
+ index c90abe6..4361958 100644
3
3
  --- a/src/Jess.h
4
4
  +++ b/src/Jess.h
5
5
  @@ -8,6 +8,8 @@
@@ -27,14 +27,16 @@ index c90abe6..704b5e8 100644
27
27
 
28
28
  // ==================================================================
29
29
  // Methods of type JessQuery
30
- @@ -50,10 +52,11 @@ extern JessQuery *Jess_query(Jess*,Molecule*,double,double);
30
+ @@ -49,11 +51,12 @@ extern JessQuery *Jess_query(Jess*,Molecule*,double,double);
31
+ // ==================================================================
31
32
 
32
33
  extern void JessQuery_free(JessQuery*);
33
- extern int JessQuery_next(JessQuery*, int);
34
+ -extern int JessQuery_next(JessQuery*, int);
34
35
  -extern Template *JessQuery_template(JessQuery*);
35
36
  -extern const Molecule *JessQuery_molecule(JessQuery*);
36
37
  -extern Atom **JessQuery_atoms(JessQuery*);
37
38
  -extern Superposition *JessQuery_superposition(JessQuery*);
39
+ +extern int JessQuery_next(JessQuery*, IgnoreType);
38
40
  +extern int JessQuery_nextTemplate(JessQuery*);
39
41
  +extern Template *JessQuery_template(const JessQuery*);
40
42
  +extern const Molecule *JessQuery_molecule(const JessQuery*);
@@ -1,5 +1,5 @@
1
1
  diff --git a/src/Main.c b/src/Main.c
2
- index dff22b9..476cb01 100644
2
+ index dff22b9..5baeb17 100644
3
3
  --- a/src/Main.c
4
4
  +++ b/src/Main.c
5
5
  @@ -14,6 +14,7 @@
@@ -10,12 +10,21 @@ index dff22b9..476cb01 100644
10
10
 
11
11
  // ==================================================================
12
12
  // Global constants
13
- @@ -116,11 +117,11 @@ static void output(
13
+ @@ -21,6 +22,8 @@
14
+ // atomFormat The format of a PDB ATOM record (for printf)
15
+ // ==================================================================
16
+
17
+ +#define MAX_CANDIDATES -1
18
+ +
19
+ static const char *atomFormat =
20
+ "ATOM %5i%5s%c%-3s%c%c%4i%-4c%8.3f%8.3f%8.3f%6.2f%6.2f\n"; //Riziotis edit
21
+ //"ATOM %5i%5s%c%-3s%c%c%4i%-4c%8.3f%8.3f%8.3f\n"; //Riziotis edit
22
+ @@ -116,11 +119,11 @@ static void output(
14
23
  A->charge
15
24
  );
16
25
  }
17
26
  -static void search(const char *filename,Jess *J,double tRmsd,double tDistance,double max_total_threshold,int no_transform,int ignore_chain,int write_filename,int ignore_endmdl, float conservation_cutoff)
18
- +static void search(const char *filename,Jess *J,double tRmsd,double tDistance,double max_total_threshold,int no_transform,int ignore_chain,int write_filename,int ignore_endmdl, float conservation_cutoff, bool fastScan)
27
+ +static void search(const char *filename,Jess *J,double tRmsd,double tDistance,double max_total_threshold,int no_transform,IgnoreType ignore_chain,int write_filename,int ignore_endmdl, float conservation_cutoff, bool fastScan)
19
28
  {
20
29
  Molecule *M;
21
30
  Superposition *sup;
@@ -24,7 +33,16 @@ index dff22b9..476cb01 100644
24
33
  Atom **A;
25
34
  FILE *file;
26
35
  JessQuery *Q;
27
- @@ -145,11 +146,21 @@ static void search(const char *filename,Jess *J,double tRmsd,double tDistance,do
36
+ @@ -128,7 +131,7 @@ static void search(const char *filename,Jess *J,double tRmsd,double tDistance,do
37
+ const double *P,*c[2];
38
+ double det;
39
+ double logE;
40
+ - int killswitch = 0;
41
+ + int candidates = 0;
42
+
43
+ if(!(file=fopen(filename,"r")))
44
+ {
45
+ @@ -145,11 +148,21 @@ static void search(const char *filename,Jess *J,double tRmsd,double tDistance,do
28
46
  return;
29
47
  }
30
48
 
@@ -39,8 +57,8 @@ index dff22b9..476cb01 100644
39
57
  T=JessQuery_template(Q);
40
58
  + // printf("current template: %s\n", T->name(T));
41
59
  +
42
- + killswitch = (T!=Tprev) ? 0 : killswitch + 1;
43
- + if(killswitch == 1000)
60
+ + candidates = (T!=Tprev) ? 0 : candidates + 1;
61
+ + if(candidates == MAX_CANDIDATES)
44
62
  + {
45
63
  + JessQuery_nextTemplate(Q);
46
64
  + continue;
@@ -48,7 +66,7 @@ index dff22b9..476cb01 100644
48
66
 
49
67
  count=T->count(T);
50
68
  sup = JessQuery_superposition(Q);
51
- @@ -193,7 +204,8 @@ static void search(const char *filename,Jess *J,double tRmsd,double tDistance,do
69
+ @@ -193,7 +206,8 @@ static void search(const char *filename,Jess *J,double tRmsd,double tDistance,do
52
70
 
53
71
  printf("ENDMDL\n\n");
54
72
  }
@@ -58,23 +76,32 @@ index dff22b9..476cb01 100644
58
76
  }
59
77
 
60
78
  JessQuery_free(Q);
61
- @@ -339,6 +351,7 @@ int main(int argc, char **argv)
62
- int ignore_chain=0;
79
+ @@ -336,9 +350,10 @@ int main(int argc, char **argv)
80
+ int count;
81
+ //Riziotis edit
82
+ int no_transform=0;
83
+ - int ignore_chain=0;
84
+ + IgnoreType ignore_chain=ignoreNone;
63
85
  int write_filename=0;
64
86
  int ignore_endmdl=0;
65
87
  + int fastScan=0;
66
88
 
67
89
  if(argc<7 || argc>8) help();
68
90
 
69
- @@ -354,6 +367,7 @@ int main(int argc, char **argv)
70
- else if(*s=='i') ignore_chain=1;
91
+ @@ -351,9 +366,11 @@ int main(int argc, char **argv)
92
+ if(*s=='f') feedbackQ=1;
93
+ //Riziotis edit
94
+ else if(*s=='n') no_transform=1;
95
+ - else if(*s=='i') ignore_chain=1;
96
+ + else if(*s=='i') ignore_chain=ignoreAtoms;
97
+ + else if(*s=='I') ignore_chain=ignoreResidues;
71
98
  else if(*s=='q') write_filename=1;
72
99
  else if(*s=='e') ignore_endmdl=1;
73
100
  + else if(*s=='s') fastScan=1;
74
101
  else help();
75
102
  }
76
103
  }
77
- @@ -388,10 +402,11 @@ int main(int argc, char **argv)
104
+ @@ -388,10 +405,11 @@ int main(int argc, char **argv)
78
105
  if(strlen(s)==0) continue;
79
106
 
80
107
  if(feedbackQ) fprintf(stderr,"%s\n",s);
@@ -1,9 +1,9 @@
1
1
  diff --git a/src/ResIndex.c b/src/ResIndex.c
2
2
  new file mode 100644
3
- index 0000000..0010445
3
+ index 0000000..ed907f4
4
4
  --- /dev/null
5
5
  +++ b/src/ResIndex.c
6
- @@ -0,0 +1,167 @@
6
+ @@ -0,0 +1,163 @@
7
7
  +// ==================================================================
8
8
  +// HashMap.h
9
9
  +// Copyright (c) Martin Larralde, 2025
@@ -18,18 +18,14 @@ index 0000000..0010445
18
18
  +#include <stdio.h>
19
19
  +
20
20
  +#include "Atom.h"
21
+ +#include "TessAtom.h"
21
22
  +#include "ResIndex.h"
22
23
  +
23
- +#ifdef _MSC_VER
24
- +#define strncasecmp _strnicmp
25
- +#define strcasecmp _stricmp
26
- +#endif
27
- +
28
24
  +static int ResNames_compare(const void *pa, const void *pb)
29
25
  +{
30
26
  + const Atom *a = **((const Atom***)pa);
31
27
  + const Atom *b = **((const Atom***)pb);
32
- + int result = strncasecmp(&a->resName[0], &b->resName[0], 4);
28
+ + int result = TessAtom_compareName(&a->resName[0], &b->resName[0]);
33
29
  + if (result != 0)
34
30
  + return result;
35
31
  + return a->serial - b->serial;
@@ -75,7 +71,7 @@ index 0000000..0010445
75
71
  +
76
72
  + numRes = 1;
77
73
  + for (i = 1; i < n; i++)
78
- + numRes += (strncasecmp((*tmp[i-1])->resName, (*tmp[i])->resName, 4) != 0);
74
+ + numRes += (TessAtom_compareName((*tmp[i-1])->resName, (*tmp[i])->resName) != 0);
79
75
  +
80
76
  + // Allocate data for residues
81
77
  +
@@ -100,7 +96,7 @@ index 0000000..0010445
100
96
  +
101
97
  + for (i = 1, j = 4, k = 1; i < n; i++) {
102
98
  +
103
- + if (strncasecmp((*tmp[i-1])->resName, (*tmp[i])->resName, 4) != 0) {
99
+ + if (TessAtom_compareName((*tmp[i-1])->resName, (*tmp[i])->resName) != 0) {
104
100
  + memcpy(names, (*tmp[i])->resName, 4*sizeof(char));
105
101
  + names += 4;
106
102
  +
@@ -133,7 +129,7 @@ index 0000000..0010445
133
129
  +
134
130
  + while (start < end) {
135
131
  + mid = (start + end) / 2;
136
- + cmp = strncasecmp(&I->names[4*mid], resName, 4);
132
+ + cmp = TessAtom_compareName(&I->names[4*mid], resName);
137
133
  + if(cmp < 0) {
138
134
  + start = (mid == start) ? mid + 1 : mid;
139
135
  + } else if (cmp > 0) {
@@ -1,5 +1,5 @@
1
1
  diff --git a/src/Scanner.c b/src/Scanner.c
2
- index 19a35a7..d796132 100644
2
+ index 19a35a7..2d0e528 100644
3
3
  --- a/src/Scanner.c
4
4
  +++ b/src/Scanner.c
5
5
  @@ -5,41 +5,37 @@
@@ -201,7 +201,7 @@ index 19a35a7..d796132 100644
201
201
  }
202
202
 
203
203
  return S;
204
- @@ -119,26 +184,8 @@ Scanner *Scanner_create(Molecule *M, Template *T,double r, double s)
204
+ @@ -119,36 +184,16 @@ Scanner *Scanner_create(Molecule *M, Template *T,double r, double s)
205
205
 
206
206
  void Scanner_free(Scanner *S)
207
207
  {
@@ -228,7 +228,9 @@ index 19a35a7..d796132 100644
228
228
  free(S);
229
229
  }
230
230
  }
231
- @@ -147,8 +194,6 @@ Atom **Scanner_next(Scanner *S, int ignore_chain)
231
+
232
+ -Atom **Scanner_next(Scanner *S, int ignore_chain)
233
+ +Atom **Scanner_next(Scanner *S, IgnoreType ignore_chain)
232
234
  {
233
235
  int j,k;
234
236
  double min,max;
@@ -1,5 +1,5 @@
1
1
  diff --git a/src/Scanner.h b/src/Scanner.h
2
- index d775ce7..e049f40 100644
2
+ index d775ce7..8a83fbc 100644
3
3
  --- a/src/Scanner.h
4
4
  +++ b/src/Scanner.h
5
5
  @@ -11,27 +11,43 @@
@@ -31,7 +31,8 @@ index d775ce7..e049f40 100644
31
31
  +extern Scanner *Scanner_create(Molecule*,Template*,ScannerData*,double,double,bool);
32
32
  +extern Scanner *Scanner_reuse(Scanner*,Molecule*,Template*,ScannerData*,double,double,bool);
33
33
  extern void Scanner_free(Scanner*);
34
- extern Atom **Scanner_next(Scanner*, int);
34
+ -extern Atom **Scanner_next(Scanner*, int);
35
+ +extern Atom **Scanner_next(Scanner*, IgnoreType);
35
36
  extern double Scanner_rmsd(Scanner*);
36
37
 
37
38
  +// ==================================================================
@@ -1,8 +1,8 @@
1
1
  diff --git a/src/Template.h b/src/Template.h
2
- index 13f68f1..21e12c8 100644
2
+ index 13f68f1..8cb0ee7 100644
3
3
  --- a/src/Template.h
4
4
  +++ b/src/Template.h
5
- @@ -9,6 +9,7 @@
5
+ @@ -9,14 +9,17 @@
6
6
  #define TEMPLATE_H
7
7
 
8
8
  #include "Atom.h"
@@ -10,7 +10,17 @@ index 13f68f1..21e12c8 100644
10
10
 
11
11
  // ==================================================================
12
12
  // Forward declarations
13
- @@ -26,6 +27,7 @@ typedef struct _Template Template;
13
+ // ==================================================================
14
+ // Template The template interface
15
+ +// IgnoreChainType The type of ignore_chain in check
16
+ // ==================================================================
17
+
18
+ typedef struct _Template Template;
19
+ +typedef enum { ignoreNone,ignoreResidues,ignoreAtoms } IgnoreType;
20
+
21
+ // ==================================================================
22
+ // type Template
23
+ @@ -26,6 +29,7 @@ typedef struct _Template Template;
14
24
  // match(T,k,A) True if A matches atom k of T
15
25
  // range(T,i,j,a,b) [*a,*b] <- range of |atom i - atom j|
16
26
  // check(T,A,k,ignore_chain) Check n-ary rules on atom k-1 and 0,...,k-2
@@ -18,12 +28,12 @@ index 13f68f1..21e12c8 100644
18
28
  // position(T,i) Position of atom i (example position)
19
29
  // name(T) Returns the symbolic name for the template
20
30
  // logE(T,x,n) Provide an estimate of logE for a hit
21
- @@ -37,11 +39,13 @@ struct _Template
31
+ @@ -37,11 +41,13 @@ struct _Template
22
32
  int (*count)(const Template*);
23
33
  int (*match)(const Template*,int,const Atom*);
24
34
  int (*range)(const Template*,int,int,double*,double*);
25
35
  - int (*check)(const Template*,Atom**,int,int);
26
- + int (*check)(const Template*,Atom**,int*,int,int);
36
+ + int (*check)(const Template*,Atom**,int*,int,IgnoreType);
27
37
  + void (*candidates)(const Template*, const Molecule*, int, CandidateSet**);
28
38
  const double *(*position)(const Template*,int);
29
39
  const char *(*name)(const Template*);
@@ -1,8 +1,8 @@
1
1
  diff --git a/src/TessAtom.c b/src/TessAtom.c
2
- index e1cce1a..324347d 100644
2
+ index e1cce1a..9ba021e 100644
3
3
  --- a/src/TessAtom.c
4
4
  +++ b/src/TessAtom.c
5
- @@ -7,39 +7,17 @@
5
+ @@ -7,40 +7,13 @@
6
6
 
7
7
  #include "TessAtom.h"
8
8
  #include "Atom.h"
@@ -41,14 +41,11 @@ index e1cce1a..324347d 100644
41
41
  - double pos[3];
42
42
  - double distWeight;
43
43
  -};
44
- +#ifdef _MSC_VER
45
- +#define strncasecmp _strnicmp
46
- +#define strcasecmp _stricmp
47
- +#endif
48
-
44
+ -
49
45
  // ==================================================================
50
46
  // Methods of type TessAtom (ARGGH!!!)
51
- @@ -91,7 +69,7 @@ TessAtom *TessAtom_create(const char *s)
47
+ // ==================================================================
48
+ @@ -91,7 +64,7 @@ TessAtom *TessAtom_create(const char *s)
52
49
  int rq;
53
50
  const char *q;
54
51
  const char *tmp;
@@ -57,7 +54,7 @@ index e1cce1a..324347d 100644
57
54
 
58
55
 
59
56
  // 0. Parse the record as a standard PDB atom. We must
60
- @@ -157,8 +135,8 @@ TessAtom *TessAtom_create(const char *s)
57
+ @@ -157,8 +130,8 @@ TessAtom *TessAtom_create(const char *s)
61
58
  // Set up all the pointers to the
62
59
  // residue name and atom name fields
63
60
 
@@ -68,7 +65,7 @@ index e1cce1a..324347d 100644
68
65
  p+=sizeof(char*)*ac;
69
66
  for(m=0; m<ac; m++)
70
67
  {
71
- @@ -166,7 +144,7 @@ TessAtom *TessAtom_create(const char *s)
68
+ @@ -166,7 +139,7 @@ TessAtom *TessAtom_create(const char *s)
72
69
  p+=5;
73
70
  }
74
71
 
@@ -77,7 +74,7 @@ index e1cce1a..324347d 100644
77
74
  p+=sizeof(char*)*rc;
78
75
  for(m=0; m<rc; m++)
79
76
  {
80
- @@ -259,41 +237,7 @@ TessAtom *TessAtom_create(const char *s)
77
+ @@ -259,41 +232,7 @@ TessAtom *TessAtom_create(const char *s)
81
78
  }
82
79
 
83
80
  //Riziotis edit
@@ -119,7 +116,38 @@ index e1cce1a..324347d 100644
119
116
  static int TessAtom_isCarbon(const Atom *A)
120
117
  {
121
118
  return A->name[0]=='_' && A->name[1]=='C' ? 1:0;
122
- @@ -507,5 +451,65 @@ int TessAtom_match(const TessAtom *T, const Atom *A)
119
+ @@ -327,9 +266,9 @@ static int TessAtom_isInSamePosition(const TessAtom *T, const Atom *A)
120
+
121
+ static int TessAtom_isMainChain(const Atom *A)
122
+ {
123
+ - if(strcasecmp(A->name,"_CA_")==0) return 1;
124
+ - if(strcasecmp(A->name,"_N__")==0) return 1;
125
+ - if(strcasecmp(A->name,"_O__")==0) return 1;
126
+ + if(TessAtom_compareName(A->name,"_CA_")==0) return 1;
127
+ + if(TessAtom_compareName(A->name,"_N__")==0) return 1;
128
+ + if(TessAtom_compareName(A->name,"_O__")==0) return 1;
129
+
130
+ return 0;
131
+ }
132
+ @@ -340,7 +279,7 @@ static int TessAtom_matchName(const TessAtom *T, const Atom *A)
133
+
134
+ for(k=0; k<T->nameCount; k++)
135
+ {
136
+ - if(strcasecmp(A->name,T->name[k])==0) return 1;
137
+ + if(TessAtom_compareName(A->name,T->name[k])==0) return 1;
138
+ }
139
+
140
+ return 0;
141
+ @@ -352,7 +291,7 @@ static int TessAtom_matchResName(const TessAtom *T, const Atom *A)
142
+
143
+ for(k=0; k<T->resNameCount; k++)
144
+ {
145
+ - if(strcasecmp(A->resName,T->resName[k])==0) return 1;
146
+ + if(TessAtom_compareName(A->resName,T->resName[k])==0) return 1;
147
+ }
148
+
149
+ return 0;
150
+ @@ -507,5 +446,65 @@ int TessAtom_match(const TessAtom *T, const Atom *A)
123
151
  }
124
152
  }
125
153
 
@@ -1,5 +1,5 @@
1
1
  diff --git a/src/TessAtom.h b/src/TessAtom.h
2
- index 6480d8b..648f55f 100644
2
+ index 6480d8b..8ec3618 100644
3
3
  --- a/src/TessAtom.h
4
4
  +++ b/src/TessAtom.h
5
5
  @@ -9,6 +9,7 @@
@@ -46,12 +46,16 @@ index 6480d8b..648f55f 100644
46
46
  // ==================================================================
47
47
  // Methods of type TessAtom
48
48
  // ==================================================================
49
- @@ -30,16 +60,62 @@ typedef struct _TessAtom TessAtom;
49
+ @@ -30,16 +60,79 @@ typedef struct _TessAtom TessAtom;
50
50
  // ==================================================================
51
51
 
52
52
  extern TessAtom *TessAtom_create(const char*);
53
53
  -extern void TessAtom_free(TessAtom*);
54
54
  -extern const double *TessAtom_position(const TessAtom*);
55
+ +extern TessAtom* TessAtom_copy(const TessAtom*);
56
+ extern int TessAtom_match(const TessAtom*,const Atom*);
57
+ -extern int TessAtom_resSeq(const TessAtom*);
58
+ +extern double TessAtom_distance(const TessAtom*, const TessAtom*);
55
59
  +
56
60
  +static inline void TessAtom_free(TessAtom *A)
57
61
  +{
@@ -63,8 +67,22 @@ index 6480d8b..648f55f 100644
63
67
  + return A->pos;
64
68
  +}
65
69
  +
66
- extern int TessAtom_match(const TessAtom*,const Atom*);
67
- -extern int TessAtom_resSeq(const TessAtom*);
70
+ +#ifndef TessAtom_toupper
71
+ +#define TessAtom_toupper(c) ((( c >= 'a' ) && (c <= 'z')) ? c & (~0x20) : c);
72
+ +#endif
73
+ +
74
+ +static int TessAtom_compareName(const char* restrict a, const char* restrict b)
75
+ +{
76
+ + for(int i=0; i<4;i++)
77
+ + {
78
+ + char ca = TessAtom_toupper(a[i]);
79
+ + char cb = TessAtom_toupper(b[i]);
80
+ + int cmp = ca - cb;
81
+ + if(cmp != 0) return cmp;
82
+ + }
83
+ + return 0;
84
+ +}
85
+ +
68
86
  +
69
87
  +static inline int TessAtom_resSeq(const TessAtom *A)
70
88
  +{
@@ -109,8 +127,7 @@ index 6480d8b..648f55f 100644
109
127
  + return A->code;
110
128
  +}
111
129
  +
112
- +extern TessAtom* TessAtom_copy(const TessAtom*);
113
- +extern double TessAtom_distance(const TessAtom*, const TessAtom*);
130
+ +
114
131
  +
115
132
  // ==================================================================
116
133