BFEE2.third_party

BFEE2.third_party.py_bar

class BFEE2.third_party.py_bar.ColvarsParser(cvtrj_file: str, step_per_window: int, equilibration_per_window: int, force_constants: List[int], centers: List[int], lambda_list: List[float])[source]

Bases: object

parse Colvars cvtrj files and get the necessary data

get_data() Tuple[List[Tuple[float, float]], List[Tuple[ndarray[tuple[int, ...], dtype[_ScalarType_co]], ndarray[tuple[int, ...], dtype[_ScalarType_co]]]]][source]
get_restraint_contribution() float[source]
class BFEE2.third_party.py_bar.FEPAnalyzer(window_boundaries: List[Tuple[float, float]], deltaU_data: List[Tuple[ndarray[tuple[int, ...], dtype[_ScalarType_co]], ndarray[tuple[int, ...], dtype[_ScalarType_co]]]], temperature: float)[source]

Bases: object

Analyze FEP simulations

BAR_free_energy(tolerance: float = 1e-06, block_size: int = 20, n_bootstrap: int = 20) Tuple[List[Tuple[float, float]], List[ndarray[tuple[int, ...], dtype[_ScalarType_co]]], List[ndarray[tuple[int, ...], dtype[_ScalarType_co]]]][source]

Calculate and return the free-energy change using the BAR estimator

Parameters:
  • tolerance (float) – tolerance of the SCF. Default to 1e-6.

  • block_size (int) – the size of the block in block bootstrap. Default to 10.

  • n_bootstrap (int) – number of bootstrap samples. Default to 20.

Returns:

window boundaries, free energies and errors

Return type:

Tuple[List[Tuple[float, float]], List[NDArray], List[NDArray]]

FEP_free_energy() Tuple[List[Tuple[float, float]], List[ndarray[tuple[int, ...], dtype[_ScalarType_co]]], List[ndarray[tuple[int, ...], dtype[_ScalarType_co]]]][source]

Calculate and return the free-energy change using the FEP equation

Returns:

window boundaries, free energies and errors

Return type:

Tuple[List[Tuple[float, float]], List[NDArray], List[NDArray]]

MergeData(window_boundaries: List[Tuple[float, float]], deltaU_data: List[Tuple[ndarray[tuple[int, ...], dtype[_ScalarType_co]], ndarray[tuple[int, ...], dtype[_ScalarType_co]]]]) bool[source]
Merge the exist dU with another one. Used in FEP + Colvars_FEP tasks.

window boundaries and the number of deltaU in a window must be the same

Parameters:
  • window_boundaries (List[Tuple[float, float]]) – boundaries of each window

  • deltaU_data (List[Tuple[NDArray, NDArray]]) – deltaU for forward and backward simulations of each window. The two deltaU should be opposite numbers.

Returns:

Whether merge is successful

Return type:

bool

Window_boundaries() List[Tuple[float, float]][source]

Get the boundaries of windows

Returns:

windows boundaries

Return type:

List[Tuple[float, float]]

class BFEE2.third_party.py_bar.NAMDParser(forward_file: str, backward_file: str | None = '')[source]

Bases: object

parse NAMD .fepout files and get the necessary data

get_data() Tuple[List[Tuple[float, float]], List[Tuple[ndarray[tuple[int, ...], dtype[_ScalarType_co]], ndarray[tuple[int, ...], dtype[_ScalarType_co]]]]][source]

return the boundary and deltaU of each window

Returns:

recording the boundary and

deltaU of each window of bidirectional simulations

Return type:

Tuple[List[Tuple[float, float]], List[Tuple[NDArray, NDArray]]]