use of org.openscience.cdk.qsar.IAtomicDescriptor in project cdk by cdk.
the class AtomDegreeDescriptorTest method testAtomDegreeDescriptor.
@Test
public void testAtomDegreeDescriptor() throws java.lang.Exception {
IAtomicDescriptor descriptor = new AtomDegreeDescriptor();
SmilesParser sp = new SmilesParser(DefaultChemObjectBuilder.getInstance());
//
IAtomContainer mol = sp.parseSmiles("CC(C)CCCC");
Assert.assertEquals(3, ((IntegerResult) descriptor.calculate(mol.getAtom(1), mol).getValue()).intValue());
}
use of org.openscience.cdk.qsar.IAtomicDescriptor in project cdk by cdk.
the class AtomValenceDescriptorTest method testAtomValenceDescriptor.
@Test
public void testAtomValenceDescriptor() throws java.lang.Exception {
IAtomicDescriptor descriptor = new AtomValenceDescriptor();
SmilesParser sp = new SmilesParser(DefaultChemObjectBuilder.getInstance());
//
IAtomContainer mol = sp.parseSmiles("CCCl");
Assert.assertEquals(7, ((IntegerResult) descriptor.calculate(mol.getAtom(2), mol).getValue()).intValue());
}
use of org.openscience.cdk.qsar.IAtomicDescriptor in project cdk by cdk.
the class SigmaElectronegativityDescriptorTest method testSigmaElectronegativityDescriptor_Isopentyl_iodide.
/**
* A unit test for JUnit with Isopentyl iodide
*/
@Test
public void testSigmaElectronegativityDescriptor_Isopentyl_iodide() throws java.lang.Exception {
double testResult = 9.2264;
/*
* from Petra online:
* http://www2.chemie.uni-
* erlangen.de/services/petra/smiles.phtml
*/
IAtomicDescriptor descriptor = new SigmaElectronegativityDescriptor();
SmilesParser sp = new SmilesParser(builder);
IAtomContainer mol = sp.parseSmiles("C(C)(C)CCI");
addExplicitHydrogens(mol);
double result = ((DoubleResult) descriptor.calculate(mol.getAtom(5), mol).getValue()).doubleValue();
Assert.assertEquals(testResult, result, 0.08);
}
use of org.openscience.cdk.qsar.IAtomicDescriptor in project cdk by cdk.
the class SigmaElectronegativityDescriptorTest method testSigmaElectronegativityDescriptor_Allyl_mercaptan.
/**
* A unit test for JUnit with Allyl mercaptan
*/
@Test
public void testSigmaElectronegativityDescriptor_Allyl_mercaptan() throws java.lang.Exception {
double[] testResult = { 7.8634, 8.0467, 8.061, 8.5917 };
/*
* from Petra
* online:
* http://
* www2.chemie
* .uni
* -erlangen.de
* /services
* /petra
* /smiles.phtml
*/
IAtomicDescriptor descriptor = new SigmaElectronegativityDescriptor();
SmilesParser sp = new SmilesParser(builder);
IAtomContainer mol = sp.parseSmiles("C=CCS");
addExplicitHydrogens(mol);
for (int i = 0; i < 4; i++) {
double result = ((DoubleResult) descriptor.calculate(mol.getAtom(i), mol).getValue()).doubleValue();
Assert.assertEquals(testResult[i], result, 0.01);
}
}
use of org.openscience.cdk.qsar.IAtomicDescriptor in project cdk by cdk.
the class SigmaElectronegativityDescriptorTest method testSigmaElectronegativityDescriptor_Ethoxy_ethane.
/**
* A unit test for JUnit with Ethoxy ethane
*/
@Test
public void testSigmaElectronegativityDescriptor_Ethoxy_ethane() throws java.lang.Exception {
double[] testResult = { 7.6009, 8.3948, 9.4663, 8.3948, 7.6009 };
/*
* from
* Petra
* online
* :
* http
* :/
* /www2
* .
* chemie
* .uni-
* erlangen
* .de/
* services
* /
* petra
* /
* smiles
* .
* phtml
*/
IAtomicDescriptor descriptor = new SigmaElectronegativityDescriptor();
Integer[] params = new Integer[1];
SmilesParser sp = new SmilesParser(builder);
IAtomContainer mol = sp.parseSmiles("CCOCC");
addExplicitHydrogens(mol);
for (int i = 0; i < 5; i++) {
params[0] = 6;
descriptor.setParameters(params);
double result = ((DoubleResult) descriptor.calculate(mol.getAtom(i), mol).getValue()).doubleValue();
Assert.assertEquals(testResult[i], result, 0.002);
}
}
Aggregations