Convenience structure-filtering functions.
- neurosnap.structure.filters.fix_nucleic_termini(structure, *, strip_3prime=False, chain=None)[source]#
Normalize nucleotide phosphate names and strip terminal phosphate atoms.
- Parameters:
structure (
Structure) – InputStructure.strip_3prime (
bool) – IfTrue, also removeO3PandOP3from 3’ termini.chain (
Optional[str]) – Optional chain ID to restrict processing to.
- Returns:
None. The input structure is modified in-place.
- neurosnap.structure.filters.remove_atoms(structure, predicate, *, chain=None)[source]#
Remove atoms from a structure in-place when they match a predicate.
- Parameters:
structure (
Structure) – InputStructure.predicate (
Callable) – Callable that accepts an atom view and returnsTruewhen that atom should be removed.chain (
Optional[str]) – Optional chain ID to restrict atom removal to.
- Returns:
None. The input structure is modified in-place.
- neurosnap.structure.filters.remove_chains(structure, predicate)[source]#
Remove chains from a structure in-place when they match a predicate.
- Parameters:
structure (
Structure) – InputStructure.predicate (
Callable) – Callable that accepts a chain view and returnsTruewhen that chain should be removed.
- Returns:
None. The input structure is modified in-place.
- neurosnap.structure.filters.remove_non_biopolymers(structure, *, chain=None)[source]#
Remove non-biopolymer residues from a structure in-place.
- Parameters:
structure (
Structure) – InputStructure.chain (
Optional[str]) – Optional chain ID to restrict residue removal to.
- Returns:
None. The input structure is modified in-place.
Notes
Residues are preserved when they classify as valid protein or nucleotide polymer components, even if they were parsed as hetero atoms. Ambiguous placeholders such as
ASX,GLX,XLE, andUNKare removed. Common protonation or tautomer states such asHIDandHIEare preserved.
- neurosnap.structure.filters.remove_nucleotides(structure, *, chain=None)[source]#
Remove DNA and RNA residues from a structure in-place.
- Parameters:
structure (
Structure) – InputStructure.chain (
Optional[str]) – Optional chain ID to restrict residue removal to.
- Returns:
None. The input structure is modified in-place.
- neurosnap.structure.filters.remove_residues(structure, predicate, *, chain)[source]#
Remove residues from a structure in-place when they match a predicate.
- Parameters:
structure (
Structure) – InputStructure.predicate (
Callable) – Callable that accepts a residue view and returnsTruewhen that residue should be removed.chain (
Optional[str]) – Optional chain ID to restrict residue removal to.
- Returns:
None. The input structure is modified in-place.
- neurosnap.structure.filters.remove_waters(structure, *, chain=None)[source]#
Remove water residues from a structure in-place.
- Parameters:
structure (
Structure) – InputStructure.chain (
Optional[str]) – Optional chain ID to restrict residue removal to.
- Returns:
None. The input structure is modified in-place.