Crates.io | lib3dmol |
lib.rs | lib3dmol |
version | 0.4.0 |
source | src |
created_at | 2020-02-24 13:59:28.905573 |
updated_at | 2021-10-14 15:32:53.225622 |
description | Lib3dmol is a library written in rust to read, manipulate, select atoms in protein structure files |
homepage | |
repository | https://gitlab.inria.fr/capsid.crates/lib3dmol |
max_upload_size | |
id | 212022 |
size | 115,650 |
Lib3dmol is a library written in rust to read and select atoms in protein structure files in the PDB format
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()
);
}