molsysmt.native package#
Submodules#
molsysmt.native.file_tng module#
molsysmt.native.file_xtc module#
molsysmt.native.gro_file_handler module#
- class molsysmt.native.gro_file_handler.GROAtomicCoordinateEntry[source]#
Bases:
objectIn-memory representation of a GRO coordinate entry.
molsysmt.native.h5msm_file_handler module#
- class molsysmt.native.h5msm_file_handler.H5MSMFileHandler(filename, io_mode='r', creator='MolSysMT', compression='gzip', compression_opts=4, int_precision='single', float_precision='single', length_unit=None, time_unit=None, energy_unit=None, temperature_unit=None, charge_unit=None, mass_unit=None, closed=False, skip_digestion=False)[source]#
Bases:
objectLightweight handler for reading and writing h5msm files.
molsysmt.native.molecular_mechanics module#
- class molsysmt.native.molecular_mechanics.MolecularMechanics(forcefield=None, water_model=None, implicit_solvent=None, non_bonded_method=None, cutoff_distance=None, switch_distance=None, dispersion_correction=None, ewald_error_tolerance=None, constraints=None, flexible_constraints=None, rigid_water=None, hydrogen_mass=None, salt_concentration=None, kappa=None, solute_dielectric=None, solvent_dielectric=None, formal_charge=None, partial_charge=None)[source]#
Bases:
objectContainer for molecular mechanics force-field settings.
molsysmt.native.molecular_mechanics_dict module#
molsysmt.native.molsys module#
- class molsysmt.native.molsys.MolSys(n_atoms=0, n_groups=0, n_components=0, n_molecules=0, n_entities=0, n_chains=0, n_bonds=0, skip_digestion=False)[source]#
Bases:
objectContainer holding native topology, structures, and molecular mechanics data.
- add(item, atom_indices='all', structure_indices='all', keep_ids=True, skip_digestion=False)[source]#
Append topology and structures from another MolSys.
- add_missing_bonds(threshold='2 angstroms', selection='all', structure_indices=0, syntax='MolSysMT', engine='MolSysMT', with_templates=True, with_distances=True, skip_digestion=False)[source]#
Fill missing bonds inferred from the current coordinates.
- append_structures(item, atom_indices='all', structure_indices='all', skip_digestion=False)[source]#
Append structures from another MolSys while aligning atom indices.
- extract(atom_indices='all', structure_indices='all', copy_if_all=True, skip_digestion=False)[source]#
Return a copy or subset of the molecular system.
- get(element='system', selection='all', structure_indices='all', mask=None, syntax='MolSysMT', get_missing_bonds=True, output_type='values', skip_digestion=False, **kwargs)[source]#
Proxy to
molsysmt.get()using this MolSys as input.
- info(element='system', selection='all', syntax='MolSysMT', skip_digestion=False)[source]#
Return a text summary of the MolSys.
- rebuild_atoms(redefine_ids=True, redefine_types=True)[source]#
Recompute atom ids/types from the present topology.
- rebuild_chains(redefine_ids=True, redefine_types=True)[source]#
Recompute chain ids/types from the present topology.
- rebuild_components(redefine_ids=True, redefine_types=True)[source]#
Recompute component ids/types from the present topology.
- rebuild_entities(redefine_ids=True, redefine_types=True)[source]#
Recompute entity ids/types from the present topology.
- rebuild_groups(redefine_ids=True, redefine_types=True)[source]#
Recompute group ids/types from the present topology.
- rebuild_molecules(redefine_ids=True, redefine_types=True)[source]#
Recompute molecule ids/types from the present topology.
molsysmt.native.pdb_atomic_coordinate_entry module#
- class molsysmt.native.pdb_atomic_coordinate_entry.ConnectivityAnnotationSection[source]#
Bases:
object
- class molsysmt.native.pdb_atomic_coordinate_entry.CrystallographicAndCoordinateTransformationSection[source]#
Bases:
object
- class molsysmt.native.pdb_atomic_coordinate_entry.HetatmRecord[source]#
Bases:
AtomRecord
- class molsysmt.native.pdb_atomic_coordinate_entry.MiscellaneousFeaturesSection[source]#
Bases:
object
molsysmt.native.pdb_file_handler module#
- class molsysmt.native.pdb_file_handler.PDBFileHandler(file, io_mode='r', closed=False, skip_digestion=False)[source]#
Bases:
objectHandle reading and writing PDB coordinate files.
molsysmt.native.simulation module#
- class molsysmt.native.simulation.Simulation(molecular_system=None, remove_cm_motion=True, integrator=None, temperature=None, collisions_rate=None, integration_timestep=None, initial_velocities_to_temperature=True, constraint_tolerance=1e-05, platform='CUDA', cuda_precision='mixed')[source]#
Bases:
objectContainer for simulation parameters used to build OpenMM objects.
- get_openmm_Context_parameters()[source]#
Return keyword arguments required to build an OpenMM Context.
- get_openmm_Simulation_parameters()[source]#
Return keyword arguments required to build an OpenMM Simulation.
- set_parameters(return_non_processed=False, **kwargs)[source]#
Standardize and set allowed parameters from keyword arguments.
molsysmt.native.simulation_dict module#
molsysmt.native.structures module#
- class molsysmt.native.structures.Structures(constant_time_step=False, time_step=None, constant_id_step=False, id_step=None, constant_box=False, structure_id=None, time=None, coordinates=None, velocities=None, box=None, b_factor=None, alternate_location=None, bioassembly=None, temperature=None, potential_energy=None, kinetic_energy=None, skip_digestion=False)[source]#
Bases:
objectStoring per-structure data (coordinates, box, time, energies) for a molecular system.
- add(item, atom_indices='all', structure_indices='all', skip_digestion=False)[source]#
Concatenate atomic data from another Structures object along the atom axis.
- append(structure_id=None, time=None, coordinates=None, velocities=None, box=None, temperature=None, potential_energy=None, kinetic_energy=None, b_factor=None, alternate_location=None, atom_indices='all', structure_indices='all', skip_digestion=False)[source]#
Append one or more structures and associated metadata to this object.
- append_structures(item, atom_indices='all', structure_indices='all', skip_digestion=False)[source]#
Append structures from another Structures object.
- extract(atom_indices='all', structure_indices='all', copy_if_all=False, skip_digestion=False)[source]#
Returns a new Structures object with the specified atoms and/or structures.
- Parameters:
atom_indices (str or arraylike of int, default='all') – The indices of the extracted atoms.
structure_indices (str or arraylike of int, default='all') – The indices of the extracted structures or frames.
- Returns:
The new structures object with the extracted atoms and frames.
- Return type:
molsysmt.native.structures_dict module#
molsysmt.native.topology module#
- class molsysmt.native.topology.Atoms_DataFrame(n_atoms=0)[source]#
Bases:
DataFramePandas DataFrame wrapper storing atom-level topology fields.
- class molsysmt.native.topology.Bonds_DataFrame(n_bonds=0)[source]#
Bases:
DataFramePandas DataFrame wrapper storing bond connectivity.
- class molsysmt.native.topology.Chains_DataFrame(n_chains=0)[source]#
Bases:
DataFramePandas DataFrame wrapper storing chain-level fields.
- class molsysmt.native.topology.Components_DataFrame(n_components=0)[source]#
Bases:
DataFramePandas DataFrame wrapper storing component-level fields.
- class molsysmt.native.topology.Entities_DataFrame(n_entities=0)[source]#
Bases:
DataFramePandas DataFrame wrapper storing entity-level fields.
- class molsysmt.native.topology.Groups_DataFrame(n_groups=0)[source]#
Bases:
DataFramePandas DataFrame wrapper storing group-level fields.
- class molsysmt.native.topology.Molecules_DataFrame(n_molecules=0)[source]#
Bases:
DataFramePandas DataFrame wrapper storing molecule-level fields.
- class molsysmt.native.topology.Topology(n_atoms=0, n_groups=0, n_components=0, n_molecules=0, n_entities=0, n_chains=0, n_bonds=0, skip_digestion=False)[source]#
Bases:
objectNative topology container including atoms, groups, chains, and bonds.
- add(item, atom_indices='all', keep_ids=True, skip_digestion=False)[source]#
Append another topology, offsetting indices as needed.
- add_bonds(bonded_atom_pairs, skip_digestion=False)[source]#
Append new bonds given atom index pairs.
- add_missing_bonds(selection='all', syntax='MolSysMT', skip_digestion=False)[source]#
Infer and add missing bonds using geometric templates.
- compare(item, rule='equal', output_type='boolean', skip_digestion=False, **kwargs)[source]#
Compare topology content with another topology.
- extract(atom_indices='all', copy_if_all=False, skip_digestion=False)[source]#
Return a subset topology with the selected atoms and associated hierarchy.
- rebuild_atoms(redefine_ids=True, redefine_types=True)[source]#
Regenerate atom ids/types from names and current counts.
- rebuild_chains(redefine_indices=True, redefine_ids=True, redefine_types=True, redefine_names=True)[source]#
Rebuild chain mapping and metadata.
- rebuild_components(redefine_indices=True, redefine_ids=True, redefine_names=True, redefine_types=True)[source]#
Rebuild component mapping and metadata.
- rebuild_entities(redefine_indices=True, redefine_ids=True, redefine_names=True, redefine_types=True)[source]#
Rebuild entity mapping and metadata.
- rebuild_groups(redefine_ids=True, redefine_types=True)[source]#
Regenerate group ids/types from names and current counts.
- rebuild_molecules(redefine_indices=True, redefine_ids=True, redefine_names=True, redefine_types=True, molecules_as_components=True)[source]#
Rebuild molecule mapping and metadata.
molsysmt.native.trajectory_file module#
molsysmt.native.universal_json module#
- class molsysmt.native.universal_json.UniversalJSON(data=<factory>, compressed=False, compression='none', schema=<factory>)[source]#
Bases:
objectStoring a general JSON representation of a molecular system (molsysmt.UniversalJSON).
The data dict follows a broad schema: - metadata: unitless descriptive fields. - topology: per-atom columns (ids, names, group/chain/entity ids, element symbols, charges). - bonds: atom_pairs (0-based) plus optional order. - coordinates: collections with structures, each holding coordinates (nm), optional time
(ps), and optional box (vectors v0, v1, v2 in nm).
annotations: optional derived data.
compression/compressed control optional gzip serialization. Use to_dict(copy=True) for a JSON-compatible dict and copy() for deep copies.
- Parameters:
data (Dict[str, Any])
compressed (bool)
compression (Literal['none', 'gzip'])
schema (Dict[str, str])
- compressed: bool = False#
- compression: Literal['none', 'gzip'] = 'none'#
- data: Dict[str, Any]#
- dump(fp, *, indent=None, compression=None)[source]#
Write content to a file path or file-like as JSON (optionally gzipped).
- Parameters:
fp (str | TextIO)
indent (int | None)
compression (Literal['none', 'gzip'] | None)
- Return type:
None
- dumps(indent=None)[source]#
Return a JSON text representation.
- Parameters:
indent (int | None)
- Return type:
str
- schema: Dict[str, str]#
molsysmt.native.viewer_json module#
- class molsysmt.native.viewer_json.ViewerJSON(data=<factory>, compressed=False, compression='none', schema=<factory>)[source]#
Bases:
objectStoring a minimal viewer-friendly JSON payload (molsysmt.ViewerJSON).
The underlying data dict follows the viewer schema:
atoms: per-atom columns (ids/names/group/chain/entity ids, element symbol, optional charges). All ids/names are strings; charges are unitless integers.
bonds: atom_pairs (0-based index pairs) and optional order.
structures: list of structures with coordinates (nm), optional time (ps), and optional box with box vectors (v0, v1, v2 in nm).
compression/compressed control optional gzip serialization. Use to_dict(copy=True) to get a JSON-compatible dict and copy() for deep copies.
- Parameters:
data (Dict[str, Any])
compressed (bool)
compression (Literal['none', 'gzip'])
schema (Dict[str, str])
- compressed: bool = False#
- compression: Literal['none', 'gzip'] = 'none'#
- data: Dict[str, Any]#
- dump(fp, *, indent=None, compression=None)[source]#
Write content to a file path or file-like as JSON (optionally gzipped).
- Parameters:
fp (str | TextIO)
indent (int | None)
compression (Literal['none', 'gzip'] | None)
- Return type:
None
- dumps(indent=None)[source]#
Return a JSON text representation.
- Parameters:
indent (int | None)
- Return type:
str
- schema: Dict[str, str]#