Skip to content

Add functionality to create OFFMols with specific indexing #448

@j-wags

Description

@j-wags

Is your feature request related to a problem? Please describe.
Many people have requested the ability to create OFFMols with specified atom orderings. Most commonly, this is in the context of Canonical, isomeric, explicit hydrogen, mapped SMILES, which we attach to OFF-submitted molecules in QCArchive. However, people have also requested the ability to reorder the atoms from a molecule that already has an indexing system (like, an SDF).

Describe the solution you'd like
This is two similar requests in one:

  • Molecule.from_object(obj, index_map=dict(current_idx:new_idx): Be able to read a molecule with a defined indexing system (like, from SDF), but have the created OFFMol have a different atom/bond ordering.
  • Molecule.from_mapped_smiles(mapped_smiles): Read an explicit-hydrogen, fully mapped SMILES, and create an OFFMol with that atom ordering.
    • Needs to check+fail if H's aren't explicit.

For both functions, we'll need to resolve what to do if the map indices don't begin at 1, of if the numbering system has gaps. For now, a reasonable behavior is probably just "fail".

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions