Skip to content

Commit 96da262

Browse files
Bump rust-sasa from 0.2.4 to 0.3.1 (#77)
* Bump rust-sasa from 0.2.4 to 0.3.1 Bumps [rust-sasa](https://github.com/maxall41/RustSASA) from 0.2.4 to 0.3.1. - [Release notes](https://github.com/maxall41/RustSASA/releases) - [Changelog](https://github.com/maxall41/RustSASA/blob/main/CHANGELOG.md) - [Commits](https://github.com/maxall41/RustSASA/commits/v0.3.1) --- updated-dependencies: - dependency-name: rust-sasa dependency-version: 0.3.1 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> * update `calculate_sasa` * tweak test --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Rodrigo V. Honorato <[email protected]>
1 parent 3c56455 commit 96da262

File tree

4 files changed

+203
-21
lines changed

4 files changed

+203
-21
lines changed

Cargo.lock

Lines changed: 191 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ name = "haddock-restraints"
2525
path = "src/main.rs"
2626

2727
[dependencies]
28-
rust-sasa = "0.2"
28+
rust-sasa = "0.3"
2929
serde = { version = "1.0", features = ["derive"] }
3030
serde_json = "1.0"
3131
pdbtbx = "0.12"

src/core/interactor.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -848,7 +848,7 @@ mod tests {
848848
let expected_passive = [
849849
938, 965, 953, 944, 933, 958, 966, 972, 931, 936, 961, 929, 943, 954, 932, 945, 942,
850850
957, 955, 947, 940, 941, 937, 964, 970, 930, 969, 968, 950, 952, 959, 971, 967, 956,
851-
946, 960, 962, 935, 948, 951, 934,
851+
946, 960, 962, 935, 948, 951, 934, 939,
852852
];
853853

854854
assert_eq!(

src/core/sasa.rs

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
use pdbtbx::{Atom, Residue};
2-
use rust_sasa::calculate_sasa as calculate_rust_sasa;
3-
use rust_sasa::{SASALevel, SASAResult};
2+
use rust_sasa::options::{AtomLevel, SASAOptions};
43
use std::process;
54

65
/// Represents an atom with additional solvent accessible surface area (SASA) information.
@@ -120,14 +119,16 @@ pub fn calculate_sasa(mut pdbtbx_struct: pdbtbx::PDB) -> Vec<ExtendedRes> {
120119
// ================================================================================
121120
// Calculate the SASA of each atom
122121

123-
let result = calculate_rust_sasa(&pdbtbx_struct, None, None, SASALevel::Atom).unwrap();
122+
let options = SASAOptions::<AtomLevel>::new()
123+
.with_probe_radius(1.4)
124+
.with_n_points(100);
124125

125-
let atom_sasa: Vec<f64> = if let SASAResult::Atom(sasa_vec) = result {
126-
// Convert Vec<f32> to Vec<f64>
127-
sasa_vec.into_iter().map(|x| x as f64).collect()
128-
} else {
129-
panic!("Unexpected result type: expected Atom variant");
130-
};
126+
let atom_sasa = options
127+
.process(&pdbtbx_struct)
128+
.unwrap()
129+
.into_iter()
130+
.map(f64::from)
131+
.collect::<Vec<f64>>();
131132

132133
// Create a vector of ExtendedAtoms containing the SASA of each atom
133134
let mut extended_atoms: Vec<ExtendedAtom> = Vec::new();

0 commit comments

Comments
 (0)