molsysmt.basic.info#

molsysmt.basic.info(molecular_system, element='system', selection='all', structure_indices='all', syntax='MolSysMT', output_type='styler', 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, DataFrame, or Dictionary) 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 in any supported MolSysMT format.

  • element (str, default='system') – Structural element level to query (‘atom’, ‘group’, ‘component’, ‘molecule’, ‘chain’, ‘entity’).

  • selection (str, list, tuple, or numpy.ndarray, default='all') – Selection string or boolean/integer array specifying elements.

  • structure_indices (int, list, tuple, or numpy.ndarray, default='all') – Structure indices (0-based) to include or process.

  • syntax (str, default='MolSysMT') – Selection syntax used to evaluate selection (e.g., ‘MolSysMT’, ‘MDTraj’).

  • output_type (str, default='styler') – Representation used for the returned result.

  • skip_digestion (bool, default=False) – Whether to skip MolSysMT’s internal argument digestion mechanism.

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). Its HTML table carries the dataframe class, the same one DataFrame.to_html() emits.

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, including an out-of-range structure index.

Notes

  • Supported molecular-system forms are summarized in Items and 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.

  • The rendered table is tagged with the dataframe class so that notebook viewers and documentation themes style it as they style any other Pandas table. Without it the table matches no theme rule and renders unstyled once compiled to HTML.

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               ion      2        2         2             2         2
2      2-HYDROXYETHYL DISULFIDE   small molecule    8        1         1         1         1
3      BENZENE                    small molecule    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.