stream_molecules_from_file

openff.nagl.toolkits.openff.stream_molecules_from_file(file: str, file_format: str = None, explicit_hydrogens: bool = True, as_smiles: bool = False, mapped_smiles: bool = False, include_sdf_data: bool = True, toolkit_registry=NAGL_TOOLKIT_REGISTRY)[source]

Stream molecules from a file.

Parameters:
  • file (str) – The path to the file.

  • file_format (str, optional) – The file format. If not provided, the format will be guessed from the file extension.

  • explicit_hydrogens (bool, optional) – Keep explicit hydrogens if molecule are output as SMILES.

  • as_smiles (bool, optional) – If True, return the molecules as SMILES strings.

  • mapped_smiles (bool, optional) – If True, return mapped smiles with atom indices

  • include_sdf_data (bool, optional) – If SDF tag data (e.g. charges) should be included in the molecule properties

  • toolkit_registry – The toolkit registry to use.

Returns:

molecules (Generator[openff.toolkit.topology.Molecule or str]) – A generator of openff.toolkit.topology.Molecule objects or SMILES strings