PDBparser 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
:
toml
[dependencies]
pdbparser = { git = "ssh://git@gitlab.inria.fr/pnoel/pdbparser.git" }
and this to your crate root:
rust
extern crate pdbparser;
Here's a simple example that read a pdb file in tests/tests_file
```rust extern crate pdbparser;
use pdbpaser::*;
fn main() { let myprot = parsepdb("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());
} ```