https://github.com/althonos/pyjess
Cython bindings and Python interface to Jess, a 3D template matching software for protein structures.
Science Score: 49.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
✓DOI references
Found 6 DOI reference(s) in README -
○Academic publication links
-
✓Committers with academic emails
1 of 2 committers (50.0%) from academic institutions -
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (11.2%) to scientific vocabulary
Keywords
Repository
Cython bindings and Python interface to Jess, a 3D template matching software for protein structures.
Basic Info
Statistics
- Stars: 9
- Watchers: 3
- Forks: 0
- Open Issues: 1
- Releases: 13
Topics
Metadata Files
README.md
🐍🔍 PyJess 
Cython bindings and Python interface to Jess, a 3D template matching software.
🗺️ Overview
Jess is an algorithm for constraint-based structural template matching proposed by Jonathan Barker et al.[1]. It can be used to identify catalytic residues from a known template inside a protein structure. Jess is an evolution of TESS, a geometric hashing algorithm developed by Andrew Wallace et al.[2], removing some pre-computation and structural requirements from the original algorithm. Jess was further updated and maintained by Ioannis Riziotis during his PhD in the Thornton group.
PyJess is a Python module that provides bindings to Jess using Cython. It allows creating templates, querying them with protein structures, and retrieving the hits using a Python API without performing any external I/O. It's also more than 10x faster than Jess thanks to algorithmic optimizations added to improve the original Jess code while producing consistent results.
🔧 Installing
PyJess is available for all modern Python versions (3.7+).
It can be installed directly from PyPI,
which hosts some pre-built x86-64 wheels for Linux, MacOS, and Windows,
as well as the code required to compile from source with Cython:
console
$ pip install pyjess
Otherwise, PyJess is also available as a Bioconda
package:
console
$ conda install -c bioconda pyjess
Check the install page of the documentation for other ways to install PyJess on your machine.
🔖 Citation
PyJess is scientific software, and builds on top of Jess. Please cite Jess if you are using it in an academic work, for instance as:
PyJess, a Python library binding to Jess (Barker et al., 2003).
💡 Example
Prepare templates
Load Template
objects to be used as references from different template files:
```python import pathlib import pyjess
templates = [] for path in sorted(pathlib.Path("vendor/jess/examples").glob("template_*.qry")): templates.append(pyjess.Template.load(path, id=path.stem)) ```
Prepare query structures
Load a Molecule
(a PDB structure) from a PDB file, create one with the Python API, or
convert it from a Bio.Model,
gemmi.Model,
or biotite.structure.AtomArray
object:
```python
load from PDB file or mmCIF file
mol = pyjess.Molecule.load("vendor/jess/examples/test_pdbs/pdb1a0p.ent")
load with BioPython
parser = Bio.PDB.PDBParser() structure = parser.getstructure('pdb1a0p', "vendor/jess/examples/testpdbs/pdb1a0p.ent") mol = Molecule.from_biopython(structure, id="1a0p")
load with Gemmi
structure = gemmi.readpdbstring("vendor/jess/examples/testpdbs/pdb1a0p.ent") mol = Molecule.fromgemmi(structure[0], id="1a0p")
load with Biotite
pdbfile = biotite.structure.io.pdb.PDBFile.read(f) structure = pdbfile.getstructure(altloc="all", extrafields=["atomid", "bfactor", "occupancy", "charge"]) mol = Molecule.from_biotite(structure[0]) ```
Match templates
Create a Jess
instance and use it to query a against the stored templates:
python
jess = pyjess.Jess(templates)
query = jess.query(mol, rmsd_threshold=2.0, distance_cutoff=3.0, max_dynamic_distance=3.0)
Process hits
The hits are computed iteratively, and the different output statistics are computed on-the-fly when requested:
python
for hit in query:
print(hit.molecule.id, hit.template.id, hit.rmsd, hit.log_evalue)
for atom in hit.atoms():
print(atom.name, atom.x, atom.y, atom.z)
Hits can also be rendered in PDB format like in the original Jess output,
either by writing to a file directly, or to a Python string:
python
for hit in query:
hit.dump(sys.stdout, format="pdb")
🧶 Thread-safety
Once a Jess
instance has been created, the templates cannot be edited anymore,
making the Jess.query method re-entrant and thread-safe. This allows querying
several molecules against the same templates in parallel using e.g a
ThreadPool:
```python molecules = [] for path in glob.glob("vendor/jess/examples/test_pdbs/*.ent"): molecules.append(Molecule.load(path))
with multiprocessing.ThreadPool() as pool: hits = pool.map(jess.query, molecules) ```
⚠️ Prior to PyJess v0.2.1, the Jess code was running some thread-unsafe operations which have now been patched.
If running Jess in parallel, make sure to use v0.2.1 or later to use the code patched with re-entrant functions.
⏱️ Benchmarks
The following table reports the runtime of PyJess to match N=132 protein structures to the M=7607 templates of EnzyMM, using J=12 threads to parallelize.
| Version | Runtime (s) | Match Speed (N * M / s * J) | Speedup |
| ----------- | ----------- | --------------------------- | ----------- |
| v0.4.2 | 618.1 | 135.4 | N/A |
| v0.5.0 | 586.3 | 142.7 | x1.05 |
| v0.5.1 | 365.6 | 228.9 | x1.69 |
| v0.5.2 | 327.2 | 255.7 | x1.88 |
| v0.6.0 | 54.5 | 1535.4 | x11.34 |
| v0.7.0 | 52.4 | 1597.5 | x11.80 |
Benchmarks were run on a quiet i7-1255U CPU running @4.70GHz with 10 physical cores / 12 logical cores.
💭 Feedback
⚠️ Issue Tracker
Found a bug ? Have an enhancement request ? Head over to the GitHub issue tracker if you need to report or ask something. If you are filing in on a bug, please include as much information as you can about the issue, and try to recreate the same bug in a simple, easily reproducible situation.
🏗️ Contributing
Contributions are more than welcome! See
CONTRIBUTING.md
for more details.
📋 Changelog
This project adheres to Semantic Versioning and provides a changelog in the Keep a Changelog format.
⚖️ License
This library is provided under the MIT License. The JESS code is distributed under the MIT License as well.
This project is in no way not affiliated, sponsored, or otherwise endorsed by the JESS authors. It was developed by Martin Larralde during his PhD project at the Leiden University Medical Center in the Zeller team.
📚 References
- [1] Barker, J. A., & Thornton, J. M. (2003). An algorithm for constraint-based structural template matching: application to 3D templates with statistical analysis. Bioinformatics (Oxford, England), 19(13), 1644–1649. doi:10.1093/bioinformatics/btg226.
- [2] Wallace, A. C., Borkakoti, N., & Thornton, J. M. (1997). TESS: a geometric hashing algorithm for deriving 3D coordinate templates for searching structural databases. Application to enzyme active sites. Protein science : a publication of the Protein Society, 6(11), 2308–2323. doi:10.1002/pro.5560061104.
Owner
- Name: Martin Larralde
- Login: althonos
- Kind: user
- Location: Heidelberg, Germany
- Company: EMBL / LUMC, @zellerlab
- Twitter: althonos
- Repositories: 91
- Profile: https://github.com/althonos
PhD candidate in Bioinformatics, passionate about programming, SIMD-enthusiast, Pythonista, Rustacean. I write poems, and sometimes they are executable.
GitHub Events
Total
- Create event: 9
- Issues event: 4
- Release event: 7
- Watch event: 3
- Issue comment event: 5
- Push event: 52
Last Year
- Create event: 9
- Issues event: 4
- Release event: 7
- Watch event: 3
- Issue comment event: 5
- Push event: 52
Committers
Last synced: 9 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| Martin Larralde | m****e@e****e | 184 |
| RayHackett | 9****t | 1 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 5
- Total pull requests: 0
- Average time to close issues: 1 day
- Average time to close pull requests: N/A
- Total issue authors: 2
- Total pull request authors: 0
- Average comments per issue: 1.6
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 3
- Pull requests: 0
- Average time to close issues: about 18 hours
- Average time to close pull requests: N/A
- Issue authors: 2
- Pull request authors: 0
- Average comments per issue: 1.67
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- RayHackett (4)
- FranceCosta (1)
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- pypi 9,497 last-month
- Total dependent packages: 0
- Total dependent repositories: 0
- Total versions: 17
- Total maintainers: 2
pypi.org: pyjess
Cython bindings and Python interface to JESS, a 3D template matching software.
- Homepage: https://github.com/althonos/pyjess/
- Documentation: https://pyjess.readthedocs.io/en/stable/
- License: MIT License Copyright (c) 2024-2025 Martin Larralde <martin.larralde@embl.de> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
Latest release: 0.6.0
published 6 months ago