API reference for init_dics submodule#

Module to initialize dictionaries used in the program.

buildh.init_dics.init_dic_OP(universe_woH, dic_atname2genericname, lipid_top, ignore_CH3s)#

Initialize the dictionary of result (dic_op).

Initialize also the dictionary of correspondance between residue number (resid) and its index in dic_OP (dic_corresp_numres_index_dic_OP).

To calculate the error, we need to first average over the trajectory, then over residues. Thus in dic_OP, we want for each key a list of lists, for example:

OrderedDict([
            (('C1', 'H11'), [[], [], ..., [], []]),
            (('C1', 'H12'), [[], ..., []]),
            ...
            ])

Thus each sublist will contain OPs for one residue:

('C1', 'H11'), [[OP res 1 frame1, OP res1 frame2, ...],
                [OP res 2 frame1, OP res2 frame2, ...],
                ...]

If the flag ignore_CH3s is on, OP will not be computed for CH pairs belonging to a CH3 group. The dic_OP will not contain those pairs and they will be deleting from the dic_atname2genericname dic.

Parameters
  • universe_woH (MDAnalysis universe instance) – This is the universe without hydrogen.

  • dic_atname2genericname (ordered dictionary) – dict of correspondance between generic H names and PDB names.

  • lipid_top (dictionary) – lipid topology for hydrogen.

  • ignore_CH3s (bool) – Don’t compute the OP on CH3s if True.

Returns

  • ordered dictionary – Each key of this dict is a couple carbon/H, and at the beginning it contains an empty list.

  • dictionary – contains the correspondance between the residue number and its index in dic_op

buildh.init_dics.make_dic_Cname2Hnames(dic_OP)#

Initialize a dictionary of hydrogens bound to a carbon.

Each key is a carbon and the value is a tuple of hydrogens bound to it.

Note

If there is more than 1 H for a given C, they need to be ordered like in the PDB. e.g. for CHARMM POPC :

{'C13': ('H13A', 'H13B', 'H13C'), 'C33': ('H3X', 'H3Y'),
 'C216': ('H16R', 'H16S'), ...}
Parameters

dic_OP (ordered dictionary) – structure holding the calculated order parameter.

Returns

the constructed dictionary.

Return type

dictionary

buildh.init_dics.make_dic_atname2genericname(filename)#

Make a dict of correspondance between generic H names and PDB names.

This dict will look like the following: {(‘C1’, ‘H11’): ‘gamma1_1’, …}. Useful for outputing OP with generic names (such as beta1, beta 2, etc.).

Note

Such files can be found on the NMRlipids MATCH repository: https://github.com/NMRLipids/MATCH/tree/master/scripts/orderParm_defs.

Parameters

filename (str) – Filename containing OP definition (e.g. Berger_POPC.def).

Returns

Keys are tuples of (C, H) name, values generic name (as described above in this docstring). The use of an ordered dictionary ensures we get always the same order in the output OP.

Return type

Ordered dictionary