ForceBalance API  1.3
Automated optimization of force fields and empirical potentials
List of all members | Public Member Functions | Public Attributes
src.BaseReader Class Reference

The 'reader' class. More...

Inheritance diagram for src.BaseReader:
[legend]
Collaboration diagram for src.BaseReader:
[legend]

Public Member Functions

def __init__ (self, fnm)
 
def Split (self, line)
 
def Whites (self, line)
 
def feed (self, line)
 
def build_pid (self, pfld)
 Returns the parameter type (e.g. More...
 

Public Attributes

 ln
 
 itype
 
 suffix
 
 pdict
 
 adict
 The mapping of (this residue, atom number) to (atom name) for building atom-specific interactions in [ bonds ], [ angles ] etc. More...
 
 molatom
 The mapping of (molecule name) to a dictionary of of atom types for the atoms in that residue. More...
 
 Molecules
 
 AtomTypes
 

Detailed Description

The 'reader' class.

It serves two main functions:

1) When parsing a text force field file, the 'feed' method is called once for every line. Calling the 'feed' method stores the internal variables that are needed for making the unique parameter identifier.

2) The 'reader' also stores the 'pdict' dictionary, which is needed for building the matrix of rescaling factors. This is not needed for the XML force fields, so in XML force fields pdict is replaced with a string called "XML_Override".

Definition at line 85 of file __init__.py.

Constructor & Destructor Documentation

◆ __init__()

def src.BaseReader.__init__ (   self,
  fnm 
)

Definition at line 87 of file __init__.py.

Member Function Documentation

◆ build_pid()

def src.BaseReader.build_pid (   self,
  pfld 
)

Returns the parameter type (e.g.

K in BONDSK) based on the current interaction type.

Both the 'pdict' dictionary (see gmxio.pdict) and the interaction type 'state' (here, BONDS) are needed to get the parameter type.

If, however, 'pdict' does not contain the ptype value, a suitable substitute is simply the field number.

Note that if the interaction type state is not set, then it defaults to the file name, so a generic parameter ID is 'filename.line_num.field_num'

Definition at line 128 of file __init__.py.

◆ feed()

def src.BaseReader.feed (   self,
  line 
)

Definition at line 109 of file __init__.py.

◆ Split()

def src.BaseReader.Split (   self,
  line 
)

Definition at line 103 of file __init__.py.

◆ Whites()

def src.BaseReader.Whites (   self,
  line 
)

Definition at line 106 of file __init__.py.

Member Data Documentation

◆ adict

src.BaseReader.adict

The mapping of (this residue, atom number) to (atom name) for building atom-specific interactions in [ bonds ], [ angles ] etc.

Definition at line 93 of file __init__.py.

◆ AtomTypes

src.BaseReader.AtomTypes

Definition at line 101 of file __init__.py.

◆ itype

src.BaseReader.itype

Definition at line 89 of file __init__.py.

◆ ln

src.BaseReader.ln

Definition at line 88 of file __init__.py.

◆ molatom

src.BaseReader.molatom

The mapping of (molecule name) to a dictionary of of atom types for the atoms in that residue.

self.moleculedict = OrderedDict() The listing of 'RES:ATOMNAMES' for atom names in the line This is obviously a placeholder.

Definition at line 98 of file __init__.py.

◆ Molecules

src.BaseReader.Molecules

Definition at line 100 of file __init__.py.

◆ pdict

src.BaseReader.pdict

Definition at line 91 of file __init__.py.

◆ suffix

src.BaseReader.suffix

Definition at line 90 of file __init__.py.


The documentation for this class was generated from the following file: