{"id":26756922,"url":"https://github.com/hfooladi/pdbrust","last_synced_at":"2025-03-28T15:21:54.180Z","repository":{"id":284139059,"uuid":"953942395","full_name":"HFooladi/pdbrust","owner":"HFooladi","description":"A Rust library for parsing PDB (Protein Data Bank) files","archived":false,"fork":false,"pushed_at":"2025-03-24T10:38:49.000Z","size":54,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-24T11:36:32.734Z","etag":null,"topics":["parser","pdb","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/HFooladi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-24T10:21:50.000Z","updated_at":"2025-03-24T10:40:27.000Z","dependencies_parsed_at":"2025-03-24T11:47:21.040Z","dependency_job_id":null,"html_url":"https://github.com/HFooladi/pdbrust","commit_stats":null,"previous_names":["hfooladi/pdbrust"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HFooladi%2Fpdbrust","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HFooladi%2Fpdbrust/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HFooladi%2Fpdbrust/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HFooladi%2Fpdbrust/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HFooladi","download_url":"https://codeload.github.com/HFooladi/pdbrust/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246049675,"owners_count":20715513,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["parser","pdb","rust"],"created_at":"2025-03-28T15:21:53.476Z","updated_at":"2025-03-28T15:21:54.158Z","avatar_url":"https://github.com/HFooladi.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PDBRust\n\n[![Rust CI/CD](https://github.com/hfooladi/pdbrust/actions/workflows/rust.yml/badge.svg)](https://github.com/hfooladi/pdbrust/actions/workflows/rust.yml)\n[![codecov](https://codecov.io/gh/hfooladi/pdbrust/branch/main/graph/badge.svg)](https://codecov.io/gh/hfooladi/pdbrust)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![Crates.io](https://img.shields.io/crates/v/pdbrust.svg)](https://crates.io/crates/pdbrust)\n[![Documentation](https://docs.rs/pdbrust/badge.svg)](https://docs.rs/pdbrust)\n\nA comprehensive Rust library for parsing and analyzing PDB (Protein Data Bank) files. This library provides a robust and efficient way to work with protein structure data in PDB format.\n\n## Features\n\n- **Complete Record Support**\n  - ATOM/HETATM records with full coordinate and metadata support\n  - MODEL/ENDMDL for multi-model structures\n  - SEQRES records for sequence information\n  - CONECT records for connectivity data\n  - SSBOND records for disulfide bonds\n  - REMARK records with categorization\n  - HEADER and TITLE metadata\n\n- **Robust Error Handling**\n  - Custom error types for different parsing scenarios\n  - Detailed error messages for debugging\n  - Safe handling of malformed PDB files\n\n- **Utility Functions**\n  - Chain identification and analysis\n  - Residue sequence extraction\n  - Connectivity analysis\n  - Model-based structure organization\n  - Disulfide bond analysis\n\n## Installation\n\nAdd this to your `Cargo.toml`:\n\n```toml\n[dependencies]\npdbrust = \"0.1.0\"\n```\n\n## Usage\n\n### Basic Structure Loading\n\n```rust\nuse pdbrust::PdbStructure;\n\nfn main() -\u003e Result\u003c(), Box\u003cdyn std::error::Error\u003e\u003e {\n    // Load a PDB file\n    let structure = PdbStructure::from_file(\"protein.pdb\")?;\n    \n    // Access basic information\n    if let Some(header) = \u0026structure.header {\n        println!(\"Structure header: {}\", header);\n    }\n    \n    println!(\"Number of atoms: {}\", structure.atoms.len());\n    println!(\"Number of models: {}\", structure.models.len());\n    \n    Ok(())\n}\n```\n\n### Chain and Residue Analysis\n\n```rust\nuse pdbrust::PdbStructure;\n\nfn analyze_chains(structure: \u0026PdbStructure) {\n    // Get all chain IDs\n    let chain_ids = structure.get_chain_ids();\n    \n    for chain_id in chain_ids {\n        // Get residues in this chain\n        let residues = structure.get_residues_for_chain(\u0026chain_id);\n        println!(\"Chain {} has {} residues\", chain_id, residues.len());\n        \n        // Get sequence if available\n        let sequence = structure.get_sequence(\u0026chain_id);\n        if !sequence.is_empty() {\n            println!(\"Sequence: {}\", sequence.join(\"-\"));\n        }\n    }\n}\n```\n\n### Connectivity Analysis\n\n```rust\nuse pdbrust::PdbStructure;\n\nfn analyze_connectivity(structure: \u0026PdbStructure) {\n    // Analyze disulfide bonds\n    for bond in \u0026structure.ssbonds {\n        println!(\"Disulfide bond between:\");\n        println!(\"  Residue 1: {} {} {}\", bond.residue1_name, bond.chain1_id, bond.residue1_seq);\n        println!(\"  Residue 2: {} {} {}\", bond.residue2_name, bond.chain2_id, bond.residue2_seq);\n        println!(\"  Distance: {:.2} Å\", bond.length);\n    }\n}\n```\n\n### Parallel Processing\n\n```rust\nuse pdbrust::PdbStructure;\nuse pdbrust::features::parallel;\n\n#[cfg(feature = \"parallel\")]\nfn process_structures_parallel(structures: Vec\u003cPdbStructure\u003e) {\n    use rayon::prelude::*;\n    \n    let results: Vec\u003c_\u003e = structures.par_iter()\n        .map(|structure| {\n            // Process each structure in parallel\n            structure.atoms.len()\n        })\n        .collect();\n    \n    println!(\"Total atoms across all structures: {}\", results.iter().sum::\u003cusize\u003e());\n}\n```\n\n### Geometric Analysis\n\n```rust\nuse pdbrust::PdbStructure;\nuse pdbrust::features::geometry;\n\n#[cfg(feature = \"geometry\")]\nfn analyze_structure_geometry(structure: \u0026PdbStructure) {\n    use nalgebra::Vector3;\n    \n    // Calculate center of mass\n    let com = structure.calculate_center_of_mass();\n    println!(\"Center of mass: {:?}\", com);\n    \n    // Calculate radius of gyration\n    let rg = structure.calculate_radius_of_gyration();\n    println!(\"Radius of gyration: {:.2} Å\", rg);\n}\n```\n\n## Features\n\nPDBRust supports several optional features that can be enabled in your `Cargo.toml`:\n\n```toml\n[dependencies]\npdbrust = { version = \"0.1.0\", features = [\"parallel\", \"geometry\"] }\n```\n\n- `parallel`: Enables parallel processing capabilities using Rayon\n- `geometry`: Adds geometric analysis functions using nalgebra\n\n## Contributing\n\nWe welcome contributions! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.\n\n1. Fork the repository\n2. Create your feature branch (`git checkout -b feature/amazing-feature`)\n3. Commit your changes (`git commit -m 'Add some amazing feature'`)\n4. Push to the branch (`git push origin feature/amazing-feature`)\n5. Open a Pull Request\n\n### Development Setup\n\n1. Clone the repository:\n   ```bash\n   git clone https://github.com/hfooladi/pdbrust.git\n   cd pdbrust\n   ```\n\n2. Install dependencies:\n   ```bash\n   cargo build\n   ```\n\n3. Run tests:\n   ```bash\n   cargo test\n   ```\n\n4. Run benchmarks:\n   ```bash\n   cargo bench\n   ```\n\n### Code Style\n\n- Follow the Rust standard style guide\n- Run `cargo fmt` before committing\n- Run `cargo clippy` to check for linting issues\n- Ensure all tests pass with `cargo test`\n- Add tests for new functionality\n- Update documentation as needed\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## Acknowledgments\n\n- The Protein Data Bank (PDB) for providing the standard format\n- The Rust community for excellent tools and libraries\n- All contributors to this project ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhfooladi%2Fpdbrust","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhfooladi%2Fpdbrust","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhfooladi%2Fpdbrust/lists"}