ModificationLibrary

Module

viennaptm.modification.modification_library
class ModificationLibrary(library_path: str | Path = None, metadata_path: str | Path = None, pdbs_minimized: str | Path = None)

Bases: BaseModel

Container and loader for residue modifications and template structures.

The ModificationLibrary loads application definitions from a JSON library file and associates them with minimized Biopython PDB template structure. It provides indexed access to modifications and utilities for loading template residues.

Variables:
  • modifications (list[Modification]) – List of available residue modifications.

  • metadata (ModificationLibraryMetadata) – Metadata of the library.

  • target_templates (dict[str, str]) – Mapping of residue abbreviations to PDB file paths.

load_residue_from_pdb(target_abbreviation: str) Residue

Load a template residue from a minimized PDB file.

The PDB file must contain exactly one residue whose name matches the requested target abbreviation.

Parameters:

target_abbreviation (str) – Residue abbreviation to load.

Returns:

Template residue.

Return type:

Residue

Raises:

ValueError – If the PDB file does not contain exactly one matching residue.

metadata: ModificationLibraryMetadata
model_config = {'extra': 'forbid'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

modifications: List[Modification]
target_templates: Dict[str, str]

Methods

__init__([library_path, metadata_path, ...])

Create a new model by parsing and validating input data from keyword arguments.

construct([_fields_set])

copy(*[, include, exclude, update, deep])

Returns a copy of the model.

dict(*[, include, exclude, by_alias, ...])

from_orm(obj)

json(*[, include, exclude, by_alias, ...])

load_residue_from_pdb(target_abbreviation)

Load a template residue from a minimized PDB file.

model_construct([_fields_set])

Creates a new instance of the Model class with validated data.

model_copy(*[, update, deep])

!!! abstract "Usage Documentation"

model_dump(*[, mode, include, exclude, ...])

!!! abstract "Usage Documentation"

model_dump_json(*[, indent, ensure_ascii, ...])

!!! abstract "Usage Documentation"

model_json_schema(by_alias, ref_template, ...)

Generates a JSON schema for a model class.

model_parametrized_name(params)

Compute the class name for parametrizations of generic classes.

model_post_init(context, /)

Override this method to perform additional initialization after __init__ and model_construct.

model_rebuild(*[, force, raise_errors, ...])

Try to rebuild the pydantic-core schema for the model.

model_validate(obj, *[, strict, extra, ...])

Validate a pydantic model instance.

model_validate_json(json_data, *[, strict, ...])

!!! abstract "Usage Documentation"

model_validate_strings(obj, *[, strict, ...])

Validate the given object with string data against the Pydantic model.

parse_file(path, *[, content_type, ...])

parse_obj(obj)

parse_raw(b, *[, content_type, encoding, ...])

schema([by_alias, ref_template])

schema_json(*[, by_alias, ref_template])

update_forward_refs(**localns)

validate(value)