Created
September 25, 2009 14:58
-
-
Save jonalv/193599 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
var FILTERING = "Filtering"; | |
var FILTERED = "Filtered"; | |
if ( structuredb.allDatabaseNames().contains(FILTERING) ) { | |
structuredb.deleteDatabase(FILTERING); | |
} | |
structuredb.createDatabase(FILTERING); | |
structuredb.addMoleculesFromSDF(FILTERING, "/Sample Data/SDF/Fragments2.sdf"); | |
var iterator = structuredb.allStructuresIterator( FILTERING ); | |
var filteredAnnotation = structuredb.createTextAnnotation( FILTERING, "label", FILTERED ); | |
while ( iterator.hasNext() ) { | |
var molecule = iterator.next(); | |
if ( cdk.calculateSMILES(molecule).contains( "Cl" ) ) { | |
molecule.addAnnotation(filteredAnnotation); | |
structuredb.updateMolecule(FILTERING, molecule); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment