ProteinMotion
Reference navigation
On this page

CLASS · v0.9.1

ContactMatch

Store an ordered residue correspondence and its search report.

python
from proteinmotion import ContactMatch

Constructor

python
ContactMatch(
    source_indices: np.ndarray,
    target_indices: np.ndarray,
    report: dict,
    source_keys: tuple,
    target_keys: tuple,
)

Parameters

ParameterDefaultDescription
source_indicesnp.ndarrayRequiredStrictly increasing zero-based source topology residue indices.
target_indicesnp.ndarrayRequiredStrictly increasing zero-based target topology residue indices.
reportdictRequiredDictionary with matching statistics, search status, and optimality information.
source_keystupleRequiredSource residue identity tuples stored for validation.
target_keystupleRequiredTarget residue identity tuples stored for validation.

Notes

Use match_backbones() or from_pairs() to create a correspondence. Both residue-index arrays are read-only. save() and load() preserve correspondence and validation identities.

Attributes

NameDescription
source_indicesStrictly increasing zero-based source topology residue indices.
target_indicesStrictly increasing zero-based target topology residue indices.
reportDictionary with matching statistics, search status, and optimality information.
source_keysSource residue identity tuples stored for validation.
target_keysTarget residue identity tuples stored for validation.

Methods and properties

NameDescription
from_pairs()class methodCreate an explicit correspondence from at least three increasing residue-index pairs.
load()class methodLoad a saved JSON correspondence. BackboneMorph validates it against the structures.
save()methodSave residue correspondences, identities, and the report as JSON.
python
ContactMatch.from_pairs(source, target, source_indices, target_indices)

Create an explicit correspondence from at least three increasing residue-index pairs.

ParameterDefaultDescription
sourceRequiredSource Protein.
targetRequiredObject to animate or use as a destination. The supported object type depends on the operation.
source_indicesRequiredStrictly increasing zero-based source topology residue indices.
target_indicesRequiredStrictly increasing zero-based target topology residue indices.

Returns: ContactMatch

python
ContactMatch.load(path)

Load a saved JSON correspondence. BackboneMorph validates it against the structures.

ParameterDefaultDescription
pathRequiredInput or output file path, as specified by the operation.

Returns: ContactMatch

python
ContactMatch.save(path)

Save residue correspondences, identities, and the report as JSON.

ParameterDefaultDescription
pathRequiredInput or output file path, as specified by the operation.

Returns: None