The base workflow

The alchemlyb.workflows.base.WorkflowBase provides a basic API template for the workflow development. The workflow should be able to run in an automatic fashion.

>>> from alchemlyb.workflows.base import WorkflowBase
>>> workflow = WorkflowBase(units='kT', software='Gromacs', T=298,
    out='./', *args, **kwargs)
>>> workflow.run(*args, **kwargs)

Three main functions are provided such that the workflow could be run in a step-by-step fashion.

>>> from alchemlyb.workflows.base import WorkflowBase
>>> workflow = WorkflowBase(units='kT', software='Gromacs', T=298,
    out='./', *args, **kwargs)
>>> workflow.read(*args, **kwargs)
>>> workflow.preprocess(*args, **kwargs)
>>> workflow.estimate(*args, **kwargs)
>>> workflow.check_convergence(*args, **kwargs)
>>> workflow.plot(*args, **kwargs)

API Reference

class alchemlyb.workflows.base.WorkflowBase(units='kT', software='Gromacs', T=298, out='./', *args, **kwargs)

The base class for the Workflow.

This is the base class for the creation of new Workflow. The initialisation method takes in the MD engine, unit, temperature and output directory. The goal of the initialisation is to check the input files and store them in file_list such that they can be read by the read() method.

Parameters
  • units (string, optional) – The unit used for printing and plotting results. {‘kcal/mol’, ‘kJ/mol’, ‘kT’}. Default: ‘kT’.

  • software (string, optional) – The software used for generating input. {‘Gromacs’, ‘Amber’}

  • T (float, optional,) – Temperature in K. Default: 298.

  • out (string, optional) – Directory in which the output files produced by this script will be stored. Default: ‘./’.

file_list

A list of files to be read by the parser.

Type

list

run(*args, **kwargs)

Run the workflow in an automatic fashion.

This method would execute the read(), preprocess(), estimate(), check_convergence(), plot() sequentially such that the whole analysis could be done automatically.

This method takes in an arbitrary number of arguments and pass all of them to the underlying methods. The methods will be selecting the keywords that they would like to use.

Running this method would generate the resulting attributes for the user to retrieve the results.

u_nk_list

A list of pandas.DataFrame of u_nk.

Type

list

dHdl_list

A list of pandas.DataFrame of dHdl.

Type

list

u_nk_sample_list

A list of pandas.DataFrame of the subsampled u_nk.

Type

list

dHdl_sample_list

A list of pandas.DataFrame of the subsampled dHdl.

Type

list

result

The main result of the workflow.

Type

pandas.Dataframe

convergence

The result of the convergence analysis.

Type

pandas.Dataframe

read(*args, **kwargs)

The function that reads the files in file_list and parse them into u_nk and dHdl files.

u_nk_list

A list of pandas.DataFrame of u_nk.

Type

list

dHdl_list

A list of pandas.DataFrame of dHdl.

Type

list

preprocess(*args, **kwargs)

The function that subsample the u_nk and dHdl in u_nk_list and dHdl_list.

u_nk_sample_list

A list of pandas.DataFrame of the subsampled u_nk.

Type

list

dHdl_sample_list

A list of pandas.DataFrame of the subsampled dHdl.

Type

list

estimate(*args, **kwargs)

The function that runs the estimator based on u_nk_sample_list and dHdl_sample_list.

result

The main result of the workflow.

Type

pandas.Dataframe

check_convergence(*args, **kwargs)

The function for doing convergence analysis.

convergence

The result of the convergence analysis.

Type

pandas.Dataframe

plot(*args, **kwargs)

The function for producing any plots.