calculate_sasa

Function calculate_sasa 

Source
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 a pdbtbx::PDB structure.

§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

  1. Calculates SASA for each atom using the freesasa library.
  2. Creates ExtendedAtom instances for each atom, storing SASA values.
  3. Aggregates atom SASA values into ExtendedRes instances for each residue.
  4. Calculates relative SASA values for backbone, side chain, and total residue.

§Notes

  • The function modifies the input pdbtbx_struct by 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.