GOMC parsing

Parsers for extracting alchemical data from GOMC output files.

alchemlyb.parsing.gomc.extract_u_nk(filename: str, T: float) DataFrame[source]

Return reduced potentials u_nk from a Hamiltonian differences dat file.

Parameters:
  • filename (str) – Path to free energy file to extract data from.

  • T (float) – Temperature in Kelvin at which the simulation was sampled.

Returns:

u_nk – Potential energy for each alchemical state (k) for each frame (n).

Return type:

pandas.DataFrame

Changed in version 0.5.0: The scipy.constants is used for parsers instead of the constants used by the corresponding MD engine.

alchemlyb.parsing.gomc.extract_dHdl(filename: str, T: float) DataFrame[source]

Return gradients dH/dl from a Hamiltonian differences free energy file.

Parameters:
  • filename (str) – Path to free energy file to extract data from.

  • T (float) – Temperature in Kelvin at which the simulation was sampled.

Returns:

dH/dl – dH/dl as a function of step for this lambda window.

Return type:

pandas.Series

Changed in version 0.5.0: The scipy.constants is used for parsers instead of the constants used by the corresponding MD engine.

alchemlyb.parsing.gomc.extract(filename: str, T: float) dict[str, DataFrame | None][source]

Return reduced potentials u_nk and gradients dH/dl from a Hamiltonian differences free energy file.

Parameters:
  • xvg (str) – Path to free energy file to extract data from.

  • T (float) – Temperature in Kelvin the simulations sampled.

  • filter (bool) – Filter out the lines that cannot be parsed. Such as rows with incorrect number of Columns and incorrectly formatted numbers (e.g. 123.45.67, nan or -).

Returns:

A dictionary with keys of ‘u_nk’, which is a DataFrame of potential energy for each alchemical state (k) for each frame (n), and ‘dHdl’, which is a Series of dH/dl as a function of time for this lambda window.

Return type:

dict

Added in version 1.0.0.

The parsers featured in this module are constructed to properly parse GOMC free energy output files, containing the Hamiltonian derivatives (\(\frac{dH}{d\lambda}\)) for TI-based estimators and Hamiltonian differences (\(\Delta H\) for all lambda states in the alchemical leg) for FEP-based estimators (BAR/MBAR).

API Reference

This submodule includes these parsing functions:

alchemlyb.parsing.gomc.extract_dHdl(filename: str, T: float) DataFrame[source]

Return gradients dH/dl from a Hamiltonian differences free energy file.

Parameters:
  • filename (str) – Path to free energy file to extract data from.

  • T (float) – Temperature in Kelvin at which the simulation was sampled.

Returns:

dH/dl – dH/dl as a function of step for this lambda window.

Return type:

pandas.Series

Changed in version 0.5.0: The scipy.constants is used for parsers instead of the constants used by the corresponding MD engine.

alchemlyb.parsing.gomc.extract_u_nk(filename: str, T: float) DataFrame[source]

Return reduced potentials u_nk from a Hamiltonian differences dat file.

Parameters:
  • filename (str) – Path to free energy file to extract data from.

  • T (float) – Temperature in Kelvin at which the simulation was sampled.

Returns:

u_nk – Potential energy for each alchemical state (k) for each frame (n).

Return type:

pandas.DataFrame

Changed in version 0.5.0: The scipy.constants is used for parsers instead of the constants used by the corresponding MD engine.

alchemlyb.parsing.gomc.extract(filename: str, T: float) dict[str, DataFrame | None][source]

Return reduced potentials u_nk and gradients dH/dl from a Hamiltonian differences free energy file.

Parameters:
  • xvg (str) – Path to free energy file to extract data from.

  • T (float) – Temperature in Kelvin the simulations sampled.

  • filter (bool) – Filter out the lines that cannot be parsed. Such as rows with incorrect number of Columns and incorrectly formatted numbers (e.g. 123.45.67, nan or -).

Returns:

A dictionary with keys of ‘u_nk’, which is a DataFrame of potential energy for each alchemical state (k) for each frame (n), and ‘dHdl’, which is a Series of dH/dl as a function of time for this lambda window.

Return type:

dict

Added in version 1.0.0.