@Test public void testDragonShell() throws Exception { DragonShell shell = new DragonShell(); shell.setDescriptors(new String[] {"MW", "MLOGP", "Constitutional indices"}); IIteratingChemObjectReader reader = FileInputState.getReader( getClass().getClassLoader().getResourceAsStream("ambit2/dragon/test/structure.sdf"), "structure.sdf"); Assert.assertTrue(reader != null); while (reader.hasNext()) { Object o = reader.next(); IAtomContainer mol = (IAtomContainer) o; mol = shell.process(mol); Assert.assertTrue(mol.getProperties().size() > 0); } reader.close(); }
@Test public void testDragonDescriptor() throws Exception { DescriptorDragonShell dragon = new DescriptorDragonShell(); dragon.setParameters(new String[] {"MW,MLOGP,Constitutional indices"}); IIteratingChemObjectReader reader = FileInputState.getReader( getClass().getClassLoader().getResourceAsStream("ambit2/dragon/test/structure.sdf"), "structure.sdf"); Assert.assertTrue(reader != null); while (reader.hasNext()) { Object o = reader.next(); IAtomContainer mol = (IAtomContainer) o; DescriptorValue value = dragon.calculate(mol); Assert.assertNotNull(value.getValue()); System.out.println(value.getValue().getClass()); Assert.assertTrue(value.getValue() instanceof DoubleArrayResultType); Assert.assertNotNull(((DoubleArrayResultType) value.getValue())); Assert.assertEquals(44, ((DoubleArrayResultType) value.getValue()).length()); } reader.close(); }