libstructure: functions related to structures

Molecular data structures.

class haddock.libs.libstructure.Molecule(file_name: Path, segid: int | None = None, no_parent: bool = False)[source]

Bases: object

Input molecule, usually a PDB file.

Parameters:
  • file_name (pathlib.Path) – The path to the molecule file.

  • segid (int, optional) – The ID of the segment. Defaults to None.

  • no_parent (boolean) – Whether to add the parent path .. to the haddock.libs.libstructure.Molecule.with_parent. When set to true, the with_parent attribute returns the same as file_name.

haddock.libs.libstructure.find_ff(models: list[PDBFile]) str[source]

Finds the force-field information (all-atom or martini) from the topology associated to the first model. Used in caprieval and caprifilter.

The assumption is that the force-fields will be identical between models.

Parameters:

models (list[PDBFile]) – List of models where to find the topology

Returns:

ff (str) – The force-field used in those models.

haddock.libs.libstructure.make_molecules(paths: Iterable[Path], **kwargs: Any) list[Molecule][source]

Get input molecules from the data stream.