Created
July 24, 2009 11:33
-
-
Save olas/154028 to your computer and use it in GitHub Desktop.
Add property to SDF from file
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
| //*************************************************************** | |
| // Script that iterates over an SDFile and adds precalculated values | |
| // from an external file as a property and saves as a new SDFile. | |
| // | |
| // The file with values have one value per row in same order as | |
| // the molecukes in the SDFile. | |
| // | |
| // Author: Ola Spjuth | |
| //**************************************************************** | |
| PROPERTY_NAME="pdgfr_response"; | |
| it = cdk.createMoleculeIterator("/raj1/molecules/pdgfr.sdf"); | |
| responses=ui.readFileIntoArray("/raj1/plasma.depv"); | |
| //Create a list to hold the resulting molecules | |
| list=cdk.createMoleculeList(); | |
| ix=0; | |
| while (it.hasNext()){ | |
| mol=it.next(); | |
| prop=responses[ix]; | |
| cdk.setProperty(mol, PROPERTY_NAME, prop); | |
| list.add(mol); | |
| ix++; | |
| } | |
| cdk.saveSDFile("raj1/pdgfr_props.sdf", list); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment