3 releases

0.2.2 Aug 12, 2025
0.2.1 Nov 21, 2024
0.2.0 Nov 14, 2024

#2295 in Encoding

Download history

127 downloads per month

MIT license

70KB
1.5K SLoC

knuckles-rs

Crates.io Version

A WIP PDB Parser written in Rust. This is a sister project and reimplementation of sonic-pdb-parser.


lib.rs:

knuckles-parse

A fast and efficient PDB (Protein Data Bank) file parser written in Rust.

This library provides functionality to parse PDB files into structured Rust data types, with support for parallel processing, Python bindings, and serialization.

Features

  • Fast parsing: Optimized for performance with optional parallel processing
  • Comprehensive record support: Handles all major PDB record types
  • Python bindings: Optional Python integration via PyO3
  • Serialization: Optional JSON serialization support via Serde
  • Parallel processing: Optional multi-threaded parsing with Rayon

Example

use knuckles_parse::{pdbreader_single, Record};

let pdb_content = "ATOM      1  N   ALA A   1      20.154  16.967  27.462  1.00 11.18           N";
let records = pdbreader_single(pdb_content);

match &records[0] {
    Record::Atom(atom) => {
        println!("Atom name: {}", atom.name);
        println!("Coordinates: ({}, {}, {})", atom.x, atom.y, atom.z);
    }
    _ => {}
}

Dependencies

~0–1.3MB
~26K SLoC