项目作者: orhanbalci

项目描述 :
Protein Data Bank (pdb) file parser
高级语言: Rust
项目地址: git://github.com/orhanbalci/patoz.git
创建时间: 2019-08-21T08:28:27Z
项目社区:https://github.com/orhanbalci/patoz

开源协议:MIT License

下载


Patoz

Protein Data Bank (pdb) file parser

Build Status
License

⚠️ WIP This is a work in progress. Expect breaking changes frequently. Right now use at your own risk

📦 Cargo.toml

  1. patoz = "0.1.0"

🔧 Examples

  1. use std::{
  2. fs::File,
  3. io::{BufReader, Read},
  4. path::PathBuf,
  5. };
  6. use patoz::parse;
  7. fn main() {
  8. let mut current_file_path = PathBuf::from(file!());
  9. current_file_path.pop();
  10. current_file_path.pop();
  11. current_file_path.push("1BYI.pdb");
  12. let content = read_filet_file_path);
  13. if let Ok((_, mut res)) = parse(&content) {
  14. println!(
  15. "Classification : {:?}",
  16. res.header().header().unwrap().classification
  17. );
  18. println!("Id Code : {:?}", res.header().header().unwrap().id_code);
  19. println!("Keywords : {:?}", res.header().keywds().unwrap().keywords);
  20. }
  21. }
  22. fn read_file(path: &PathBuf) -> String {
  23. let file = File::open(path).unwrap();
  24. let mut buf_reader = BufReader::new(file);
  25. let mut contents = String::new();
  26. if let Ok(_read_res) = buf_reader.read_to_string(&mut contents) {
  27. contents
  28. } else {
  29. "".to_owned()
  30. }
  31. }

📊 Status

Record Parser Status

Title Section

📝 License

Licensed under MIT License (LICENSE).

🚧 Contributions

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this project by you, as defined in the MIT license, shall be licensed as above, without any additional terms or conditions.