You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Chem.rdmolfiles.MaeMolSupplier reads more molecules than is actually in the file.
If you try to read until file exhaustion it never stops reading.
################### Schrodinger Suite Reads the File #######################
from schrodinger import structure
from rdkit import Chem
import datetime
reader = structure.StructureReader('pm7_1212_0_out.mae')
sts = [x for x in reader]
print("total molecules = %s" % len(sts))
total_mols = len(sts)
# total molecules = 5225
################### rdkit will just keep reading forever #######################
suppl = Chem.rdmolfiles.MaeMolSupplier('pm7_1212_0_out.mae')
start_time = datetime.datetime.now()
mols = []
for i, m in enumerate(suppl):
mols.append(m)
if i > total_mols:
print("MaeMolSupplier Keeps Reading Molecules after all are gone")
break
# MaeMolSupplier Keeps Reading Molecules after all are gone
I'm looking into this. It seems caused by #2579, although the MaeMolSupplier should fail once maeparser has trouble reading...
That other issue is already patched in maeparser, although it has not yet made its way into RDKit. I'll see if I can put up a PR to make sure MaeMolSupplier stops reading when there are problems in maeparser, and then try to get a new maeparser release issued and updated into RDKit.
Description:
Chem.rdmolfiles.MaeMolSupplier
reads more molecules than is actually in the file.If you try to read until file exhaustion it never stops reading.
example mae file
The text was updated successfully, but these errors were encountered: