Skip to content

Commit

Permalink
Template for a class to calculate molecular volume
Browse files Browse the repository at this point in the history
Signed-off-by: Rajarshi Guha <rajarshi.guha@gmail.com>
  • Loading branch information
egonw authored and rajarshi committed Jun 17, 2011
1 parent f9b5fe6 commit 105a1a9
Show file tree
Hide file tree
Showing 3 changed files with 110 additions and 0 deletions.
13 changes: 13 additions & 0 deletions doc/refs/cheminf.bibx
Expand Up @@ -1124,6 +1124,19 @@ Method </bibtex:title>
</bibtex:article>
</bibtex:entry>

<bibtex:entry id="Zhao2003">
<bibtex:article>
<bibtex:author>Zhao, Yuan H. and Abraham, Michael H. and Zissimos, Andreas M.</bibtex:author>
<bibtex:title>Fast Calculation of van der Waals Volume as a Sum of Atomic and Bond Contributions and Its Application to Drug Compounds</bibtex:title>
<bibtex:journal>The Journal of Organic Chemistry</bibtex:journal>
<bibtex:year>2003</bibtex:year>
<bibtex:volume>68</bibtex:volume>
<bibtex:number>19</bibtex:number>
<bibtex:pages>7368-7373</bibtex:pages>
<bibtex:doi>10.1021/jo034808o</bibtex:doi>
</bibtex:article>
</bibtex:entry>

<bibtex:entry id="Thalheim2010">
<bibtex:article>
<bibtex:author>Thalheim, T. and Vollmer, A. and Ebert, R. and Kuehne, R. and Schuurmann, G.</bibtex:author>
Expand Down
46 changes: 46 additions & 0 deletions src/main/org/openscience/cdk/geometry/volume/VABCVolume.java
@@ -0,0 +1,46 @@
/* Copyright (C) 2011 Egon Willighagen <egonw@users.sf.net>
*
* Contact: cdk-devel@lists.sourceforge.net
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2.1
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*/
package org.openscience.cdk.geometry.volume;

import org.openscience.cdk.annotations.TestClass;
import org.openscience.cdk.interfaces.IMolecule;

/**
* Calculates the Vanderwaals volume using the method proposed
* in {@cdk.cite Zhao2003}. The method is limited to molecules
* with the folowing elements: H, C, N, O, F, Cl, Br, I,
* P, S, As, B, Si, Se, and Te.
*
* @cdk.module standard
* @cdk.keywords volume, molecular
*/
@TestClass("org.openscience.cdk.geometry.volume.VABCVolumeTest")
public class VABCVolume {

/**
* Calculates the volume for the given {@link IMolecule}.
*
* @param molecule {@link IMolecule} to calculate the volume of.
* @return the volume in cubic &Aring;ngstr&ouml;m.
*/
public static double calculate(IMolecule molecule) {
return 0.0;
}

}
51 changes: 51 additions & 0 deletions src/test/org/openscience/cdk/geometry/volume/VABCVolumeTest.java
@@ -0,0 +1,51 @@
/* Copyright (C) 2011 Egon Willighagen <egonw@users.sf.net>
*
* Contact: cdk-devel@lists.sourceforge.net
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2.1
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*/
package org.openscience.cdk.geometry.volume;

import junit.framework.Assert;

import org.junit.BeforeClass;
import org.junit.Test;
import org.openscience.cdk.exception.InvalidSmilesException;
import org.openscience.cdk.interfaces.IMolecule;
import org.openscience.cdk.nonotify.NoNotificationChemObjectBuilder;
import org.openscience.cdk.smiles.SmilesParser;

public class VABCVolumeTest {

private static SmilesParser smilesParser;

@BeforeClass
public static void setup() {
smilesParser = new SmilesParser(
NoNotificationChemObjectBuilder.getInstance()
);
}

/**
* Test from Table 1 from {@cdk.cite Zhao2003}.
*/
@Test
public void testMethane() throws InvalidSmilesException {
IMolecule methane = smilesParser.parseSmiles("C");
double volume = VABCVolume.calculate(methane);
Assert.assertEquals(25.83, volume, 0.01);
}

}

0 comments on commit 105a1a9

Please sign in to comment.