README.md 1.22 KB
Newer Older
NOEL Philippe's avatar
NOEL Philippe committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
# PDBparser 

**PDBparser is a library written in rust to read and select atoms in protein structure files in the [PDB format](http://www.wwpdb.org/documentation/file-format)**

## Usage

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 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());
}
```

## 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