Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Randomize button #25

Open
lambdacasserole opened this issue Aug 30, 2017 · 3 comments
Open

Randomize button #25

lambdacasserole opened this issue Aug 30, 2017 · 3 comments

Comments

@lambdacasserole
Copy link
Owner

It was suggested on Twitter that we should introduce a randomize button that will give a random compound and (maybe) random colors. The compound name should probably appear in the custom label as well, so the user actually knows which chemical they're about to set as their desktop background.

We could try to find an external API that will give a random compound name, or just pull from the site cache. I think the latter is the better option to be honest.

@Chelsea486MHz
Copy link

Hey. Turns out I was working on this a few hours ago, in C.

It's quite hard, you either need a generator that doesn't generate faulty compounds, or a database with different valid compound names.

I already have a small DB with basic alkanes, alkenes, alkynes, azanes, silanes, alcohols, aldehydes, ketones, and alkyl halides. I'm working on a molecule generator.

If anyone has some web programming skills, I'll just make a repo with the generator so it can be adapted on avogadr.io

@lambdacasserole
Copy link
Owner Author

Really appreciated @Garuda1, when you put that repo up please do let me know and I'll look at porting/integrating it.

@dan2097
Copy link

dan2097 commented Dec 6, 2017

If you're happy with being confined to only the >100 million compounds in PubChem then a simple way of doing this may be using their REST API:
e.g.
https://pubchem.ncbi.nlm.nih.gov/rest/pug/compound/cid/14969/property/isomericsmiles/txt
CIDs are typically assigned sequentially, so any number between 1 and ~131 million will give a different structure. A small percentage of CIDs won't give a structure as they correspond to structures where a PubChem depositor removed their deposition, perhaps as the structure they originally deposited was erroneous.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants