vermouth.rcsu.go_structure_bias module

Obtain the structural bias for the Go model.

class vermouth.rcsu.go_structure_bias.ComputeStructuralGoBias(contact_map, cutoff_short, cutoff_long, go_eps, res_dist, moltype, res_graph=None)[source]

Bases: Processor

Generate the Go model structural bias for a system of molecules. This processor class has two main functions: .contact_selector and .compute_bias. The .run_molecule function simply loops over all molecules in the system and calls the other two functions. The computed structural bias parameters are stored in system.gmx_topology_params and can be written out using the vermouth.gmx.write_topology function.

Subclassing

In order to customize the Go-model structural bias it is recommended to subclass this function and overwrite the contact_selector method and/or the compute_bias method. This subclassed Processor then has to be added to the into the martinize2 pipeline in place of the StructuralBiasWriter or as replacement in the GoPipeline.

Initialize the Processor with arguments required to setup the Go model structural bias.

param contact_map:

list of contacts defined as by the chain identifier and residue index

type contact_map:

list[(str, int, str, int)]

param cutoff_short:

distances in nm smaller than this are ignored

type cutoff_short:

float

param cutoff_long:

distances in nm larger than this are ignored

type cutoff_long:

float

param go_eps:

epsilon value of the structural bias in kJ/mol

type go_eps:

float

param res_dist:

if nodes are closer than res_dist along the residue graph they are ignored; this is similar to sequence distance but takes into account disulfide bridges for example

type res_dist:

int

param moltype:

name of the molecule to treat

type moltype:

str

param res_graph:

residue graph of the molecule; if None it gets generated automatically

type res_graph:

vermouth.molecule.Molecule

param system:

the system

type system:

vermouth.system.System

param magic_number:

magic number for Go contacts from the old GoVirt script.

type magic_number:

float

compute_go_interaction(contacts)[source]

Compute the epsilon value given a distance between two nodes, figure out the atomtype name and store it in the systems attribute gmx_topology_params.

Parameters:

contacts (list[(str, str, float)]) – list of node-keys and their distance

Returns:

dict[frozenset(str, str) – dict of interaction parameters indexed by atomtype

Return type:

float]

contact_selector(molecule)[source]

Select all contacts from the contact map that according to their distance and graph connectivity are elegible to form a Go bond and create exclusions between the backbone beads of those contacts.

Parameters:

molecule (vermouth.molecule.Molecule)

Returns:

list of node keys and distance

Return type:

list[(collections.abc.Hashable, collections.abc.Hashable, float)]

run_molecule(molecule)[source]
run_system(system)[source]

Process system.

Parameters:

system (vermouth.system.System) – The system to process. Is modified in-place.