Code Monkey home page Code Monkey logo

patoz's Introduction

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

patoz = "0.1.0"

๐Ÿ”ง Examples

use std::{
    fs::File,
    io::{BufReader, Read},
    path::PathBuf,
};

use patoz::parse;

fn main() {
    let mut current_file_path = PathBuf::from(file!());
    current_file_path.pop();
    current_file_path.pop();
    current_file_path.push("1BYI.pdb");
    let content = read_file(&current_file_path);
    if let Ok((_, mut res)) = parse(&content) {
        println!(
            "Classification : {:?}",
            res.header().header().unwrap().classification
        );
        println!("Id Code : {:?}", res.header().header().unwrap().id_code);
        println!("Keywords : {:?}", res.header().keywds().unwrap().keywords);
    }
}

fn read_file(path: &PathBuf) -> String {
    let file = File::open(path).unwrap();
    let mut buf_reader = BufReader::new(file);
    let mut contents = String::new();
    if let Ok(_read_res) = buf_reader.read_to_string(&mut contents) {
        contents
    } else {
        "".to_owned()
    }
}

๐Ÿ“Š Status

Record Parser Status

Title Section

Primary Structure Section

Heterogen Section

Secondary Structure Section

Connectivity Annotation Section

Miscellaneous Features Section

Crystallographic and Coordinate Transformation Section

Coordinate Section

Connectivity Section

Bookkeeping 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.

patoz's People

Contributors

orhanbalci avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

tianyishi2001

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.