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
The implementation of repr for the Molecule class effectively hangs for large molecules because of (at least) an attempt to convert it to SMILES which waits for a returned value before doing any error handling. The Python docs for this record more or less say that it should return something that can re-create the object if passed to eval or summary info if that's not feasible. I suggest that for larger molecules (somewhere around 100-1000 atoms) there be no attempt to convert into SMILES, which isn't a particularly useful representation of macromolecules.
To Reproduce
Create a large Molecule from any source like a PDB file or external tool
In [24]: seq= "MNRHLCVWLFRHPSLNGYLQCHIQLHSHQFRQIHLDTRLQVFRQNRNCILHLLSKNWSRRYCHQDTKMLWKHKALQKYMENLSKEYQTLEQCLQHIPVNEENRRSLNRRHA
...: ELAPLAAIYQEIQETEQAIEELESMCKSLNKQDEKQLQELALEERQTIDQKINMLYNELFQSLVPKEKYDKNDVILEVTAGRTTGGDICQQFTREIFDMYQNYSCYKHWQFELLNYTP
...: ADYGGLHHAAARISGDGVYKHLKYEGGIHRVQRIPEVGLSSRMQRIHTGTMSVIVLPQPDEVDVKLDPKDLRIDTFRAKGAGGQHVNKTDSAVRLVHIPTGLVVECQQERSQIKNKEI
...: AFRVLRARLYQQIIEKDKRQQQSARKLQVGTRAQSERIRTYNFTQDRVSDHRIAYEVRDIKEFLCGGKGLDQLIQRLLQSADEEAIAELLDEHLKSAK"
In [25]: Molecule.from_rdkit(Chem.MolFromSequence(seq), allow_undefined_stereo=True)
Output
Basically stalls; if I didn't know this codebase better I'd be confused and/or think that the molecule loading failed.
The text was updated successfully, but these errors were encountered:
Describe the bug
The implementation of
repr
for theMolecule
class effectively hangs for large molecules because of (at least) an attempt to convert it to SMILES which waits for a returned value before doing any error handling. The Python docs for this record more or less say that it should return something that can re-create the object if passed toeval
or summary info if that's not feasible. I suggest that for larger molecules (somewhere around 100-1000 atoms) there be no attempt to convert into SMILES, which isn't a particularly useful representation of macromolecules.To Reproduce
Create a large
Molecule
from any source like a PDB file or external toolOutput
Basically stalls; if I didn't know this codebase better I'd be confused and/or think that the molecule loading failed.
The text was updated successfully, but these errors were encountered: