protex.update.StateUpdate

class protex.update.StateUpdate(updateMethod: Update, prob_function: str | None = None)[source]

Bases: object

Controls the update scheme and proposes the residues that need an update.

Methods

dump

Pickle the StateUpdate instance.

get_charges

_summary_.

get_num_residues

Deprecated 1.1.

load

Load a pickled StateUpdate instance.

update

Updates the current state using the method defined in the UpdateMethod class.

write_charges

Write current charges to a file.

dump(fname: str) None[source]

Pickle the StateUpdate instance.

Parameters:

fname (str) – The file name

get_charges() list[source]

_summary_.

Returns:

atom_idxs, atom object, charge

Return type:

list

Raises:

RuntimeError – If system does not contain a nonbonded force

get_num_residues() dict[source]

Deprecated 1.1.

static load(fname: str, updateMethod: Update) StateUpdate[source]

Load a pickled StateUpdate instance.

Parameters:
  • fname (str) – The file name

  • updateMethod (Update) – The update method instance

Returns:

An instance of StateUpdate

Return type:

StateUpdate

update(nr_of_steps: int = 2) list[tuple[protex.residue.Residue, protex.residue.Residue]][source]

Updates the current state using the method defined in the UpdateMethod class.

Parameters:

nr_of_steps (int, optional) – The number of intermediate \({\lambda}\) states. The default of two means 1 with the initial and one with the final state, so no intermediate states, by default 2

Returns:

A list with all the updated residue tuples

Return type:

list[tuple[Residue, Residue]]

write_charges(filename: str) None[source]

Write current charges to a file.

Parameters:

filename (str) – The name of the file to wrtie the charges to