iodata.formats.mol2 module

MOL2 file format.

There are different formats of mol2 files. Here the compatibility with AMBER software was the main objective to write out files with atomic charges used by antechamber.

dump_many(f, datas)[source]

Dump multiple frames into a MOL2 file.

Parameters:
  • f (TextIO) – A writeable file object.

  • datas (Iterator[IOData]) – An iterator over IOData instances which must have the following attributes initialized: atcoords, atnums, atcharges. If the following attributes are present, they are also dumped into the file: title.

Notes

dump_one(f, data)[source]

Dump a single frame into a MOL2 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: atcharges, atffparams, title.

Notes

load_many(lit)[source]

Load multiple frames from a MOL2 file.

Parameters:

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

Yields:

result (dict) – A dictionary with IOData attributes. The following attribtues are guaranteed to be loaded: atcoords, atnums, atcharges, atffparams. The following may be loaded if present in the file: title.

Return type:

Iterator[dict]

Notes

load_one(lit)[source]

Load a single frame from a MOL2 file.

Parameters:

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

Returns:

result – A dictionary with IOData attributes. The following attributes are guaranteed to be loaded: atcoords, atnums, atcharges, atffparams. The following may be loaded if present in the file: title.

Return type:

dict

Notes