-
-
Notifications
You must be signed in to change notification settings - Fork 1
Tips for 2D to 3D conversion
MoleditPy provides several ways to generate a 3D structure from a 2D drawing, and to refine it afterward. This page helps you choose between them.
MoleditPy supports multiple external libraries (backends) to generate 3D structures. The choice of library impacts the processing speed and the accuracy of the resulting structure.
| Library | Processing Speed | Structural Accuracy | Key Features |
|---|---|---|---|
| RDKit | Slower (esp. for strained molecules) | Relatively Accurate | Generates chemically plausible initial structures based on Distance Geometry. |
| Open Babel | Very Fast | Requires Re-adjustment | Generates coordinates rapidly, but requires optimization with a force field. |
| Direct Method | Instantaneous | Depends on 2D Drawing | Bypasses 3D embedding. Uses 2D (X,Y) coordinates directly. |
You choose between these from Settings > 3D Conversion (also documented in the User Manual). There is also a Fallback mode (the default), which tries RDKit first, then Open Babel if available, then falls back to Direct — a reasonable default if you don't want to think about it. Set the mode explicitly if you know which backend suits your molecule (e.g. large/strained rings often benefit from starting with Open Babel + re-optimization; molecules where 3D embedding keeps failing benefit from Direct).
Linux note: the
moleditpy-linuxpackage ships with Open Babel disabled to avoid a library-conflict segfault (see Installation for Linux). On Linux, only the RDKit and Direct options are available — the Open Babel entries inSettings>3D Conversionwill be disabled.
RDKit is a powerful cheminformatics library for generating high-quality 3D coordinates.
-
Pros:
- Excels at generating relatively accurate conformations that are chemically plausible, using methods like Distance Geometry.
-
Cons:
- It is computationally more expensive, meaning it tends to be slower when generating 3D structures, especially for large molecules or complex ring systems.
Open Babel is renowned for its high-speed chemical format conversion and structure generation.
-
Pros:
- Generates 3D coordinates very quickly using rule-based methods and proprietary algorithms. It is well-suited for processing large batches of data or for quick previews.
-
Cons:
- The immediately generated 3D structure is not necessarily the most energetically stable conformation.
- Therefore, "re-adjustment" via structure optimization (using a force field like MMFF94 or UFF) is essential afterward to obtain a more realistic structure.
This method is not a generation algorithm; it directly transfers the 2D drawing coordinates into the 3D viewer.
- What it does: This method bypasses all 3D embedding algorithms. It takes the (X, Y) coordinates from the 2D editor canvas, sets the Z-coordinate to 0 for all atoms, and adds hydrogens.
-
Pros:
- Instantaneous processing speed.
- Gives the user total control over the 3D layout by preserving the exact 2D drawing.
-
Cons:
- The resulting structure is "flat" (planar) and possesses no inherent chemical or stereochemical realism (e.g., tetrahedral carbons will be flat).
-
Primary Use Cases:
- This method is extremely powerful for complex structures where standard 2D-to-3D embedding algorithms often fail.
After generating a 3D structure algorithmically, or after modifying it manually, structural adjustments may be necessary.
This feature allows the user to intuitively modify the 3D structure using mouse operations.
- How to use: Select a specific atom in the 3D viewer and drag it with the mouse to freely change its position (and that of connected parts).
-
Primary Use Cases:
- When you want to change a specific dihedral angle to a desired value.
- When you want to intentionally create a specific conformation (e.g., a high-energy state) that is difficult to achieve via automated algorithms.
-
Caution:
- Manual dragging forcibly moves atoms without regard for chemical plausibility (i.e., standard bond lengths and angles).
- As a result, the structure after a drag operation is often in a distorted or strained state, with unnaturally stretched bonds or atoms that are too close together.
This feature automatically corrects distorted structures (from manual dragging) or initial structures (from fast generation like Open Babel) into a chemically more plausible state.
-
Purpose:
- To correct unnatural bond lengths and angles to their standard values.
- To resolve unnecessary atomic clashes (atoms being too close).
- To adjust the structure so that the molecule's overall energy approaches a more stable state.
-
When to Run:
- After manual 3D dragging: This is essential to resolve the structural strain introduced by the drag operation.
- After generating a 3D structure with Open Babel: This is strongly recommended to obtain an energetically stable and realistic structure.
-
Mechanism:
- It uses a Force Field (such as MMFF94 or UFF) to recalculate the coordinates of each atom, minimizing the molecule's overall potential energy. This process relieves strain and moves the structure toward a stable conformation.
- User Manual — the 2D-to-3D conversion and optimization sections in full
- Tips for 3D editing
- Force Field Selection: MMFF vs. UFF
- Installation for Linux — why only RDKit/Direct are available there