molsysmt.structure package#
Submodules#
molsysmt.structure.align_principal_axes module#
- molsysmt.structure.align_principal_axes.align_principal_axes(molecular_system, selection='all', principal_axes_of_selection=None, principal_axes_type='inertia', structure_indices='all', weights=None, axes=[[1, 0, 0], [0, 1, 0], [0, 0, 1]], center=False, syntax='MolSysMT', engine='MolSysMT', in_place=False)[source]#
Aligning selected atoms to reference principal axes.
- Parameters:
molecular_system (molecular system) – System whose coordinates will be rotated.
selection (str, list, tuple or numpy.ndarray, default 'all') – Atoms to rotate.
principal_axes_of_selection (str, list, tuple or numpy.ndarray, optional) – Atoms used to compute principal axes; defaults to selection.
principal_axes_type ({'inertia'}, default 'inertia') – Type of principal axes to compute.
structure_indices ('all' or array-like, default 'all') – Structures/frames to align.
weights (array-like, optional) – Weights for axis computation.
axes (array-like shape (3,3), default identity) – Target axes to align to.
center (bool, default False) – If True, recenter coordinates after rotation.
syntax (str, default 'MolSysMT') – Selection syntax when using strings.
engine ({'MolSysMT'}, default 'MolSysMT') – Backend.
in_place (bool, default False) – If True, modify the input system; otherwise return a rotated copy.
- Returns:
Rotated system when in_place=False, otherwise None.
- Return type:
molecular system or None
- Raises:
NotImplementedMethodError – If an unsupported engine is requested.
.. versionadded: – 1.0.0:
molsysmt.structure.center module#
molsysmt.structure.flip module#
molsysmt.structure.get_angles module#
- molsysmt.structure.get_angles.get_angles(molecular_system, triplets, structure_indices='all', pbc=False, skip_digestion=False)[source]#
Calculating bond angles for given atom triplets.
- Parameters:
molecular_system (molecular system) – System providing coordinates.
triplets (numpy.ndarray) – Array of shape (n_triplets, 3) with atom indices defining each angle.
structure_indices ('all' or array-like, default 'all') – Structures/frames to compute over.
pbc (bool, default False) – Whether to apply minimum image convention using the box.
skip_digestion (bool, default False) – Whether to skip argument digestion.
- Returns:
Angles in radians as a PyUnitWizard quantity.
- Return type:
quantity
molsysmt.structure.get_center module#
- molsysmt.structure.get_center.get_center(molecular_system, selection='all', weights=None, structure_indices='all', syntax='MolSysMT', engine='MolSysMT', skip_digestion=False)[source]#
Computing centers (centroids or weighted centers) of atom selections.
- Parameters:
molecular_system (molecular system) – Input system.
selection (str, list, tuple or numpy.ndarray, default 'all') – Atoms (or groups of atoms) to center; nested iterables are treated as groups.
weights (array-like, optional) – Weights per atom (or concatenated per group) when computing centers.
structure_indices ('all' or array-like, default 'all') – Structures/frames over which centers are computed.
syntax (str, default 'MolSysMT') – Selection syntax when using strings.
engine ({'MolSysMT'}, default 'MolSysMT') – Backend.
skip_digestion (bool, default False) – Whether to skip argument digestion.
- Returns:
Centers as a PyUnitWizard quantity in length units.
- Return type:
quantity
- Raises:
NotImplementedMethodError – If an unsupported engine is requested.
.. versionadded: – 1.0.0:
molsysmt.structure.get_contacts module#
- molsysmt.structure.get_contacts.get_contacts(molecular_system, selection=None, center_of_atoms=False, weights=None, structure_indices='all', selection_2=None, center_of_atoms_2=False, weights_2=None, structure_indices_2=None, threshold='12 angstroms', pairs=False, pbc=True, syntax='MolSysMT', output_type='numpy.ndarray', output_indices=None, skip_digestion=False)[source]#
To be written soon…
molsysmt.structure.get_dihedral_angles module#
molsysmt.structure.get_distances module#
- molsysmt.structure.get_distances.get_distances(molecular_system, selection='all', structure_indices='all', center_of_atoms=False, weights=None, molecular_system_2=None, selection_2=None, structure_indices_2=None, center_of_atoms_2=False, weights_2=None, pairs=False, pbc=True, output_type='numpy.ndarray', output_indices=None, output_structure_indices=None, engine='MolSysMT', syntax='MolSysMT', skip_digestion=False)[source]#
Computing distances between atoms or centers of selections.
- Parameters:
molecular_system (molecular system) – First system (or the only one if molecular_system_2 is None).
selection (str, list, tuple or numpy.ndarray, default 'all') – Atom selections for each system; if pairs=True, a list/array of index pairs is also accepted.
selection_2 (str, list, tuple or numpy.ndarray, default 'all') – Atom selections for each system; if pairs=True, a list/array of index pairs is also accepted.
structure_indices ('all' or array-like, default 'all') – Structures/frames to analyze (0-based) for each system.
structure_indices_2 ('all' or array-like, default 'all') – Structures/frames to analyze (0-based) for each system.
center_of_atoms (bool, default False) – If True, use centers of the selected atoms (weighted if weights provided).
center_of_atoms_2 (bool, default False) – If True, use centers of the selected atoms (weighted if weights provided).
weights (array-like, optional) – Weights for centers when center_of_atoms is True.
weights_2 (array-like, optional) – Weights for centers when center_of_atoms is True.
molecular_system_2 (molecular system, optional) – Second system; if None, distances are computed within molecular_system.
pairs (bool, default False) – If True, interpret selection (or selection/selection_2) as explicit pairs.
pbc (bool, default True) – Whether to consider periodic boundary conditions.
output_type ({'numpy.ndarray', 'dictionary'}, default 'numpy.ndarray') – Format of the returned distances.
output_indices ({'selection', 'atom', 'group'}, optional) – When output_type=’dictionary’, controls labeling of indices.
output_structure_indices ({'structure'}, optional) – When output_type=’dictionary’, controls labeling of structure indices.
engine ({'MolSysMT'}, default 'MolSysMT') – Backend for the calculation.
syntax (str, default 'MolSysMT') – Selection syntax when using strings.
skip_digestion (bool, default False) – Whether to skip argument digestion.
- Returns:
Distances with shape (n_structures, n_selection[, n_selection_2]) or structured dictionaries, depending on output_type.
- Return type:
numpy.ndarray or dict
- Raises:
NotImplementedMethodError – If a requested path/output is not supported.
Notes
Uses minimum image convention when pbc=True and box is available.
When pairs=True, expects explicit pairs; otherwise Cartesian products of selections are used.
Added in version 1.0.0.
molsysmt.structure.get_least_rmsd module#
molsysmt.structure.get_maximum_distances module#
- molsysmt.structure.get_maximum_distances.get_maximum_distances(molecular_system, selection='all', center_of_atoms=False, weights=None, as_entity=True, structure_indices='all', molecular_system_2=None, selection_2=None, center_of_atoms_2=False, weights_2=None, as_entity_2=True, structure_indices_2=None, pairs=False, pbc=False, engine='MolSysMT', syntax='MolSysMT')[source]#
To be written soon…
molsysmt.structure.get_minimum_distances module#
- molsysmt.structure.get_minimum_distances.get_minimum_distances(molecular_system, selection='all', center_of_atoms=False, weights=None, as_entity=True, structure_indices='all', molecular_system_2=None, selection_2=None, center_of_atoms_2=False, weights_2=None, as_entity_2=True, structure_indices_2=None, pairs=False, pbc=False, engine='MolSysMT', syntax='MolSysMT', skip_digestion=False)[source]#
To be written soon…
molsysmt.structure.get_neighbors module#
- molsysmt.structure.get_neighbors.get_neighbors(molecular_system, selection='all', structure_indices='all', center_of_atoms=False, weights=None, molecular_system_2=None, selection_2=None, structure_indices_2=None, center_of_atoms_2=False, weights_2=None, threshold=None, n_neighbors=None, pairs=False, unique_pairs=False, mutual_only=False, pbc=True, output_type='numpy.ndarray', output_indices=None, output_structure_indices=None, sorted=True, engine='MolSysMT', syntax='MolSysMT', skip_digestion=False)[source]#
To be written soon…
molsysmt.structure.get_principal_axes module#
- molsysmt.structure.get_principal_axes.get_principal_axes(molecular_system, selection='all', structure_indices='all', weights=None, principal_axes_type='inertia', syntax='MolSysMT', engine='MolSysMT')[source]#
Computing principal axes for a selection of atoms.
- Parameters:
molecular_system (molecular system) – Input system.
selection (str, list, tuple or numpy.ndarray, default 'all') – Atoms used for axis computation.
structure_indices ('all' or array-like, default 'all') – Structures/frames to evaluate.
weights (array-like, optional) – Weights per atom.
principal_axes_type ({'inertia', 'geometric'}, default 'inertia') – Kind of principal axes to compute.
syntax (str, default 'MolSysMT') – Selection syntax when using strings.
engine ({'MolSysMT'}, default 'MolSysMT') – Backend.
- Returns:
(axes, moments) where axes has shape (n_structures, 3, 3) and moments are variances or inertia moments.
- Return type:
tuple
- Raises:
NotImplementedMethodError – If the engine is unsupported.
.. versionadded: – 1.0.0:
molsysmt.structure.get_radius_of_gyration module#
molsysmt.structure.get_rmsd module#
molsysmt.structure.least_rmsd_align module#
- molsysmt.structure.least_rmsd_align.least_rmsd_align(molecular_system, selection='atom_name=="CA"', structure_indices='all', reference_molecular_system=None, reference_selection=None, reference_structure_index=0, syntax='MolSysMT', engine_sequence_alignment='Biopython', engine_least_rmsd_fit='MolSysMT', in_place=False, skip_digestion=False)[source]#
To be written soon…
molsysmt.structure.least_rmsd_fit module#
- molsysmt.structure.least_rmsd_fit.least_rmsd_fit(molecular_system=None, selection='all', selection_fit='atom_type!="H"', structure_indices='all', reference_molecular_system=None, reference_selection_fit=None, reference_structure_index=0, to_form=None, in_place=False, syntax='MolSysMT', engine='MolSysMT', skip_digestion=False)[source]#
To be written soon…
molsysmt.structure.move_away module#
- molsysmt.structure.move_away.move_away(molecular_system, selection='all', center_of_selection='all', weights=None, structure_indices=0, reference_molecular_system=None, reference_center_of_selection='all', reference_weights=None, reference_structure_indices=None, direction=None, distance='3 angstroms', in_place=False, syntax='MolSysMT', skip_digestion=False)[source]#
To be written soon..
molsysmt.structure.principal_component_analysis module#
- molsysmt.structure.principal_component_analysis.principal_component_analysis(molecular_system, selection='all', structure_indices='all', weights=None, syntax='MolSysMT', engine='MolSysMT', skip_digestion=False)[source]#
Performing principal component analysis (PCA) on selected atoms.
- Parameters:
molecular_system (molecular system) – Input system.
selection (str, list, tuple or numpy.ndarray, default 'all') – Atoms to include in the PCA.
structure_indices ('all' or array-like, default 'all') – Structures/frames to analyze.
weights (array-like, optional) – Weights per atom.
syntax (str, default 'MolSysMT') – Selection syntax when using strings.
engine ({'MolSysMT'}, default 'MolSysMT') – Backend.
skip_digestion (bool, default False) – Whether to skip argument digestion.
- Returns:
(principal_components, variances) as returned by the backend.
- Return type:
tuple
- Raises:
NotImplementedMethodError – If the engine is unsupported.
.. versionadded: – 1.0.0:
molsysmt.structure.rotate module#
molsysmt.structure.set_dihedral_angles module#
molsysmt.structure.shift_dihedral_angles module#
molsysmt.structure.show_contacts module#
- molsysmt.structure.show_contacts.show_contacts(molecular_system, selection=None, center_of_atoms=False, weights=None, structure_indices='all', selection_2=None, center_of_atoms_2=False, weights_2=None, structure_indices_2=None, threshold='12 angstroms', pbc=False, syntax='MolSysMT', style='plotly', show=True, skip_digestion=False)[source]#
Visualize a contact map between two selections.
- Parameters:
molecular_system (molecular system) – Input system to analyze.
selection (str, list, tuple, numpy.ndarray or None) – Atom selections (MolSysMT syntax or indices). If selection_2 is None, contacts are computed within selection.
selection_2 (str, list, tuple, numpy.ndarray or None) – Atom selections (MolSysMT syntax or indices). If selection_2 is None, contacts are computed within selection.
center_of_atoms (bool, default False) – Whether to use centers of groups of atoms for each selection.
center_of_atoms_2 (bool, default False) – Whether to use centers of groups of atoms for each selection.
weights (array-like, optional) – Weights for centers if center_of_atoms is True.
weights_2 (array-like, optional) – Weights for centers if center_of_atoms is True.
structure_indices ('all' or array-like) – Structures/frames to analyze (0-based).
structure_indices_2 ('all' or array-like) – Structures/frames to analyze (0-based).
threshold (quantity or str, default '12 angstroms') – Distance cutoff for defining contacts.
pbc (bool, default False) – Whether to consider periodic boundary conditions.
syntax (str, default 'MolSysMT') – Selection syntax when using strings.
style ({'plotly', 'matplotlib'}, default 'plotly') – Backend for visualization.
show (bool, default True) – If True, render the figure; otherwise return it.
skip_digestion (bool, default False) – Whether to skip argument digestion.
- Returns:
The figure object (Plotly Figure or Matplotlib Figure) or the result of fig.show() when show=True.
- Return type:
object