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 function.


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:


param cutoff_long:

distances in nm larger than this are ignored

type cutoff_long:


param go_eps:

epsilon value of the structural bias in kJ/mol

type go_eps:


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:


param moltype:

name of the molecule to treat

type moltype:


param res_graph:

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

type res_graph:


param system:

the system

type system:


param magic_number:

magic number for Go contacts from the old GoVirt script.

type magic_number:



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.


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


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

Return type:



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.


molecule (vermouth.molecule.Molecule)


list of node keys and distance

Return type:

list[(,, float)]


Process system.


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