neurosnap.structure.prepare module#

Structure-preparation helpers.

This module provides small structure-level preparation utilities plus thin wrappers around the existing PDB2PQR and EvoEF2 preparation backends.

The wrappers intentionally do not reimplement those engines. They expose a structure-oriented API while delegating the underlying chemistry logic to the existing algorithm modules.

neurosnap.structure.prepare.add_hydrogens_with_pdb2pqr(structure, *, forcefield='PARSE', ffout=None, neutraln=False, neutralc=False, debump=True)[source]#

Add hydrogens using the PDB2PQR preparation backend.

This wrapper delegates to neurosnap.algos.pdb2pqr.assign_pqr() with assign_only=False and optimize=False. PDB2PQR may still perform its internal water-specific hydrogen handling, but it skips the full optimization path used by optimize_hydrogens_with_pdb2pqr().

The returned structure is the PDB2PQR-rebuilt structure, so it also carries any charge/radius annotations and provenance metadata that backend emits.

Return type:

Structure

neurosnap.structure.prepare.has_hydrogens(structure)[source]#

Return True if the structure currently contains hydrogen atoms.

Parameters:

structure (Structure) – Input single-model structure.

Return type:

bool

Returns:

True when any atom has element H after simple normalization.

neurosnap.structure.prepare.optimize_hydrogens_with_pdb2pqr(structure, *, forcefield='PARSE', ffout=None, neutraln=False, neutralc=False, debump=True)[source]#

Add and optimize hydrogens using the PDB2PQR preparation backend.

This wrapper delegates to neurosnap.algos.pdb2pqr.assign_pqr() with assign_only=False and optimize=True.

The returned structure is the PDB2PQR-rebuilt structure, so it also carries any charge/radius annotations and provenance metadata that backend emits.

Return type:

Structure

neurosnap.structure.prepare.rebuild_missing_atoms_with_evoef2(structure, *, param_path=None, topo_path=None)[source]#

Rebuild missing heavy atoms and hydrogens using bundled EvoEF2 topology data.

Unlike the scoring implementation in neurosnap.algos.evoef2, this structure-level wrapper uses a local reconstruction backend and returns a native Structure directly.

Return type:

Structure

neurosnap.structure.prepare.strip_hydrogens(structure)[source]#

Return a copy of the structure with hydrogen atoms removed.

Atom-level connectivity tables are subsetted and remapped automatically via Structure.select(), so both bonds and interactions remain consistent with the returned atom table.

Parameters:

structure (Structure) – Input single-model structure.

Return type:

Structure

Returns:

New Structure without hydrogen atoms.