libontology: module communication

Describe the Haddock3 ontology used for communicating between modules.

class haddock.libs.libontology.Format(value)[source]

Bases: Enum

Input and Output possible formats.

CNS_INPUT = 'inp'
CNS_OUTPUT = 'out'
MATRIX = 'matrix'
PDB = 'pdb'
PDB_ENSEMBLE = 'pdb'
TOPOLOGY = 'psf'
class haddock.libs.libontology.ModuleIO[source]

Bases: object

Intercommunicating modules and exchange input/output information.

add(persistent, mode='i')[source]

Add a given filename as input or output.

check_faulty() float[source]

Check how many of the output exists.

load(filename: str | Path) None[source]

Load the content of a given IO filename.

remove_missing() None[source]

Remove missing structure from output.

retrieve_models(crossdock: bool = False, individualize: bool = False) list[Union[haddock.libs.libontology.PDBFile, list[haddock.libs.libontology.PDBFile]]][source]

Retrieve the PDBobjects to be used in the module.

save(path: str | Path = '.', filename: str | Path = 'io.json') Path[source]

Save Input/Output needed files by this module to disk.

class haddock.libs.libontology.PDBFile(file_name: Path | str, topology: Any | None = None, path: Path | str = '.', score: float = nan, md5: str | None = None, restr_fname: str | Path | None = None, unw_energies: dict[str, float] | None = None)[source]

Bases: Persistent

Represent a PDB file.

class haddock.libs.libontology.PDBPathT

Generic type variable for PDBFile or Path.

If the first annotated variable is PDBFile, the second annotated variable will be PDBFile instead of Path,vice versa.

alias of TypeVar(‘PDBPathT’, bound=Union[PDBFile, Path])

class haddock.libs.libontology.Persistent(file_name: str | Path, file_type: Format, path: str | Path = '.', md5: str | None = None, restr_fname: str | Path | None = None)[source]

Bases: object

Any persistent file generated by this framework.

is_present() bool[source]

Check if the persisent file exists on disk.

class haddock.libs.libontology.RMSDFile(file_name: str | Path, npairs: int, path: str | Path = '.')[source]

Bases: Persistent

Represents a RMSD matrix file.

class haddock.libs.libontology.TopologyFile(file_name: str | Path, path: str | Path = '.')[source]

Bases: Persistent

Represent a CNS-generated topology file.