lambdacasserole / avogadrio

Worship your favorite molecule by setting it as your wallpaper.
https://avogadr.io/
MIT License
297 stars 11 forks source link

Restructure SMILES lookup services into chain of responsibility #22

Closed lambdacasserole closed 7 years ago

lambdacasserole commented 7 years ago

Previously we were only using the service at https://cactus.nci.nih.gov/chemical/structure for SMILES lookups from compound names. This works pretty well, but sometimes we get SMILES back that contains vertical pipe | characters which breaks Sourire and won't render. These mainly seem to appear in organometallic compounds (ligand-related?) and just don't play nice with the renderer.

To remedy this, we now fall back to attempting to scrape the SMILES from the compound's Wikipedia page. This means it was necessary to restructure SMILES lookup services to support the chain of responsibility pattern.