neurosnap.structure.interactions module#

Interaction analysis helpers for Neurosnap structures.

neurosnap.structure.interactions.analyze_interactions(structure, *entities, interaction_types=None, contact_cutoff_a=4.5, vdw_tolerance_a=0.5, clash_overlap_a=0.4, include_hydrogens=False, covalent_candidates=False, covalent_lower_factor=0.8, covalent_upper_factor=1.2, disulfide_cutoff=2.2, salt_bridge_cutoff=4.0, hbond_donor_acceptor_cutoff=3.5, hbond_angle_cutoff=130.0, metal_coordination_cutoff=2.8, include_candidates=False)[source]#

High-level interaction analyzer orchestrator.

Parameters:
  • structure (Structure) – Input single-model Structure.

  • *entities (InteractionEntity) – Positional InteractionEntity objects to analyze.

  • interaction_types (Optional[List[str]]) – Interaction types to analyze. Defaults to conservative [“contact”, “covalent”].

  • contact_cutoff_a (float) – Maximum contact cutoff distance.

  • vdw_tolerance_a (float) – Tolerance added to VDW radii sum.

  • clash_overlap_a (float) – Overlap distance to classify VDW clash.

  • include_hydrogens (bool) – Whether to include hydrogens.

  • covalent_candidates (bool) – Whether to calculate covalent candidate interactions.

  • covalent_lower_factor (float) – Lower factor for covalent candidate bond distance.

  • covalent_upper_factor (float) – Upper factor for covalent candidate bond distance.

  • disulfide_cutoff (float) – Cutoff distance for disulfide bonds.

  • salt_bridge_cutoff (float) – Cutoff distance for salt bridges.

  • hbond_donor_acceptor_cutoff (float) – Cutoff distance for hydrogen bonds.

  • hbond_angle_cutoff (float) – Minimum angle for hydrogen bonds.

  • metal_coordination_cutoff (float) – Cutoff distance for metal coordination.

  • include_candidates (bool) – Whether to include candidate interactions.

Return type:

InteractionReport

Returns:

InteractionReport containing deterministically sorted records and center summaries.

neurosnap.structure.interactions.calculate_hydrogen_bonds(structure, chain=None, chain_other=None, *, donor_acceptor_cutoff=3.5, angle_cutoff=120.0)[source]#

Count hydrogen bonds using explicit hydrogens and simple geometric cutoffs.

This is a legacy helper maintained alongside the analyze_interactions() engine.

Parameters:
  • structure (Structure) – Input single-model Structure.

  • chain (Optional[str]) – Optional donor-chain ID. When omitted, all chains are searched.

  • chain_other (Optional[str]) – Optional acceptor-chain ID for inter-chain counting. Both must be provided if chain_other is specified.

  • donor_acceptor_cutoff (float) – Maximum donor-acceptor distance in Å.

  • angle_cutoff (float) – Minimum donor-H-acceptor angle in degrees.

Return type:

int

Returns:

Total number of hydrogen bonds that satisfy the geometric cutoffs.

neurosnap.structure.interactions.calculate_interface_hydrogen_bonding_residues(structure, chain=None, chain_other=None, *, donor_acceptor_cutoff=3.5, angle_cutoff=120.0)[source]#

Count unique residues that participate in inter- or intra-chain hydrogen bonds.

This is a legacy helper maintained alongside the analyze_interactions() engine.

Parameters:
  • structure (Structure) – Input single-model Structure.

  • chain (Optional[str]) – Optional donor-chain ID. When omitted, all chains are searched.

  • chain_other (Optional[str]) – Optional acceptor-chain ID for inter-chain counting.

  • donor_acceptor_cutoff (float) – Maximum donor-acceptor distance in Å.

  • angle_cutoff (float) – Minimum donor-H-acceptor angle in degrees.

Return type:

int

Returns:

Number of unique residues that participate in at least one qualifying hydrogen bond.

neurosnap.structure.interactions.find_disulfide_bonds(structure, chain=None, threshold=2.05)[source]#

Find disulfide bonds between cysteine residues using SG-SG distance.

This is a legacy helper maintained alongside the analyze_interactions() engine.

Parameters:
  • structure (Structure) – Input single-model Structure.

  • chain (Optional[str]) – Optional chain ID to restrict the search to.

  • threshold (float) – Maximum SG-SG distance in Å used to classify a disulfide bond.

Return type:

List[Tuple[Residue, Residue]]

Returns:

List of (residue1, residue2) cysteine pairs that satisfy the distance cutoff.

neurosnap.structure.interactions.find_hydrophobic_residues(structure, chain=None)[source]#

Return hydrophobic residues from a single structure.

Parameters:
  • structure (Structure) – Input single-model Structure.

  • chain (Optional[str]) – Optional chain ID to restrict the search to.

Return type:

List[Tuple[str, Residue]]

Returns:

List of (chain_id, residue) tuples for residues classified as hydrophobic.

neurosnap.structure.interactions.find_salt_bridges(structure, chain=None, cutoff=4.0)[source]#

Identify salt bridges using charged side-chain atoms/groups.

This is a legacy helper maintained alongside the analyze_interactions() engine.

Parameters:
  • structure (Structure) – Input single-model Structure.

  • chain (Optional[str]) – Optional chain ID to restrict the search to. When None, both intra- and inter-chain salt bridges are returned. When specified, only salt bridges where both residues are within the specified chain are returned.

  • cutoff (float) – Maximum atom/group distance in Å used to classify a salt bridge.

Return type:

List[Tuple[Residue, Residue]]

Returns:

List of (positive_residue, negative_residue) pairs that satisfy the ionic contact rules.