Lomap MCS throws ValueError if rdkit.Mol created from SMILES
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
Research direction
Start in lomap/mcs.py at trim_mcs_mol, best_substruct_match_to_mcs, and substructure_centre, following the reported Bad Conformer Id path. Reproduce the issue with RDKit molecules created from SMILES and compare it with the Mol2-based example. Done means MCS accepts the SMILES-created molecules and returns a mapping without raising ValueError.
Written by the indexing model from the issue text.
Description
from rdkit import Chem
from lomap import mcs
test_dir = "/Users/dwhs/omsf/src/openfe/openfe/tests/data/lomap_basic/"
toluene = Chem.MolFromMol2File(test_dir + "toluene.mol2")
methylcyclohexane = Chem.MolFromMol2File(test_dir + "methylcyclohexane.mol2")
mapping = mcs.MCS(toluene, methylcyclohexane)
# behaves as desired
toluene2 = Chem.MolFromSmiles(Chem.MolToSmiles(toluene))
methylcyclohexane2 = Chem.MolFromSmiles(Chem.MolToSmiles(methylcyclohexane))
mapping = mcs.MCS(toluene2, methylcyclohexane2)
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
~/mambaforge/envs/openfe/lib/python3.9/site-packages/lomap/mcs.py in __init__(self, moli, molj, time, verbose, max3d, threed)
586 try:
--> 587 trim_mcs_mol(max_deviation=max3d)
588 except Exception as e:
~/mambaforge/envs/openfe/lib/python3.9/site-packages/lomap/mcs.py in trim_mcs_mol(max_deviation)
156 while True:
--> 157 (mapi,mapj) = best_substruct_match_to_mcs(self._moli_noh, self._molj_noh, by_rmsd=True)
158 # Compute the translation to bring molj's centre over moli
~/mambaforge/envs/openfe/lib/python3.9/site-packages/lomap/mcs.py in best_substruct_match_to_mcs(moli, molj, by_rmsd)
121 if by_rmsd:
--> 122 coord_delta = (substructure_centre(moli,mapi)
123 - substructure_centre(molj,mapj))
~/mambaforge/envs/openfe/lib/python3.9/site-packages/lomap/mcs.py in substructure_centre(mol, mol_sub)
90 for i in mol_sub:
---> 91 sum += mol.GetConformer().GetAtomPosition(i)
92 return sum / len(mol_sub)
ValueError: Bad Conformer Id
During handling of the above exception, another exception occurred:
ValueError Traceback (most recent call last)
/var/folders/vj/28c107496sq5z4y10rjz5gdm0000gn/T/ipykernel_30741/2330220248.py in <module>
1 toluene2 = Chem.MolFromSmiles(Chem.MolToSmiles(toluene))
2 methylcyclohexane2 = Chem.MolFromSmiles(Chem.MolToSmiles(methylcyclohexane))
----> 3 mapping = mcs.MCS(toluene2, methylcyclohexane2)
~/mambaforge/envs/openfe/lib/python3.9/site-packages/lomap/mcs.py in __init__(self, moli, molj, time, verbose, max3d, threed)
587 trim_mcs_mol(max_deviation=max3d)
588 except Exception as e:
--> 589 raise ValueError(str(e))
590
591 # Trim the MCS further to remove chirality mismatches
ValueError: Bad Conformer Id
- Dominant language
- Python
- Stars
- 45
- Forks
- 15
- Avg merge
- 18h 11m
- Merged PRs (30d)
- 4
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from OpenFreeEnergy/Lomap
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
OpenFreeEnergy/Lomap#180 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 82/100
OpenFreeEnergy/Lomap#127 ·
-
Ring-related LOMAP rules: origin, behaviour and inconsistenciesPossibly taken @jthorton claimed this 17 days ago. Open
OpenFreeEnergy/Lomap#178 · 2 assignees ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 55/100
OpenFreeEnergy/Lomap#167 ·
-
Deprecate DBMoleculesMay be free again @IAlibay claimed this 156 days ago, and no pull request is open. Open
OpenFreeEnergy/Lomap#149 · 8 comments · 1 assignee ·
All issues in OpenFreeEnergy/Lomap
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
gorakhargosh/watchdog#1462 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
openwisp/openwisp-monitoring#889 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
roman-corgi/corgisim#327 ·
Maintainers usually reply within 2 days
-
agent:WSL bug code-review linux pri:medium sev:low tooling
Difficulty 2/5 Half a day Newbie friendliness 62/100
Maintainers usually reply within 1 day
-
[Bug]: opencode_go chat route drops reasoning_effort (even 'none'), while the same endpoint honors it via custom_llm_provider=openaiPossibly taken @arvindkumar-ship-it claimed this today. Openllm translation
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
BerriAI/litellm#51871 · 1 comment ·
Maintainers usually reply within 1 day