[][src]Crate lib3dmol

Lib3Dmol

Lib3Dmol is a library to parser, filter, create, edit and convert molecules in PDB format. It provide functions to filter atoms according to text pattern matching, compute distances between structures and sub-structures. A file is represented as a [Structure] You can create a [Structure] by parsing with [read_pdb] function. Then you can add filters on your Structure. And save it with write_pdb function.

Examples

use lib3dmol::*;

fn main() {
    let my_prot = parse_pdb("tests/tests_file/5jpq.pdb", "5jpq");

    println!("Prot : {} \nn chain: {}\nn res: {}\nn atom: {}",
    my_prot.name, my_prot.get_number_chain(),
    my_prot.get_number_residue(),
    my_prot.get_number_atom());

    println!("Reduce protein");

    let chain_a = my_prot.select_atoms("chain a").unwrap();
    println!("Prot : {} \nn chain: {}\nn res: {}\nn atom: {}",
    chain_a.name, chain_a.get_number_chain(),
    chain_a.get_number_residue(),
    chain_a.get_number_atom());
}

Modules

build

Build molecules according to a set of existing molecules. This can be Amino Acid, Nucleid Acid or Lipid. Used to test functions or to build examples. It return a [Structure] containing the molecule. This cannot be used to create entire protein or entire structure. Just for small molecules.

parser

Functions to parse files or text and create [Structure]

structures
tools

Various functions to compute distances, apply modifications on structures, extract sequences, ...

writer