iodata.formats.sdf module

SDF file format.

Usually, the different frames in a trajectory describe different geometries of the same molecule, with atoms in the same order. The load_many and dump_many functions below can also handle an SDF file with different molecules, e.g. a molecular database.

dump_many(f, datas)[source]

Dump multiple frames into a SDF file.

Parameters
  • f (Textio) – A writeable file object.

  • data – An IOData instance which must have the following attributes initialized: atcoords, atnums. If the following attributes are present, they are also dumped into the file: title.

None

dump_one(f, data)[source]

Dump a single frame into a SDF file.

Parameters
  • f (Textio) – A writeable file object.

  • data (IOData) – An IOData instance which must have the following attributes initialized: atcoords, atnums. If the following attributes are present, they are also dumped into the file: title.

Notes

None

load_many(lit)[source]

Load a single frame from a SDF file.

Parameters

lit (LineIterator) – The line iterator to read the data from.

Returns

A dictionary with IOData attributes. The following attributes are guaranteed to be loaded: atcoords, atnums, title.

Return type

data

Notes

load_one(lit)[source]

Load a single frame from a SDF file.

Parameters

lit (LineIterator) – The line iterator to read the data from.

Returns

A dictionary with IOData attributes. The following attributes are guaranteed to be loaded: atcoords, atnums, title.

Return type

data

Notes