epsman.elecStructure.util module
ePSman electronic structure utility functions
Utility functions for use with ePSman.
24/01/24 v1
See also ../_util.py for general utility functions
- epsman.elecStructure.util.readMoldenGeoms(fileName, keyWord='[Atoms]', skiprowsOffset=0, nrowType='auto', widths=[2, 7, 7, 20, 20, 20], names=['Ind', 'Species', 'Atomic Num.', 'x', 'y', 'z'], verbose=0)[source]
Read geometry/ies in Molden format.
- Parameters:
fileName (str or Path object) – File to read.
keyWord (str, default = '[Atoms]') – Keyword to search for in file. Default case flags Molden geometry sections. If multiple sections are found they will all be read in.
skiprowsOffset (int, default = 0) – Additional header rows to skip. Default case
nrowType (str or int, default = 'auto') – If ‘auto’ tries to read all lines until next section. If an int, read this number of lines after keyWord.
widths (list, default = [2,7,7,20,20,20]) – Column widths, passed to pd.read_fwf() for reading sections. Default case for normal Molden format.
names (list, default = ['Ind','Species','Atomic Num.','x','y','z']) – Columns names. Default case matches epsman.elecStructure.gamess.getAtoms()
- Returns:
Contains geometries keyed by integer, as Pandas DataFrames. Also key ‘details’ for metadata.
- Return type:
dict
Notes
RDkit doesn’t read Molden format.
RDkit does support a range of other file types, [x,y,z] might be sufficient? https://www.rdkit.org/docs/source/rdkit.Chem.rdmolfiles.html#rdkit.Chem.rdmolfiles.MolFromXYZFile
RDkit does support Pandas, but only for table of molecules output? E.g. https://xinhaoli74.github.io/blog/rdkit/2021/01/06/rdkit.html#PandasTools, http://rdkit.org/docs/source/rdkit.Chem.PandasTools.html
CCLIB writes, but doesn’t read, Molden format. Could still be used for conversion to SDF for RDkit…?