Skip to content

Commit cf77d95

Browse files
authored
re-structure code as library (#62)
* re-structure code as library * remove example
1 parent 755357d commit cf77d95

File tree

12 files changed

+71
-55
lines changed

12 files changed

+71
-55
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "haddock-restraints"
3-
version = "0.8.1"
3+
version = "0.8.2"
44
edition = "2021"
55
description = "Generate restraints to be used in HADDOCK"
66
license = "MIT"
@@ -16,6 +16,14 @@ keywords = [
1616
categories = ["science::bioinformatics", "science"]
1717

1818

19+
[lib]
20+
name = "haddock_restraints"
21+
path = "src/lib.rs"
22+
23+
[[bin]]
24+
name = "haddock-restraints"
25+
path = "src/main.rs"
26+
1927
[dependencies]
2028
rust-sasa = "0.2"
2129
serde = { version = "1.0", features = ["derive"] }

src/cli.rs

Whitespace-only changes.

src/air.rs renamed to src/core/air.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use std::collections::HashSet;
22

3-
use crate::{interactor, utils};
3+
use crate::core::{interactor, utils};
44

55
/// Represents the Air (Ambiguous Interaction Restraints) structure.
66
///
File renamed without changes.

src/interactor.rs renamed to src/core/interactor.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
use crate::sasa;
2-
use crate::structure;
1+
use crate::core::sasa;
2+
use crate::core::structure;
33
use core::panic;
44
use serde::Deserialize;
55
use std::collections::HashSet;
@@ -758,7 +758,7 @@ pub fn format_atom_string(atoms: &Option<Vec<String>>) -> String {
758758
#[cfg(test)]
759759
mod tests {
760760

761-
use crate::interactor::{Interactor, PassiveResidues};
761+
use crate::core::interactor::{Interactor, PassiveResidues};
762762

763763
#[test]
764764
fn test_valid_interactor() {

src/core/mod.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
pub mod air;
2+
pub mod input;
3+
pub mod interactor;
4+
pub mod sasa;
5+
pub mod structure;
6+
pub mod utils;

src/sasa.rs renamed to src/core/sasa.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,7 @@ pub const REL_ASA: &[(&str, AsaValues)] = &[
561561
#[cfg(test)]
562562
mod test {
563563

564-
use crate::structure;
564+
use crate::core::structure;
565565

566566
use super::*;
567567

src/structure.rs renamed to src/core/structure.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -200,14 +200,6 @@ pub fn neighbor_search(
200200
///
201201
/// A `Vec<&Residue>` containing references to the residues whose serial numbers match those in the `target` vector.
202202
///
203-
/// # Example
204-
///
205-
/// ```
206-
/// let pdb = pdbtbx::PDB::from_file("protein.pdb").unwrap();
207-
/// let target_serials = vec![1, 3, 5];
208-
/// let selected_residues = get_residues(&pdb, target_serials);
209-
/// ```
210-
///
211203
/// # Notes
212204
///
213205
/// - This function performs a linear search through all residues in the PDB structure.
File renamed without changes.

0 commit comments

Comments
 (0)