Created
February 20, 2009 13:52
-
-
Save egonw/67462 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // search and download entries from PubChem | |
| var query = "aspirin"; | |
| var searchResults = pubchem.search(query); | |
| var max = Math.min(15, searchResults.size()); | |
| for (i=0; i<max; i++) { | |
| var cid = searchResults.get(i); | |
| var filename = "/Virtual/" + query.replace(" ", "") + "." + cid + ".xml"; | |
| var filename3d = "/Virtual/" + query.replace(" ", "") + "." + cid + ".mol"; | |
| js.print("downloading CID " + cid + "...\n"); | |
| pubchem.loadCompound(cid, filename); | |
| pubchem.loadCompound3d(cid, filename3d); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment