Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Filter out molecules with failing atom types in ConvertSMILEStoSDF.

  • Loading branch information...
commit e82814827eca5b4595fc9fc5d7a3452e239dd036 1 parent e15df13
Ola Spjuth olas authored committed
14 plugins/net.bioclipse.cdk.ui/src/net/bioclipse/cdk/ui/handlers/ConvertSMILEStoSDF.java
View
@@ -33,6 +33,7 @@
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.ui.handlers.HandlerUtil;
+import org.openscience.cdk.interfaces.IAtom;
import net.bioclipse.cdk.business.Activator;
import net.bioclipse.cdk.business.ICDKManager;
@@ -209,8 +210,19 @@ protected IStatus run(IProgressMonitor monitor) {
for (int i=1; i<headers.length;i++){
mol.getAtomContainer().setProperty(headers[i], parts[i]);
}
+
+ //Filter molecules with failing atom types
+ boolean filterout=false;
+ for (IAtom atom : mol.getAtomContainer().atoms()){
+ if (atom.getAtomTypeName().equals("X"))
+ filterout=true;
+ }
- molecules.add(mol);
+ if (filterout)
+ logger.debug("Skipped molecule " + lineno + " due to " +
+ "failed atom typing.");
+ else
+ molecules.add(mol);
//Read next line
line=br.readLine();
Please sign in to comment.
Something went wrong with that request. Please try again.