moldescriptor_reader¶
A module for reading moldescriptor files.
Summary¶
Classes:
This is a class to read moldescriptor files. |
Reference¶
- class MoldescriptorReader(filename: str)[source]¶
Bases:
BaseReaderThis is a class to read moldescriptor files. Moldescriptor files are used by the PQ and QMCFC MD engines to store the mol types of a system. The moldescriptor file is a text file that contains the mol types of a system. The mol types are defined by the elements, atom types and partial charges of the atoms of the mol type. For more information of how a moldescriptor file should look like please see the documentation of the PQ code.
Calling the read method returns a list of mol types. Each mol type is a
Residueobject.The lines
WATER_TYPE nandAMMONIA_TYPE nof the file name the mol type (by its number, i.e. theidof the residue) of the water and the ammonia molecules. They are available after reading as the attributeswater_typeandammonia_type(None if the line is missing). They only point to a mol type of the file, the mol type itself still needs its own entry.- Parameters:
filename (str) – The filename of the moldescriptor file.
- read() Residues[source]¶
The read method reads a moldescriptor file and returns a list of mol types. Each mol type is a
Residueobject.- Returns:
The residues (mol types) read from the moldescriptor file.
- Return type:
- Raises:
MoldescriptorReaderError – If the number of columns in the header of a mol type is not 3.
MoldescriptorReaderError – If a mol type declares more atoms than atom lines follow before the end of the file.
MoldescriptorReaderError – If the number of a WATER_TYPE or AMMONIA_TYPE line is not an integer.
Notes
A warning is logged if the water type does not point to a mol type of the file or the mol type is not made of the three atoms O, H and H in this order (as PQ requires), and if the ammonia type does not point to a mol type of the file.
- ammonia_type¶
The mol type number of the ammonia molecules.
- Type:
int | None
- logger = <CustomLogger PQAnalysis.MoldescriptorReader (INFO)>¶
- water_type¶
The mol type number of the water molecules.
- Type:
int | None