pyjess 0.5.0__cp312-cp312-macosx_10_13_x86_64.whl → 0.5.1__cp312-cp312-macosx_10_13_x86_64.whl

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.
Binary file
pyjess/_jess.pyx CHANGED
@@ -31,6 +31,7 @@ cimport jess.molecule
31
31
  cimport jess.super
32
32
  cimport jess.tess_template
33
33
  cimport jess.tess_atom
34
+ cimport jess.res_index
34
35
  from jess.atom cimport Atom as _Atom
35
36
  from jess.jess cimport Jess as _Jess
36
37
  from jess.jess cimport JessQuery as _JessQuery
@@ -172,6 +173,7 @@ cdef class Molecule:
172
173
  if self._mol is NULL:
173
174
  raise MemoryError("Failed to allocate molecule")
174
175
 
176
+ self._mol.index = NULL
175
177
  self._mol.count = count
176
178
  for i in range(count):
177
179
  self._mol.atom[i] = NULL
@@ -184,6 +186,10 @@ cdef class Molecule:
184
186
  raise MemoryError("Failed to allocate atom")
185
187
  memcpy(self._mol.atom[i], atom._atom, sizeof(_Atom))
186
188
 
189
+ self._mol.index = jess.res_index.ResIndex_create(self._mol.atom, count)
190
+ if self._mol.index is NULL:
191
+ raise MemoryError("Failed to allocate residue index")
192
+
187
193
  def __len__(self):
188
194
  assert self._mol is not NULL
189
195
  return self._mol.count
@@ -274,6 +280,7 @@ cdef class Molecule:
274
280
  if copy._mol is NULL:
275
281
  raise MemoryError("Failed to allocate molecule")
276
282
  # copy molecule attributes
283
+ copy._mol.index = NULL
277
284
  copy._mol.count = self._mol.count
278
285
  memset(copy._mol.id, b' ', 5)
279
286
  # copy molecule atoms
@@ -282,6 +289,10 @@ cdef class Molecule:
282
289
  if copy._mol.atom[i] is NULL:
283
290
  raise MemoryError("Failed to allocate atom")
284
291
  memcpy(copy._mol.atom[i], self._mol.atom[i], sizeof(_Atom))
292
+ # regenerate index
293
+ copy._mol.index = jess.res_index.ResIndex_create(copy._mol.atom, copy._mol.count)
294
+ if copy._mol.index is NULL:
295
+ raise MemoryError("Failed to allocate residue index")
285
296
 
286
297
  copy._id = self._id
287
298
  return copy
@@ -1011,6 +1022,7 @@ cdef class Template:
1011
1022
  self._tpl.count = jess.tess_template.TessTemplate_count
1012
1023
  self._tpl.range = jess.tess_template.TessTemplate_range
1013
1024
  self._tpl.check = jess.tess_template.TessTemplate_check
1025
+ self._tpl.candidates = jess.tess_template.TessTemplate_candidates
1014
1026
  self._tpl.name = jess.tess_template.TessTemplate_name
1015
1027
  self._tpl.logE = jess.tess_template.TessTemplate_logE
1016
1028
  self._tpl.distWeight = jess.tess_template.TessTemplate_distWeight
@@ -1417,7 +1429,7 @@ cdef class Hit:
1417
1429
 
1418
1430
  mol = self._molecule.copy()
1419
1431
  for k in range(mol._mol.count):
1420
- atom = mol._mol.atom[i]
1432
+ atom = mol._mol.atom[k]
1421
1433
  for i in range(3):
1422
1434
  atom.x[i] = v[i]
1423
1435
  for j in range(3):
pyjess/tests/test_jess.py CHANGED
@@ -92,6 +92,29 @@ class TestJess(unittest.TestCase):
92
92
  self.assertEqual(len(jess[:1]), 1)
93
93
  self.assertEqual(len(jess[1:]), 0)
94
94
 
95
+
96
+ @unittest.skipUnless(files, "importlib.resources not available")
97
+ def test_multiple_query_split(self):
98
+ with files(data).joinpath("template_01.qry").open() as f:
99
+ template1 = Template.load(f)
100
+ with files(data).joinpath("template_02.qry").open() as f:
101
+ template2 = Template.load(f)
102
+ j0 = Jess([template1, template2])
103
+ j1 = Jess([template1])
104
+ j2 = Jess([template2])
105
+
106
+ with files(data).joinpath("1AMY.pdb").open() as f:
107
+ molecule = Molecule.load(f)
108
+
109
+ h0 = list(j0.query(molecule, 2, 5, 5))
110
+ h1 = list(j1.query(molecule, 2, 5, 5))
111
+ h2 = list(j2.query(molecule, 2, 5, 5))
112
+
113
+ self.assertEqual(len(h0), len(h1) + len(h2))
114
+ for hit0, hit1 in zip(h0, (*h1, *h2)):
115
+ self.assertEqual(hit0.atoms(), hit1.atoms())
116
+ self.assertEqual(hit0.evalue, hit1.evalue)
117
+
95
118
  @unittest.skipUnless(files, "importlib.resources not available")
96
119
  def test_query_template_subclass(self):
97
120
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: pyjess
3
- Version: 0.5.0
3
+ Version: 0.5.1
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>
@@ -76,7 +76,7 @@ Description-Content-Type: text/markdown
76
76
  [![Issues](https://img.shields.io/github/issues/althonos/pyjess.svg?style=flat-square&maxAge=600)](https://github.com/althonos/pyjess/issues)
77
77
  [![Docs](https://img.shields.io/readthedocs/pyjess/latest?style=flat-square&maxAge=600)](https://pyjess.readthedocs.io)
78
78
  [![Changelog](https://img.shields.io/badge/keep%20a-changelog-8A0707.svg?maxAge=2678400&style=flat-square)](https://github.com/althonos/pyjess/blob/main/CHANGELOG.md)
79
- [![Downloads](https://img.shields.io/pypi/dm/pyjess?style=flat-square&color=303f9f&maxAge=86400&label=downloads)](https://pepy.tech/project/pyjess)
79
+ [![Downloads](https://img.shields.io/badge/dynamic/regex?url=https%3A%2F%2Fpepy.tech%2Fprojects%2Fpyjess&search=%5B0-9%5D%2B.%5B0-9%5D%2B(k%7CM)&style=flat-square&label=downloads&color=303f9f&cacheSeconds=86400)](https://pepy.tech/project/pyjess)
80
80
 
81
81
 
82
82
  ## 🗺️ Overview
@@ -184,7 +184,7 @@ If running Jess in parallel, make sure to use `v0.2.1` or later to use the code
184
184
 
185
185
  ### ⚠️ Issue Tracker
186
186
 
187
- Found a bug ? Have an enhancement request ? Head over to the [GitHub issue tracker](https://github.com/althonos/[pyjess]/issues)
187
+ Found a bug ? Have an enhancement request ? Head over to the [GitHub issue tracker](https://github.com/althonos/pyjess/issues)
188
188
  if you need to report or ask something. If you are filing in on a bug,
189
189
  please include as much information as you can about the issue, and try to
190
190
  recreate the same bug in a simple, easily reproducible situation.
@@ -1,19 +1,19 @@
1
- pyjess-0.5.0.dist-info/RECORD,,
2
- pyjess-0.5.0.dist-info/WHEEL,sha256=aDyRsmecACg_4Mn9Gad5chq1RLU8PGG-KECE6gUM5uU,116
3
- pyjess-0.5.0.dist-info/METADATA,sha256=sz5NWDSx0uyq_myc5StGdXX-lD3tNYVXz1K4efR5wZg,11151
4
- pyjess-0.5.0.dist-info/licenses/COPYING,sha256=gLCfHtBLTrghVX7GkpmZqoozWMNN46502m_OUiYy01Y,1103
5
- pyjess/_jess.cpython-312-darwin.so,sha256=5XrUjvETr7-wxyUvlgkxqqI0jjfmVZzj1O-tx8y83RQ,322144
1
+ pyjess-0.5.1.dist-info/RECORD,,
2
+ pyjess-0.5.1.dist-info/WHEEL,sha256=8ighkFecsxmTMyAQuuEDjIsUG9RF0iTc2r5C5JUW66g,116
3
+ pyjess-0.5.1.dist-info/METADATA,sha256=OMnKlTvBTrR8tfxUFdUJXnJPezgo10GrHWTxap3eG7A,11248
4
+ pyjess-0.5.1.dist-info/licenses/COPYING,sha256=gLCfHtBLTrghVX7GkpmZqoozWMNN46502m_OUiYy01Y,1103
5
+ pyjess/_jess.cpython-312-darwin.so,sha256=-k8Pu34FYyI6op42TvrnldHYbr6Xgwt8c2HOd2Ct4gA,326984
6
6
  pyjess/_jess.pyi,sha256=OjbEcgr16eFEnAFbT_zp-jqjd4XME2V_gxuKZJBXVoc,6896
7
7
  pyjess/CMakeLists.txt,sha256=Oa0pniEQx9jXyFCJGyrswn9ahWSSVuW1madyeP6StoI,35
8
8
  pyjess/__init__.py,sha256=h4XXLdS4FnyVa-MBs_k3eZMG1jWxeiOJnwfBaJA9gyQ,745
9
9
  pyjess/.gitignore,sha256=uQBOufp4v50qn0aZKv6zbSo00cjfB-v9KySog7rlmIU,19
10
- pyjess/_jess.pyx,sha256=tRPxQyvCBxvVbIjAb8iuCLtIpPAP0w_P_42Uy1wv8oc,49965
10
+ pyjess/_jess.pyx,sha256=kbAp0zWfxliPvzJ9c5G3oeRUKFcxtedo4oav-1uQotQ,50546
11
11
  pyjess/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
12
12
  pyjess/tests/__init__.py,sha256=MdHWtr6A8S4TBWlkoj4olFK2FXAGc5uJdbWtgFrDLpk,528
13
13
  pyjess/tests/test_molecule.py,sha256=RHBE0yL_j71nQOwXJ6t_PzkZi4BaFPY5Q0VwKWM6elk,5311
14
14
  pyjess/tests/utils.py,sha256=dsaphex7qomJCvSHWnVy79iYDPGiL59xqGAtRoVAeWc,196
15
15
  pyjess/tests/test_atom.py,sha256=omNznNbRXMDt2j1plAUlfWPGCfmtkYpj2jysEX1zQuY,4631
16
- pyjess/tests/test_jess.py,sha256=mgHx6kDW5yzdvZiiybAVrd1J4k3Li3r-t4le6RFEE5o,9757
16
+ pyjess/tests/test_jess.py,sha256=lTp_KzkbPF5J0nWewO4LJrKeKuXtSlzj114kPG-54zM,10642
17
17
  pyjess/tests/test_template.py,sha256=XMLELYRB4j7xavziZ-ntq15PjhNHNfJJkctUq9BkvEI,4541
18
18
  pyjess/tests/test_template_atom.py,sha256=s9tJ_SAgvKeGwbVjaTWY-EtsUeQp3eu4NF5ja3oO_84,3405
19
19
  pyjess/tests/data/pdb1lnb.pdb,sha256=E9Jjy4qQ75O1UKIXcVyVJHE1XDNx1Rb7ENPVrehW6N8,270054
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: scikit-build-core 0.11.1
2
+ Generator: scikit-build-core 0.11.5
3
3
  Root-Is-Purelib: false
4
4
  Tag: cp312-cp312-macosx_10_13_x86_64
5
5