PDB benchmark

October 18, 2024 · View on GitHub

A series of tests to measure performance in handling PDB files. This was originally developed to compare chem.cr capabilities with widely-used libraries and programs.

Heavily inspired by PDB benchmarks.

Benchmark

Tests

The benchmark includes the following tests:

  • Parsing PDB files.
    • 1CRN - hydrophobic protein (327 atoms).
    • 1AKE - protein-ligand complex (3,816 atoms).
    • 3JYV - 80S rRNA (57,327 atoms).
    • 1HTQ - multicopy glutamine synthetase (10 models of 97,872 atoms).
  • Counting the number of alanine residues.
  • Calculating the distance between residues 50 and 60 of chain A.
  • Calculating the Ramachandran phi/psi angles.
  • Aligning the coordinates of the system to itself (avoid selection/matching issues).

The tests are implemented according to the official documentation of each library, using examples from tutorials and guides as reference. Optimized versions may be faster but often require advanced (possibly undocumented) usage.

Tests except parsing PDB files were run with 1AKE (3,816 atoms). Elapsed times are averaged over ten runs (except for 1HTQ, 3 runs) for every test.

Software

LibraryVersionLanguageLanguage version
Biopython1.84Python3.12.7
chem.cr0.6.0 (master)Crystal1.13.1
Chemfiles*0.10.4C++/Python3.12.7
MDAnalysis2.7.0Python3.12.7
MDTraj1.10.0Python3.12.7
Schrodinger2023-4C++/Python3.8.10
VMD1.9.4C/Tcl

* Chemfiles C++ version was not tested as most people would probably use it from Python. C/C++ is often complicated to write and build, which could be cumbersome for most scientists.

Note

Python libraries listed here may internally use C-powered code for some performance-critical code such as distance calculation. In the other hand, C/Tcl and C++/Python libraries are implemented in pure C/C++ and offer access from Tcl/Python through bindings.

Hardware specification

All tests were run on the following hardware:

  • CPU: AMD Ryzen 9 5950X 16-Core Processor @ 3.40GHz
  • RAM: 32 GB 3733 MHz DDR4
  • SSD: Seagate FireCuda 520 NVMe
  • OS: Pop! OS 22.04 LTS

Installation

Either clone or download this repository.

Requirements

The following programs and libraries must be installed and available in the executable path:

  • Crystal compiler
  • Python interpreter
    • BioPython
    • Chemfiles
    • MDAnalysis
    • mdtraj
  • Schrodinger's Maestro
  • VMD software

Python libraries can be installed via either PIP or Conda. Please refer to the official documentation for installation instructions.

Once all requirements are installed, set up the environment by doing the following:

  • Add the scripts directory to the PYTHONPATH environment variable.
  • Set SCHRODINGER environment variable to the Schrodinger installation directory.
  • Ensure that the vmd executable is accessible
  • Install the chem.cr library and then build the test executables for chem.cr:
$ shards install
$ shards build --release --mcpu=native

Usage

To run the benchmark, simply run the run.py script:

$ python scripts/run.py
biopython/count/1ake                    0.000191
chem/count/1ake                         0.000009
chemfiles/count/1ake                    0.000300
mdanalysis/count/1ake                   0.000036
mdtraj/count/1ake                       0.000075
schrodinger/count/1ake                  0.026060
vmd/count/1ake                          0.000173

biopython/distance/1ake                 0.000162
chem/distance/1ake                      0.000000
chemfiles/distance/1ake                 0.000998
mdanalysis/distance/1ake                0.000378
mdtraj/distance/1ake                    0.000936
schrodinger/distance/1ake               0.041747
vmd/distance/1ake                       0.000381

You can select which tests to run and libraries to test via the -t/--tests and -l/--libraries options, respectively.

Results

The following figure and table show the runtimes obtained for each test in the benchmark. There are clear differences in performance, where a given software can be orders of magnitude (note the logarithmic scale in the figure) faster than others, depending on the test.

Important

Direct comparison of parsing times should be taken with a grain of salt because each library does something slightly different, e.g. error checking. Some of this functionality is listed below. Nonetheless, these results gives an overall picture in terms of the expected performance.

alt text

Biopythonchem.crChemfilesMDAnalysisMDTrajschrodingerVMD
Parse 1AKE [ms]20.0563.5384.07423.31654.02582.2766.082
Parse 1CRN [ms]2.4780.4180.7732.8285.83548.1801.127
Parse 1HTQ [s]5.8572.2780.7321.87118.5896.4000.120
Parse 3JYV [s]0.2800.046×0.3331.0890.4170.090
Align [ms]139.7570.168-101.0358.4095.0560.056
Count [ms]0.0540.0040.1960.0170.0285.7570.027
Distance [ms]0.0980.0010.7640.3100.4059.2140.257
Ramachandran [ms]44.1910.353289.15436.2531.97716.1710.639
LicenseBiopythonMITBSDGPLv2LGPLProprietaryVMD
Parse Headeryesyesyesnononono
Parse CONECTnoyesyesnoyesyesyes
Parse Secondary Structurenoyesyesnononono
Hybrid36noyesnoyesnonono
Supports disorderyesyesnonoyesyesno
Hierarchical parsingyesyesnonononono
Guess bondsnoyes**yes*noyes*yesyes

- Does not support feature.
× Failed test.
* Assign bonds based on connection table for standard protein residues.
** Same as *, but checks bond distances.

Latest update: 2024-10-18

Contributing

Please open a pull request for adding a new software or improving the test code, as optimal code may run faster. The benchmark will be run again and runtimes will be updated accordingly.

  1. Fork it (https://github.com/franciscoadasme/pdb-bench/fork)
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Contributors

License

Licensed under the MIT license, see the separate LICENSE file.