pub fn calculate_sasa(pdbtbx_struct: PDB) -> Vec<ExtendedRes>Expand description
Calculates the Solvent Accessible Surface Area (SASA) for a given PDB structure.
This function performs SASA calculations for each atom in the structure and aggregates the results at the residue level. It also calculates relative SASA values based on standard accessible surface areas for each residue type.
§Arguments
pdbtbx_struct- A mutable reference to apdbtbx::PDBstructure.
§Returns
A Vec<ExtendedRes> containing SASA information for each residue in the structure.
§Panics
This function will panic if:
- The number of atoms in the pdbtbx structure doesn’t match the number of atoms in the SASA calculation.
- A residue name is encountered that doesn’t have a corresponding relative accessibility value.
§Steps
- Calculates SASA for each atom using the freesasa library.
- Creates
ExtendedAtominstances for each atom, storing SASA values. - Aggregates atom SASA values into
ExtendedResinstances for each residue. - Calculates relative SASA values for backbone, side chain, and total residue.
§Notes
- The function modifies the input
pdbtbx_structby setting B-factors to SASA values. - SASA calculations are performed using the freesasa library with error-only verbosity.
- Relative SASA values are calculated based on standard accessible surface areas defined in
REL_ASA.