lib3dmol 0.3.2

Lib3dmol is a library written in rust to read, manipulate, select atoms in protein structure files
Documentation

Lib3dmol

Crates.io Crates.io

Lib3dmol is a library written in rust to read and select atoms in protein structure files in the PDB format

Usage

Add this to your Cargo.toml:

[dependencies]
lib3dmol = "0.3.2"

Here's a simple example that read a pdb file in tests/tests_file

use lib3dmol::parser;

fn main() {
    let my_structure = parser::read_pdb("tests/tests_file/f2.pdb", "Protein f2");

    println!(
        "Structure name: {}
Number of chain: {}
Number of residue: {}
Number of atom: {}",
        my_structure.name,
        my_structure.get_chain_number(),
        my_structure.get_residue_number(),
        my_structure.get_atom_number()
    );

    // Now we will extract the backbone

    let backbone = my_structure.select_atoms("backbone").unwrap();

    println!(
        "Number of chain: {}
Number of residue: {}
Number of atom: {}",
        backbone.get_chain_number(),
        backbone.get_residue_number(),
        backbone.get_atom_number()
    );
}

Todo

  • : PDB Writer
  • : Structure to keep informations on nucleic acid/lipid/water
  • : More options to select atoms (Alpha carbon, atoms near to an other, ...)
  • : Support of PDBx/mmCIF format