molsysmt.basic.info#
- molsysmt.basic.info(molecular_system, element='system', selection='all', syntax='MolSysMT', skip_digestion=False)[source]#
Display a summary table of a molecular system or selected elements.
This function produces a formatted summary table (as a Pandas Styler) with key attributes of a molecular system, either for the whole system or for a given element level and selection. The columns returned depend on the chosen element and on the attributes available in the underlying form(s).
- Parameters:
molecular_system (molecular system) – Molecular system to analyze, in any of the supported forms.
element ({'atom', 'group', 'component', 'molecule', 'chain', 'entity', 'system'}, default 'system') – Hierarchical level for which the summary is generated.
selection (int, tuple, list, numpy.ndarray or str, default 'all') – Selection of elements at the specified level. It can be a 0-based index collection or a selection string parsed according to Selection syntaxes.
syntax (str, default 'MolSysMT') – Selection syntax used when selection is a string. See Selection syntaxes.
skip_digestion (bool, default False) –
Whether to skip MolSysMT’s internal argument digestion mechanism.
MolSysMT includes a built-in digestion system that validates and normalizes function arguments. This process checks types, shapes, and values, and automatically adjusts them when possible to meet expected formats.
Setting skip_digestion=True disables this process, which may improve performance in workflows where inputs are already validated. Use with caution: only set this to True if you are certain all input arguments are correct and consistent.
- Returns:
A Pandas Styler wrapping a DataFrame with the summary. The exact columns depend on element and on the attributes exposed by the input form(s).
- Return type:
pandas.io.formats.style.Styler
- Raises:
NotSupportedFormError – If the molecular system has an unsupported form.
ArgumentError – If any input argument is invalid or inconsistent.
Notes
Supported molecular-system forms are summarized in Forms.
Selection strings must follow one of the syntaxes described in Selection syntaxes.
The function hides the row index for readability using Pandas’ Styler API; you can access the underlying DataFrame via the .data attribute (depending on your Pandas version) or by rebuilding it from the original values if needed.
See also
molsysmt.basic.select()
Select elements from a molecular system.
molsysmt.basic.get()
Retrieve values of attributes from a molecular system.
molsysmt.basic.get_form()
Retrieve the form of a molecular system.
Examples
>>> import molsysmt as msm >>> from molsysmt import systems >>> molsys = msm.convert(systems['T4 lysozyme L99A']['181l.h5msm']) >>> print(msm.info(molsys, element='entity').to_string()) index name type n atoms n groups n components n chains n molecules 0 T4 LYSOZYME protein 1289 162 1 1 1 1 CHLORIDE ION unknown 2 2 2 2 2 2 2-HYDROXYETHYL DISULFIDE unknown 8 1 1 1 1 3 BENZENE unknown 6 1 1 1 1 4 water water 136 136 136 1 136 >>> # If you are working in a Jupyter notebook, you can simply run: >>> # msm.info(molsys, element='entity') >>> # And the table will be displayed in a nicely formatted style by Pandas.
Tutorial with more examples
See the following tutorial for a practical demonstration of how to use this function, along with additional examples: Info.
Added in version 1.0.0.