pub struct SASAOptions<T> { /* private fields */ }Expand description
Options for configuring SASA (Solvent Accessible Surface Area) calculations.
This struct provides configuration options for SASA calculations at different levels
of granularity (atom, residue, chain, or protein level). The type parameter T
determines the output type and processing behavior.
§Type Parameters
T- The processing level, which must implementSASAProcessor. Available levels:AtomLevel- Returns SASA values for individual atomsResidueLevel- Returns SASA values aggregated by residueChainLevel- Returns SASA values aggregated by chainProteinLevel- Returns SASA values aggregated for the entire protein
§Fields
probe_radius- Radius of the solvent probe sphere in Angstroms (default: 1.4)n_points- Number of points on the sphere surface for sampling (default: 100)threads- Number of threads to use for parallel processing (default: -1 for all cores)include_hydrogens- Whether to include hydrogen atoms in calculations (default: false)radii_config- Optional custom radii configuration (default: uses embedded protor.config)allow_vdw_fallback- Allow fallback to PDBTBX van der Waals radii when radius is not found in radii file (default: false)include_hetatms- Whether to include HETATM records (e.g. non-standard amino acids) in calculations (default: false)
§Examples
use rust_sasa::options::{SASAOptions, ResidueLevel};
use pdbtbx::PDB;
// Create options with default settings
let options = SASAOptions::<ResidueLevel>::new();
// Customize the configuration
let custom_options = SASAOptions::<ResidueLevel>::new()
.with_probe_radius(1.2)
.with_n_points(200)
.with_threads(-1)
.with_include_hydrogens(false)
.with_allow_vdw_fallback(true)
.with_include_hetatms(false);
// Process a PDB structure
let result = custom_options.process(&pdb)?;Implementations§
Source§impl<T> SASAOptions<T>
impl<T> SASAOptions<T>
Sourcepub fn new() -> SASAOptions<T>
pub fn new() -> SASAOptions<T>
Create a new SASAOptions with the specified level type
Sourcepub fn with_probe_radius(self, radius: f32) -> Self
pub fn with_probe_radius(self, radius: f32) -> Self
Set the probe radius (default: 1.4 Angstroms)
Sourcepub fn with_include_hetatms(self, include_hetatms: bool) -> Self
pub fn with_include_hetatms(self, include_hetatms: bool) -> Self
Include or exclude HETATM records in protein.
Sourcepub fn with_n_points(self, points: usize) -> Self
pub fn with_n_points(self, points: usize) -> Self
Set the number of points on the sphere for sampling (default: 100)
Sourcepub fn with_read_radii_from_occupancy(
self,
read_radii_from_occupancy: bool,
) -> Self
pub fn with_read_radii_from_occupancy( self, read_radii_from_occupancy: bool, ) -> Self
Set whether radii should be read from input protein occupancy values. (default: false)
Sourcepub fn with_threads(self, threads: isize) -> Self
pub fn with_threads(self, threads: isize) -> Self
Configure the number of threads to use for parallel processing
-1: Use all available CPU cores (default)1: Single-threaded execution (disables parallelism)> 1: Use specified number of threads
Sourcepub fn with_include_hydrogens(self, include_hydrogens: bool) -> Self
pub fn with_include_hydrogens(self, include_hydrogens: bool) -> Self
Include or exclude hydrogen atoms in calculations (default: false)
Sourcepub fn with_radii_file(self, path: &str) -> Result<Self, Error>
pub fn with_radii_file(self, path: &str) -> Result<Self, Error>
Load custom radii configuration from a file (default: uses embedded protor.config)
Sourcepub fn with_allow_vdw_fallback(self, allow: bool) -> Self
pub fn with_allow_vdw_fallback(self, allow: bool) -> Self
Allow fallback to PDBTBX van der Waals radii when radius is not found in radii config file (default: false)
Source§impl SASAOptions<AtomLevel>
impl SASAOptions<AtomLevel>
pub fn atom_level() -> Self
Source§impl SASAOptions<ResidueLevel>
impl SASAOptions<ResidueLevel>
pub fn residue_level() -> Self
Source§impl SASAOptions<ChainLevel>
impl SASAOptions<ChainLevel>
pub fn chain_level() -> Self
Source§impl SASAOptions<ProteinLevel>
impl SASAOptions<ProteinLevel>
pub fn protein_level() -> Self
Source§impl<T: SASAProcessor> SASAOptions<T>
impl<T: SASAProcessor> SASAOptions<T>
Sourcepub fn process(&self, pdb: &PDB) -> Result<T::Output, SASACalcError>
pub fn process(&self, pdb: &PDB) -> Result<T::Output, SASACalcError>
This function calculates the SASA for a given protein. The output type is determined by the level type parameter. Probe radius and n_points can be customized, defaulting to 1.4 and 100 respectively. If you want more fine-grained control you may want to use calculate_sasa_internal instead.
§Example
use pdbtbx::StrictnessLevel;
use rust_sasa::options::{SASAOptions, ResidueLevel};
let (mut pdb, _errors) = pdbtbx::open("./tests/data/pdbs/example.cif").unwrap();
let result = SASAOptions::<ResidueLevel>::new().process(&pdb);Trait Implementations§
Source§impl<T: Clone> Clone for SASAOptions<T>
impl<T: Clone> Clone for SASAOptions<T>
Source§fn clone(&self) -> SASAOptions<T>
fn clone(&self) -> SASAOptions<T>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<T: Debug> Debug for SASAOptions<T>
impl<T: Debug> Debug for SASAOptions<T>
Auto Trait Implementations§
impl<T> Freeze for SASAOptions<T>
impl<T> RefUnwindSafe for SASAOptions<T>where
T: RefUnwindSafe,
impl<T> Send for SASAOptions<T>where
T: Send,
impl<T> Sync for SASAOptions<T>where
T: Sync,
impl<T> Unpin for SASAOptions<T>where
T: Unpin,
impl<T> UnwindSafe for SASAOptions<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more