diff --git a/build.xml b/build.xml index 9f9bb0360e2..33777812ae2 100644 --- a/build.xml +++ b/build.xml @@ -539,7 +539,7 @@ list="pdb,smiles,sdg,inchi,libiocml"/> + list="control,extra,fragment,reaction,pdbcml,libiomd"/> @@ -576,7 +576,7 @@ + @@ -666,6 +667,7 @@ + @@ -743,6 +745,7 @@ + @@ -811,6 +814,7 @@ + @@ -848,6 +852,7 @@ + @@ -1080,7 +1085,7 @@ io,builder3d,forcefield,valencycheck,charges,reaction, smarts,fingerprint,smiles,qsar,qsaratomic,qsarbond, qsarmolecular,qsarionpot,qsarprotein,pdb,pcore,inchi, - structgen,libiomd,libiocml,formula,render,extra,sdg, + structgen,libiomd,libiocml,formula,render,extra,fragment,sdg, ioformats,log4j,smsd,signature,iordf,cip,tautomer, isomorphism,renderbasic,renderawt,silent"/> diff --git a/src/META-INF/builder3dtools.cdkdepends b/src/META-INF/builder3dtools.cdkdepends index d7e673ec8d5..02dec8fdcb9 100644 --- a/src/META-INF/builder3dtools.cdkdepends +++ b/src/META-INF/builder3dtools.cdkdepends @@ -4,7 +4,6 @@ cdk-data.jar cdk-silent.jar cdk-interfaces.jar cdk-io.jar -cdk-qsar.jar cdk-standard.jar cdk-charges.jar cdk-forcefield.jar diff --git a/src/META-INF/charges.cdkdepends b/src/META-INF/charges.cdkdepends index b2ff0136d52..12a553cfd44 100644 --- a/src/META-INF/charges.cdkdepends +++ b/src/META-INF/charges.cdkdepends @@ -1,6 +1,5 @@ cdk-annotation.jar cdk-core.jar -cdk-data.jar cdk-interfaces.jar cdk-io.jar cdk-standard.jar diff --git a/src/META-INF/fingerprint.cdkdepends b/src/META-INF/fingerprint.cdkdepends index 0981d22e67d..929cbe2a14a 100644 --- a/src/META-INF/fingerprint.cdkdepends +++ b/src/META-INF/fingerprint.cdkdepends @@ -2,7 +2,6 @@ cdk-annotation.jar cdk-interfaces.jar cdk-core.jar cdk-standard.jar -cdk-io.jar cdk-isomorphism.jar cdk-valencycheck.jar cdk-smarts.jar diff --git a/src/META-INF/forcefield.cdkdepends b/src/META-INF/forcefield.cdkdepends index f3696b6c451..2fe40c00217 100644 --- a/src/META-INF/forcefield.cdkdepends +++ b/src/META-INF/forcefield.cdkdepends @@ -2,9 +2,6 @@ cdk-annotation.jar cdk-core.jar cdk-data.jar cdk-interfaces.jar -cdk-qsar.jar -cdk-qsaratomic.jar cdk-io.jar cdk-standard.jar cdk-charges.jar -cdk-extra.jar diff --git a/src/META-INF/fragment.cdkdepends b/src/META-INF/fragment.cdkdepends new file mode 100644 index 00000000000..356e7020877 --- /dev/null +++ b/src/META-INF/fragment.cdkdepends @@ -0,0 +1,5 @@ +cdk-interfaces.jar +cdk-annotation.jar +cdk-core.jar +cdk-standard.jar +cdk-smiles.jar diff --git a/src/META-INF/qsaratomic.cdkdepends b/src/META-INF/qsaratomic.cdkdepends index 8ca7fdc1fc6..2c6daf8be9c 100644 --- a/src/META-INF/qsaratomic.cdkdepends +++ b/src/META-INF/qsaratomic.cdkdepends @@ -1,10 +1,8 @@ cdk-annotation.jar cdk-interfaces.jar -cdk-data.jar cdk-core.jar cdk-standard.jar cdk-valencycheck.jar -cdk-extra.jar cdk-isomorphism.jar cdk-reaction.jar cdk-isomorphism.jar diff --git a/src/META-INF/qsarbond.cdkdepends b/src/META-INF/qsarbond.cdkdepends index 806a947ba14..a7c1648bb6d 100644 --- a/src/META-INF/qsarbond.cdkdepends +++ b/src/META-INF/qsarbond.cdkdepends @@ -1,6 +1,5 @@ cdk-annotation.jar cdk-interfaces.jar -cdk-data.jar cdk-core.jar cdk-standard.jar cdk-valencycheck.jar diff --git a/src/META-INF/qsarcml.cdkdepends b/src/META-INF/qsarcml.cdkdepends index 85f46e09165..bb73fce8ab5 100644 --- a/src/META-INF/qsarcml.cdkdepends +++ b/src/META-INF/qsarcml.cdkdepends @@ -1,6 +1,5 @@ cdk-annotation.jar cdk-core.jar -cdk-data.jar cdk-interfaces.jar cdk-libiocml.jar cdk-qsar.jar diff --git a/src/META-INF/qsarionpot.cdkdepends b/src/META-INF/qsarionpot.cdkdepends index e88d1525a79..bb586959d88 100644 --- a/src/META-INF/qsarionpot.cdkdepends +++ b/src/META-INF/qsarionpot.cdkdepends @@ -1,10 +1,8 @@ cdk-annotation.jar cdk-interfaces.jar -cdk-data.jar cdk-core.jar cdk-standard.jar cdk-valencycheck.jar -cdk-extra.jar cdk-reaction.jar cdk-charges.jar cdk-qsar.jar diff --git a/src/META-INF/qsarmolecular.cdkdepends b/src/META-INF/qsarmolecular.cdkdepends index 7db685264a6..d1b7ced55ca 100644 --- a/src/META-INF/qsarmolecular.cdkdepends +++ b/src/META-INF/qsarmolecular.cdkdepends @@ -1,10 +1,8 @@ cdk-annotation.jar cdk-interfaces.jar -cdk-data.jar cdk-core.jar cdk-standard.jar cdk-valencycheck.jar -cdk-extra.jar cdk-reaction.jar cdk-charges.jar cdk-qsar.jar @@ -13,3 +11,4 @@ cdk-smarts.jar cdk-formula.jar cdk-isomorphism.jar cdk-dict.jar +cdk-fragment.jar diff --git a/src/META-INF/qsarprotein.cdkdepends b/src/META-INF/qsarprotein.cdkdepends index ce4bed627df..0364206fa8b 100644 --- a/src/META-INF/qsarprotein.cdkdepends +++ b/src/META-INF/qsarprotein.cdkdepends @@ -3,8 +3,5 @@ cdk-interfaces.jar cdk-data.jar cdk-core.jar cdk-standard.jar -cdk-valencycheck.jar -cdk-reaction.jar -cdk-charges.jar cdk-qsar.jar cdk-pdb.jar diff --git a/src/META-INF/smarts.cdkdepends b/src/META-INF/smarts.cdkdepends index 2e5aca2575a..7bab6be37a4 100644 --- a/src/META-INF/smarts.cdkdepends +++ b/src/META-INF/smarts.cdkdepends @@ -1,7 +1,6 @@ cdk-annotation.jar cdk-core.jar cdk-interfaces.jar -cdk-io.jar cdk-standard.jar cdk-valencycheck.jar cdk-isomorphism.jar diff --git a/src/META-INF/test-fragment.cdkdepends b/src/META-INF/test-fragment.cdkdepends new file mode 100644 index 00000000000..ad6242d0325 --- /dev/null +++ b/src/META-INF/test-fragment.cdkdepends @@ -0,0 +1,16 @@ +cdk-annotation.jar +cdk-interfaces.jar +cdk-core.jar +cdk-data.jar +cdk-standard.jar +cdk-extra.jar +cdk-smiles.jar +cdk-test.jar +cdk-io.jar +cdk-silent.jar +cdk-testdata.jar +cdk-atomtype.jar +cdk-valencycheck.jar +cdk-pdb.jar +cdk-log4j.jar +cdk-fragment.jar diff --git a/src/META-INF/test-fragment.devellibdepends b/src/META-INF/test-fragment.devellibdepends new file mode 100644 index 00000000000..947f0170f7c --- /dev/null +++ b/src/META-INF/test-fragment.devellibdepends @@ -0,0 +1,2 @@ +junit-4.10.jar + diff --git a/src/META-INF/test-fragment.libdepends b/src/META-INF/test-fragment.libdepends new file mode 100644 index 00000000000..02a4f67b71d --- /dev/null +++ b/src/META-INF/test-fragment.libdepends @@ -0,0 +1,3 @@ +log4j*.jar +vecmath*.jar +jgrapht-0.6.0.jar diff --git a/src/META-INF/test-qsarmolecular.cdkdepends b/src/META-INF/test-qsarmolecular.cdkdepends index 020fcbb32f0..b9034940cd4 100644 --- a/src/META-INF/test-qsarmolecular.cdkdepends +++ b/src/META-INF/test-qsarmolecular.cdkdepends @@ -30,3 +30,4 @@ cdk-builder3d.jar cdk-forcefield.jar cdk-sdg.jar cdk-ioformats.jar +cdk-fragment.jar diff --git a/src/main/org/openscience/cdk/EnzymeResidueLocator.java b/src/main/org/openscience/cdk/EnzymeResidueLocator.java index 4312977c0b4..98442b908db 100644 --- a/src/main/org/openscience/cdk/EnzymeResidueLocator.java +++ b/src/main/org/openscience/cdk/EnzymeResidueLocator.java @@ -1,9 +1,4 @@ -/* $RCSfile$ - * $Author$ - * $Date$ - * $Revision$ - * - * Copyright (C) 2003-2007 Egon Willighagen +/* Copyright (C) 2003-2007 Egon Willighagen * * Contact: cdk-devel@lists.sourceforge.net * @@ -24,7 +19,6 @@ * 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; @@ -32,6 +26,7 @@ * Atom that represents part of an residue in an enzyme, like Arg255. * * @see PseudoAtom + * @cdk.module pdb */ public class EnzymeResidueLocator extends PseudoAtom { diff --git a/src/main/org/openscience/cdk/config/Elements.java b/src/main/org/openscience/cdk/config/Elements.java index 79f1796fa75..b9d48826e22 100644 --- a/src/main/org/openscience/cdk/config/Elements.java +++ b/src/main/org/openscience/cdk/config/Elements.java @@ -1,9 +1,4 @@ -/* $RCSfile: $ - * $Author$ - * $Date$ - * $Revision$ - * - * Copyright (C) 2006-2007 Egon Willighagen +/* Copyright (C) 2006-2012 Egon Willighagen * * Contact: cdk-devel@lists.sourceforge.net * @@ -27,7 +22,6 @@ */ package org.openscience.cdk.config; -import org.openscience.cdk.Element; import org.openscience.cdk.interfaces.IElement; import org.openscience.cdk.tools.periodictable.PeriodicTable; @@ -35,128 +29,128 @@ * List of elements. Data is taken from the Blue Obelisk Data Repository, * version 3. * - * @author egonw - * @cdk.module extra + * @author egonw + * @cdk.module standard * @cdk.githash */ public class Elements { - public final static IElement DUMMY = new Element(PeriodicTable.getSymbol(0), 0); - public final static IElement HYDROGEN = new Element(PeriodicTable.getSymbol(1), 1); - public final static IElement HELIUM = new Element(PeriodicTable.getSymbol(2), 2); - public final static IElement LITHIUM = new Element(PeriodicTable.getSymbol(3), 3); - public final static IElement BERYLLIUM = new Element(PeriodicTable.getSymbol(4), 4); - public final static IElement BORON = new Element(PeriodicTable.getSymbol(5), 5); - public final static IElement CARBON = new Element(PeriodicTable.getSymbol(6), 6); - public final static IElement NITROGEN = new Element(PeriodicTable.getSymbol(7), 7); - public final static IElement OXYGEN = new Element(PeriodicTable.getSymbol(8), 8); - public final static IElement FLUORINE = new Element(PeriodicTable.getSymbol(9), 9); - public final static IElement NEON = new Element(PeriodicTable.getSymbol(10), 10); - public final static IElement SODIUM = new Element(PeriodicTable.getSymbol(11), 11); - public final static IElement MAGNESIUM = new Element(PeriodicTable.getSymbol(12), 12); - public final static IElement ALUMINIUM = new Element(PeriodicTable.getSymbol(13), 13); - public final static IElement SILICON = new Element(PeriodicTable.getSymbol(14), 14); - public final static IElement PHOSPHORUS = new Element(PeriodicTable.getSymbol(15), 15); - public final static IElement SULFUR = new Element(PeriodicTable.getSymbol(16), 16); - public final static IElement CHLORINE = new Element(PeriodicTable.getSymbol(17), 17); - public final static IElement ARGON = new Element(PeriodicTable.getSymbol(18), 18); - public final static IElement POTASSIUM = new Element(PeriodicTable.getSymbol(19), 19); - public final static IElement CALCIUM = new Element(PeriodicTable.getSymbol(20), 20); - public final static IElement SCANDIUM = new Element(PeriodicTable.getSymbol(21), 21); - public final static IElement TITANIUM = new Element(PeriodicTable.getSymbol(22), 22); - public final static IElement VANADIUM = new Element(PeriodicTable.getSymbol(23), 23); - public final static IElement CHROMIUM = new Element(PeriodicTable.getSymbol(24), 24); - public final static IElement MANGANESE = new Element(PeriodicTable.getSymbol(25), 25); - public final static IElement IRON = new Element(PeriodicTable.getSymbol(26), 26); - public final static IElement COBALT = new Element(PeriodicTable.getSymbol(27), 27); - public final static IElement NICKEL = new Element(PeriodicTable.getSymbol(28), 28); - public final static IElement COPPER = new Element(PeriodicTable.getSymbol(29), 29); - public final static IElement ZINC = new Element(PeriodicTable.getSymbol(30), 30); - public final static IElement GALLIUM = new Element(PeriodicTable.getSymbol(31), 31); - public final static IElement GERMANIUM = new Element(PeriodicTable.getSymbol(32), 32); - public final static IElement ARSENIC = new Element(PeriodicTable.getSymbol(33), 33); - public final static IElement SELENIUM = new Element(PeriodicTable.getSymbol(34), 34); - public final static IElement BROMINE = new Element(PeriodicTable.getSymbol(35), 35); - public final static IElement KRYPTON = new Element(PeriodicTable.getSymbol(36), 36); - public final static IElement RUBIDIUM = new Element(PeriodicTable.getSymbol(37), 37); - public final static IElement STRONTIUM = new Element(PeriodicTable.getSymbol(38), 38); - public final static IElement YTTRIUM = new Element(PeriodicTable.getSymbol(39), 39); - public final static IElement ZIRCONIUM = new Element(PeriodicTable.getSymbol(40), 40); - public final static IElement NIOBIUM = new Element(PeriodicTable.getSymbol(41), 41); - public final static IElement MOLYBDENUM = new Element(PeriodicTable.getSymbol(42), 42); - public final static IElement TECHNETIUM = new Element(PeriodicTable.getSymbol(43), 43); - public final static IElement RUTHENIUM = new Element(PeriodicTable.getSymbol(44), 44); - public final static IElement RHODIUM = new Element(PeriodicTable.getSymbol(45), 45); - public final static IElement PALLADIUM = new Element(PeriodicTable.getSymbol(46), 46); - public final static IElement SILVER = new Element(PeriodicTable.getSymbol(47), 47); - public final static IElement CADMIUM = new Element(PeriodicTable.getSymbol(48), 48); - public final static IElement INDIUM = new Element(PeriodicTable.getSymbol(49), 49); - public final static IElement TIN = new Element(PeriodicTable.getSymbol(50), 50); - public final static IElement ANTIMONY = new Element(PeriodicTable.getSymbol(51), 51); - public final static IElement TELLURIUM = new Element(PeriodicTable.getSymbol(52), 52); - public final static IElement IODINE = new Element(PeriodicTable.getSymbol(53), 53); - public final static IElement XENON = new Element(PeriodicTable.getSymbol(54), 54); - public final static IElement CAESIUM = new Element(PeriodicTable.getSymbol(55), 55); - public final static IElement BARIUM = new Element(PeriodicTable.getSymbol(56), 56); - public final static IElement LANTHANUM = new Element(PeriodicTable.getSymbol(57), 57); - public final static IElement CERIUM = new Element(PeriodicTable.getSymbol(58), 58); - public final static IElement PRASEODYMIUM = new Element(PeriodicTable.getSymbol(59), 59); - public final static IElement NEODYMIUM = new Element(PeriodicTable.getSymbol(60), 60); - public final static IElement PROMETHIUM = new Element(PeriodicTable.getSymbol(61), 61); - public final static IElement SAMARIUM = new Element(PeriodicTable.getSymbol(62), 62); - public final static IElement EUROPIUM = new Element(PeriodicTable.getSymbol(63), 63); - public final static IElement GADOLINIUM = new Element(PeriodicTable.getSymbol(64), 64); - public final static IElement TERBIUM = new Element(PeriodicTable.getSymbol(65), 65); - public final static IElement DYSPROSIUM = new Element(PeriodicTable.getSymbol(66), 66); - public final static IElement HOLMIUM = new Element(PeriodicTable.getSymbol(67), 67); - public final static IElement ERBIUM = new Element(PeriodicTable.getSymbol(68), 68); - public final static IElement THULIUM = new Element(PeriodicTable.getSymbol(69), 69); - public final static IElement YTTERBIUM = new Element(PeriodicTable.getSymbol(70), 70); - public final static IElement LUTETIUM = new Element(PeriodicTable.getSymbol(71), 71); - public final static IElement HAFNIUM = new Element(PeriodicTable.getSymbol(72), 72); - public final static IElement TANTALUM = new Element(PeriodicTable.getSymbol(73), 73); - public final static IElement TUNGSTEN = new Element(PeriodicTable.getSymbol(74), 74); - public final static IElement RHENIUM = new Element(PeriodicTable.getSymbol(75), 75); - public final static IElement OSMIUM = new Element(PeriodicTable.getSymbol(76), 76); - public final static IElement IRIDIUM = new Element(PeriodicTable.getSymbol(77), 77); - public final static IElement PLATINUM = new Element(PeriodicTable.getSymbol(78), 78); - public final static IElement GOLD = new Element(PeriodicTable.getSymbol(79), 79); - public final static IElement MERCURY = new Element(PeriodicTable.getSymbol(80), 80); - public final static IElement THALLIUM = new Element(PeriodicTable.getSymbol(81), 81); - public final static IElement LEAD = new Element(PeriodicTable.getSymbol(82), 82); - public final static IElement BISMUTH = new Element(PeriodicTable.getSymbol(83), 83); - public final static IElement POLONIUM = new Element(PeriodicTable.getSymbol(84), 84); - public final static IElement ASTATINE = new Element(PeriodicTable.getSymbol(85), 85); - public final static IElement RADON = new Element(PeriodicTable.getSymbol(86), 86); - public final static IElement FRANCIUM = new Element(PeriodicTable.getSymbol(87), 87); - public final static IElement RADIUM = new Element(PeriodicTable.getSymbol(88), 88); - public final static IElement ACTINIUM = new Element(PeriodicTable.getSymbol(89), 89); - public final static IElement THORIUM = new Element(PeriodicTable.getSymbol(90), 90); - public final static IElement PROTACTINIUM = new Element(PeriodicTable.getSymbol(91), 91); - public final static IElement URANIUM = new Element(PeriodicTable.getSymbol(92), 92); - public final static IElement NEPTUNIUM = new Element(PeriodicTable.getSymbol(93), 93); - public final static IElement PLUTOMNIUM = new Element(PeriodicTable.getSymbol(94), 94); - public final static IElement AMERICIUM = new Element(PeriodicTable.getSymbol(95), 95); - public final static IElement CURIUM = new Element(PeriodicTable.getSymbol(96), 96); - public final static IElement BERKELIUM = new Element(PeriodicTable.getSymbol(97), 97); - public final static IElement CALIFORNIUM = new Element(PeriodicTable.getSymbol(98), 98); - public final static IElement EINSTEINIUM = new Element(PeriodicTable.getSymbol(99), 99); - public final static IElement FERMIUM = new Element(PeriodicTable.getSymbol(100), 100); - public final static IElement MENDELEVIUM = new Element(PeriodicTable.getSymbol(101), 101); - public final static IElement NOBELIUM = new Element(PeriodicTable.getSymbol(102), 102); - public final static IElement LAWRENCIUM = new Element(PeriodicTable.getSymbol(103), 103); - public final static IElement RUTHERFORDIUM = new Element(PeriodicTable.getSymbol(104), 104); - public final static IElement DUBNIUM = new Element(PeriodicTable.getSymbol(105), 105); - public final static IElement SEABORGIUM = new Element(PeriodicTable.getSymbol(106), 106); - public final static IElement BOHRIUM = new Element(PeriodicTable.getSymbol(107), 107); - public final static IElement HASSIUM = new Element(PeriodicTable.getSymbol(108), 108); - public final static IElement MEITNERIUM = new Element(PeriodicTable.getSymbol(109), 109); - public final static IElement DARMSTADTIUM = new Element(PeriodicTable.getSymbol(110), 110); - public final static IElement ROENTGENIUM = new Element(PeriodicTable.getSymbol(111), 111); - public final static IElement UNUNBIUM = new Element(PeriodicTable.getSymbol(112), 112); - public final static IElement UNUNTRIUM = new Element(PeriodicTable.getSymbol(113), 113); - public final static IElement UNUNQUADIUM = new Element(PeriodicTable.getSymbol(114), 114); - public final static IElement UNUNPENTIUM = new Element(PeriodicTable.getSymbol(115), 115); - public final static IElement UNUNHEXIUM = new Element(PeriodicTable.getSymbol(116), 116); - + public final static IElement DUMMY = new NaturalElement(PeriodicTable.getSymbol(0), 0); + public final static IElement HYDROGEN = new NaturalElement(PeriodicTable.getSymbol(1), 1); + public final static IElement HELIUM = new NaturalElement(PeriodicTable.getSymbol(2), 2); + public final static IElement LITHIUM = new NaturalElement(PeriodicTable.getSymbol(3), 3); + public final static IElement BERYLLIUM = new NaturalElement(PeriodicTable.getSymbol(4), 4); + public final static IElement BORON = new NaturalElement(PeriodicTable.getSymbol(5), 5); + public final static IElement CARBON = new NaturalElement(PeriodicTable.getSymbol(6), 6); + public final static IElement NITROGEN = new NaturalElement(PeriodicTable.getSymbol(7), 7); + public final static IElement OXYGEN = new NaturalElement(PeriodicTable.getSymbol(8), 8); + public final static IElement FLUORINE = new NaturalElement(PeriodicTable.getSymbol(9), 9); + public final static IElement NEON = new NaturalElement(PeriodicTable.getSymbol(10), 10); + public final static IElement SODIUM = new NaturalElement(PeriodicTable.getSymbol(11), 11); + public final static IElement MAGNESIUM = new NaturalElement(PeriodicTable.getSymbol(12), 12); + public final static IElement ALUMINIUM = new NaturalElement(PeriodicTable.getSymbol(13), 13); + public final static IElement SILICON = new NaturalElement(PeriodicTable.getSymbol(14), 14); + public final static IElement PHOSPHORUS = new NaturalElement(PeriodicTable.getSymbol(15), 15); + public final static IElement SULFUR = new NaturalElement(PeriodicTable.getSymbol(16), 16); + public final static IElement CHLORINE = new NaturalElement(PeriodicTable.getSymbol(17), 17); + public final static IElement ARGON = new NaturalElement(PeriodicTable.getSymbol(18), 18); + public final static IElement POTASSIUM = new NaturalElement(PeriodicTable.getSymbol(19), 19); + public final static IElement CALCIUM = new NaturalElement(PeriodicTable.getSymbol(20), 20); + public final static IElement SCANDIUM = new NaturalElement(PeriodicTable.getSymbol(21), 21); + public final static IElement TITANIUM = new NaturalElement(PeriodicTable.getSymbol(22), 22); + public final static IElement VANADIUM = new NaturalElement(PeriodicTable.getSymbol(23), 23); + public final static IElement CHROMIUM = new NaturalElement(PeriodicTable.getSymbol(24), 24); + public final static IElement MANGANESE = new NaturalElement(PeriodicTable.getSymbol(25), 25); + public final static IElement IRON = new NaturalElement(PeriodicTable.getSymbol(26), 26); + public final static IElement COBALT = new NaturalElement(PeriodicTable.getSymbol(27), 27); + public final static IElement NICKEL = new NaturalElement(PeriodicTable.getSymbol(28), 28); + public final static IElement COPPER = new NaturalElement(PeriodicTable.getSymbol(29), 29); + public final static IElement ZINC = new NaturalElement(PeriodicTable.getSymbol(30), 30); + public final static IElement GALLIUM = new NaturalElement(PeriodicTable.getSymbol(31), 31); + public final static IElement GERMANIUM = new NaturalElement(PeriodicTable.getSymbol(32), 32); + public final static IElement ARSENIC = new NaturalElement(PeriodicTable.getSymbol(33), 33); + public final static IElement SELENIUM = new NaturalElement(PeriodicTable.getSymbol(34), 34); + public final static IElement BROMINE = new NaturalElement(PeriodicTable.getSymbol(35), 35); + public final static IElement KRYPTON = new NaturalElement(PeriodicTable.getSymbol(36), 36); + public final static IElement RUBIDIUM = new NaturalElement(PeriodicTable.getSymbol(37), 37); + public final static IElement STRONTIUM = new NaturalElement(PeriodicTable.getSymbol(38), 38); + public final static IElement YTTRIUM = new NaturalElement(PeriodicTable.getSymbol(39), 39); + public final static IElement ZIRCONIUM = new NaturalElement(PeriodicTable.getSymbol(40), 40); + public final static IElement NIOBIUM = new NaturalElement(PeriodicTable.getSymbol(41), 41); + public final static IElement MOLYBDENUM = new NaturalElement(PeriodicTable.getSymbol(42), 42); + public final static IElement TECHNETIUM = new NaturalElement(PeriodicTable.getSymbol(43), 43); + public final static IElement RUTHENIUM = new NaturalElement(PeriodicTable.getSymbol(44), 44); + public final static IElement RHODIUM = new NaturalElement(PeriodicTable.getSymbol(45), 45); + public final static IElement PALLADIUM = new NaturalElement(PeriodicTable.getSymbol(46), 46); + public final static IElement SILVER = new NaturalElement(PeriodicTable.getSymbol(47), 47); + public final static IElement CADMIUM = new NaturalElement(PeriodicTable.getSymbol(48), 48); + public final static IElement INDIUM = new NaturalElement(PeriodicTable.getSymbol(49), 49); + public final static IElement TIN = new NaturalElement(PeriodicTable.getSymbol(50), 50); + public final static IElement ANTIMONY = new NaturalElement(PeriodicTable.getSymbol(51), 51); + public final static IElement TELLURIUM = new NaturalElement(PeriodicTable.getSymbol(52), 52); + public final static IElement IODINE = new NaturalElement(PeriodicTable.getSymbol(53), 53); + public final static IElement XENON = new NaturalElement(PeriodicTable.getSymbol(54), 54); + public final static IElement CAESIUM = new NaturalElement(PeriodicTable.getSymbol(55), 55); + public final static IElement BARIUM = new NaturalElement(PeriodicTable.getSymbol(56), 56); + public final static IElement LANTHANUM = new NaturalElement(PeriodicTable.getSymbol(57), 57); + public final static IElement CERIUM = new NaturalElement(PeriodicTable.getSymbol(58), 58); + public final static IElement PRASEODYMIUM = new NaturalElement(PeriodicTable.getSymbol(59), 59); + public final static IElement NEODYMIUM = new NaturalElement(PeriodicTable.getSymbol(60), 60); + public final static IElement PROMETHIUM = new NaturalElement(PeriodicTable.getSymbol(61), 61); + public final static IElement SAMARIUM = new NaturalElement(PeriodicTable.getSymbol(62), 62); + public final static IElement EUROPIUM = new NaturalElement(PeriodicTable.getSymbol(63), 63); + public final static IElement GADOLINIUM = new NaturalElement(PeriodicTable.getSymbol(64), 64); + public final static IElement TERBIUM = new NaturalElement(PeriodicTable.getSymbol(65), 65); + public final static IElement DYSPROSIUM = new NaturalElement(PeriodicTable.getSymbol(66), 66); + public final static IElement HOLMIUM = new NaturalElement(PeriodicTable.getSymbol(67), 67); + public final static IElement ERBIUM = new NaturalElement(PeriodicTable.getSymbol(68), 68); + public final static IElement THULIUM = new NaturalElement(PeriodicTable.getSymbol(69), 69); + public final static IElement YTTERBIUM = new NaturalElement(PeriodicTable.getSymbol(70), 70); + public final static IElement LUTETIUM = new NaturalElement(PeriodicTable.getSymbol(71), 71); + public final static IElement HAFNIUM = new NaturalElement(PeriodicTable.getSymbol(72), 72); + public final static IElement TANTALUM = new NaturalElement(PeriodicTable.getSymbol(73), 73); + public final static IElement TUNGSTEN = new NaturalElement(PeriodicTable.getSymbol(74), 74); + public final static IElement RHENIUM = new NaturalElement(PeriodicTable.getSymbol(75), 75); + public final static IElement OSMIUM = new NaturalElement(PeriodicTable.getSymbol(76), 76); + public final static IElement IRIDIUM = new NaturalElement(PeriodicTable.getSymbol(77), 77); + public final static IElement PLATINUM = new NaturalElement(PeriodicTable.getSymbol(78), 78); + public final static IElement GOLD = new NaturalElement(PeriodicTable.getSymbol(79), 79); + public final static IElement MERCURY = new NaturalElement(PeriodicTable.getSymbol(80), 80); + public final static IElement THALLIUM = new NaturalElement(PeriodicTable.getSymbol(81), 81); + public final static IElement LEAD = new NaturalElement(PeriodicTable.getSymbol(82), 82); + public final static IElement BISMUTH = new NaturalElement(PeriodicTable.getSymbol(83), 83); + public final static IElement POLONIUM = new NaturalElement(PeriodicTable.getSymbol(84), 84); + public final static IElement ASTATINE = new NaturalElement(PeriodicTable.getSymbol(85), 85); + public final static IElement RADON = new NaturalElement(PeriodicTable.getSymbol(86), 86); + public final static IElement FRANCIUM = new NaturalElement(PeriodicTable.getSymbol(87), 87); + public final static IElement RADIUM = new NaturalElement(PeriodicTable.getSymbol(88), 88); + public final static IElement ACTINIUM = new NaturalElement(PeriodicTable.getSymbol(89), 89); + public final static IElement THORIUM = new NaturalElement(PeriodicTable.getSymbol(90), 90); + public final static IElement PROTACTINIUM = new NaturalElement(PeriodicTable.getSymbol(91), 91); + public final static IElement URANIUM = new NaturalElement(PeriodicTable.getSymbol(92), 92); + public final static IElement NEPTUNIUM = new NaturalElement(PeriodicTable.getSymbol(93), 93); + public final static IElement PLUTOMNIUM = new NaturalElement(PeriodicTable.getSymbol(94), 94); + public final static IElement AMERICIUM = new NaturalElement(PeriodicTable.getSymbol(95), 95); + public final static IElement CURIUM = new NaturalElement(PeriodicTable.getSymbol(96), 96); + public final static IElement BERKELIUM = new NaturalElement(PeriodicTable.getSymbol(97), 97); + public final static IElement CALIFORNIUM = new NaturalElement(PeriodicTable.getSymbol(98), 98); + public final static IElement EINSTEINIUM = new NaturalElement(PeriodicTable.getSymbol(99), 99); + public final static IElement FERMIUM = new NaturalElement(PeriodicTable.getSymbol(100), 100); + public final static IElement MENDELEVIUM = new NaturalElement(PeriodicTable.getSymbol(101), 101); + public final static IElement NOBELIUM = new NaturalElement(PeriodicTable.getSymbol(102), 102); + public final static IElement LAWRENCIUM = new NaturalElement(PeriodicTable.getSymbol(103), 103); + public final static IElement RUTHERFORDIUM = new NaturalElement(PeriodicTable.getSymbol(104), 104); + public final static IElement DUBNIUM = new NaturalElement(PeriodicTable.getSymbol(105), 105); + public final static IElement SEABORGIUM = new NaturalElement(PeriodicTable.getSymbol(106), 106); + public final static IElement BOHRIUM = new NaturalElement(PeriodicTable.getSymbol(107), 107); + public final static IElement HASSIUM = new NaturalElement(PeriodicTable.getSymbol(108), 108); + public final static IElement MEITNERIUM = new NaturalElement(PeriodicTable.getSymbol(109), 109); + public final static IElement DARMSTADTIUM = new NaturalElement(PeriodicTable.getSymbol(110), 110); + public final static IElement ROENTGENIUM = new NaturalElement(PeriodicTable.getSymbol(111), 111); + public final static IElement UNUNBIUM = new NaturalElement(PeriodicTable.getSymbol(112), 112); + public final static IElement UNUNTRIUM = new NaturalElement(PeriodicTable.getSymbol(113), 113); + public final static IElement UNUNQUADIUM = new NaturalElement(PeriodicTable.getSymbol(114), 114); + public final static IElement UNUNPENTIUM = new NaturalElement(PeriodicTable.getSymbol(115), 115); + public final static IElement UNUNHEXIUM = new NaturalElement(PeriodicTable.getSymbol(116), 116); + } diff --git a/src/main/org/openscience/cdk/config/NaturalElement.java b/src/main/org/openscience/cdk/config/NaturalElement.java new file mode 100644 index 00000000000..60dac7b736b --- /dev/null +++ b/src/main/org/openscience/cdk/config/NaturalElement.java @@ -0,0 +1,82 @@ +/* Copyright (C) 2012 Egon Willighagen + * + * 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. + * All we ask is that proper credit is given for our work, which includes + * - but is not limited to - adding the above copyright notice to the beginning + * of your source code files, and to any copyright notice that you may distribute + * with programs based on this work. + * + * 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.config; + +import java.util.Map; + +import org.openscience.cdk.interfaces.IChemObjectBuilder; +import org.openscience.cdk.interfaces.IChemObjectChangeEvent; +import org.openscience.cdk.interfaces.IChemObjectListener; +import org.openscience.cdk.interfaces.IElement; + +/** + * A read-only class used by {@link Elements} for the natural elements. This class is not to + * be used than by only {@link Elements}. + * + * @author egonw + * @cdk.module standard + * @cdk.githash + */ +public final class NaturalElement implements IElement { + + private String element; + private Integer atomicNumber; + + protected NaturalElement(String element, Integer atomicNumber) { + this.element = element; + this.atomicNumber = atomicNumber; + } + + // ignored methods + + @Override public void addListener(IChemObjectListener col) {} + @Override public int getListenerCount() { return 0; } + @Override public void removeListener(IChemObjectListener col) {} + @Override public void setNotification(boolean bool) {} + @Override public boolean getNotification() { return false; } + @Override public void notifyChanged() {} + @Override public void notifyChanged(IChemObjectChangeEvent evt) {} + + // unsupported methods + + @Override public void setProperty(Object description, Object property) {} + @Override public void removeProperty(Object description) {} + @Override public Object getProperty(Object description) { return null; } + @Override public Map getProperties() { return null; } + @Override public String getID() { return null; } + @Override public void setID(String identifier) {} + @Override public void setFlag(int flag_type, boolean flag_value) {} + @Override public boolean getFlag(int flag_type) { return false; } + @Override public void setProperties(Map properties) {} + @Override public void setFlags(boolean[] flagsNew) {} + @Override public boolean[] getFlags() { return null; } + @Override public IChemObjectBuilder getBuilder() { return null; } + @Override public void setAtomicNumber(Integer atomicNumber) {} + @Override public void setSymbol(String symbol) {} + + // implemented methods + + @Override public String getSymbol() { return element; } + @Override public Integer getAtomicNumber() { return atomicNumber; } + public Object clone() { return this; } +} diff --git a/src/main/org/openscience/cdk/fragment/ExhaustiveFragmenter.java b/src/main/org/openscience/cdk/fragment/ExhaustiveFragmenter.java index 22142efdeed..216f87ce2b7 100644 --- a/src/main/org/openscience/cdk/fragment/ExhaustiveFragmenter.java +++ b/src/main/org/openscience/cdk/fragment/ExhaustiveFragmenter.java @@ -49,7 +49,7 @@ * changed by the user. Side chains are retained. * * @author Rajarshi Guha - * @cdk.module extra + * @cdk.module fragment * @cdk.githash * @cdk.keyword fragment */ diff --git a/src/main/org/openscience/cdk/fragment/FragmentUtils.java b/src/main/org/openscience/cdk/fragment/FragmentUtils.java index d9337035036..0697c9d03b8 100644 --- a/src/main/org/openscience/cdk/fragment/FragmentUtils.java +++ b/src/main/org/openscience/cdk/fragment/FragmentUtils.java @@ -1,8 +1,4 @@ -package org.openscience.cdk.fragment; - -/* $Revision$ $Author$ $Date$ - * - * Copyright (C) 2010 Rajarshi Guha +/* Copyright (C) 2010 Rajarshi Guha * * Contact: cdk-devel@lists.sourceforge.net * @@ -24,8 +20,8 @@ * 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.fragment; -import org.openscience.cdk.DefaultChemObjectBuilder; import org.openscience.cdk.annotations.TestClass; import org.openscience.cdk.annotations.TestMethod; import org.openscience.cdk.interfaces.IAtom; @@ -43,7 +39,7 @@ * not be used by the rest of the API or by other users of the library. * * @author Rajarshi Guha - * @cdk.module extra + * @cdk.module fragment */ @TestClass("org.openscience.cdk.fragment.FragmentUtilsTest") public class FragmentUtils { @@ -104,7 +100,7 @@ protected static List splitMolecule(IAtomContainer atomContainer // of the splitting bond. In addition, the new IAtomContainer should not contain the // splitting bond itself protected static IAtomContainer makeAtomContainer(IAtom atom, List parts, IAtom excludedAtom) { - IAtomContainer partContainer = DefaultChemObjectBuilder.getInstance().newInstance(IAtomContainer.class); + IAtomContainer partContainer = atom.getBuilder().newInstance(IAtomContainer.class); partContainer.addAtom(atom); for (IBond aBond : parts) { for (IAtom bondedAtom : aBond.atoms()) { diff --git a/src/main/org/openscience/cdk/fragment/IFragmenter.java b/src/main/org/openscience/cdk/fragment/IFragmenter.java index 9e786408dee..25c83ba2f04 100644 --- a/src/main/org/openscience/cdk/fragment/IFragmenter.java +++ b/src/main/org/openscience/cdk/fragment/IFragmenter.java @@ -31,7 +31,7 @@ * An interface for classes implementing fragmentation algorithms. * * @author Rajarshi Guha - * @cdk.module extra + * @cdk.module fragment * @cdk.githash * @cdk.keyword fragment */ diff --git a/src/main/org/openscience/cdk/fragment/MurckoFragmenter.java b/src/main/org/openscience/cdk/fragment/MurckoFragmenter.java index 6069b85998c..055f4d3a2c3 100644 --- a/src/main/org/openscience/cdk/fragment/MurckoFragmenter.java +++ b/src/main/org/openscience/cdk/fragment/MurckoFragmenter.java @@ -1,6 +1,4 @@ -/* $Revision$ $Author$ $Date$ - * - * Copyright (C) 2010 Rajarshi Guha +/* Copyright (C) 2010 Rajarshi Guha * * Contact: cdk-devel@lists.sourceforge.net * @@ -30,7 +28,6 @@ import java.util.Map; import org.openscience.cdk.CDKConstants; -import org.openscience.cdk.DefaultChemObjectBuilder; import org.openscience.cdk.annotations.TestClass; import org.openscience.cdk.annotations.TestMethod; import org.openscience.cdk.exception.CDKException; @@ -41,7 +38,6 @@ import org.openscience.cdk.interfaces.IAtomContainer; import org.openscience.cdk.interfaces.IAtomContainerSet; import org.openscience.cdk.interfaces.IBond; -import org.openscience.cdk.interfaces.IChemObjectBuilder; import org.openscience.cdk.interfaces.IRingSet; import org.openscience.cdk.ringsearch.AllRingsFinder; import org.openscience.cdk.smiles.SmilesGenerator; @@ -62,7 +58,7 @@ * the largest framework. * * @author Rajarshi Guha - * @cdk.module extra + * @cdk.module fragment * @cdk.githash * @cdk.keyword fragment * @cdk.keyword framework @@ -74,7 +70,6 @@ public class MurckoFragmenter implements IFragmenter { private static final String IS_LINKER_ATOM = "linker"; SmilesGenerator smilesGenerator = new SmilesGenerator(true); - IChemObjectBuilder builder = DefaultChemObjectBuilder.getInstance(); IRingSet ringSet; Map frameMap = new HashMap(); diff --git a/src/main/org/openscience/cdk/geometry/surface/NeighborList.java b/src/main/org/openscience/cdk/geometry/surface/NeighborList.java index 72864258a65..898ee41aada 100644 --- a/src/main/org/openscience/cdk/geometry/surface/NeighborList.java +++ b/src/main/org/openscience/cdk/geometry/surface/NeighborList.java @@ -36,7 +36,7 @@ * * @author Rajarshi Guha * @cdk.created 2005-05-09 - * @cdk.module extra + * @cdk.module qsarmolecular * @cdk.githash */ public class NeighborList { diff --git a/src/main/org/openscience/cdk/geometry/surface/NumericalSurface.java b/src/main/org/openscience/cdk/geometry/surface/NumericalSurface.java index 6e19a58ac2b..8efc04eb49c 100644 --- a/src/main/org/openscience/cdk/geometry/surface/NumericalSurface.java +++ b/src/main/org/openscience/cdk/geometry/surface/NumericalSurface.java @@ -51,7 +51,7 @@ * * @author Rajarshi Guha * @cdk.created 2005-05-08 - * @cdk.module extra + * @cdk.module qsarmolecular * @cdk.githash * @cdk.bug 1846421 */ diff --git a/src/main/org/openscience/cdk/geometry/surface/Tessellate.java b/src/main/org/openscience/cdk/geometry/surface/Tessellate.java index 0f1bdb1bf55..9aab1af14ee 100644 --- a/src/main/org/openscience/cdk/geometry/surface/Tessellate.java +++ b/src/main/org/openscience/cdk/geometry/surface/Tessellate.java @@ -38,7 +38,7 @@ * * @author Rajarshi Guha * @cdk.created 2005-05-08 - * @cdk.module extra + * @cdk.module qsarmolecular * @cdk.githash */ public class Tessellate { diff --git a/src/main/org/openscience/cdk/geometry/surface/Triangle.java b/src/main/org/openscience/cdk/geometry/surface/Triangle.java index 056aff52115..0710e8efc5c 100644 --- a/src/main/org/openscience/cdk/geometry/surface/Triangle.java +++ b/src/main/org/openscience/cdk/geometry/surface/Triangle.java @@ -29,7 +29,7 @@ * fashion. * * @author Rajarshi Guha - * @cdk.module extra + * @cdk.module qsarmolecular * @cdk.githash */ public class Triangle { diff --git a/src/main/org/openscience/cdk/graph/matrix/TopologicalMatrix.java b/src/main/org/openscience/cdk/graph/matrix/TopologicalMatrix.java index 8863daca533..e72a1ce57a4 100644 --- a/src/main/org/openscience/cdk/graph/matrix/TopologicalMatrix.java +++ b/src/main/org/openscience/cdk/graph/matrix/TopologicalMatrix.java @@ -1,5 +1,7 @@ package org.openscience.cdk.graph.matrix; +import org.openscience.cdk.annotations.TestClass; +import org.openscience.cdk.annotations.TestMethod; import org.openscience.cdk.graph.PathTools; import org.openscience.cdk.interfaces.IAtomContainer; import org.openscience.cdk.graph.matrix.AdjacencyMatrix; @@ -12,9 +14,9 @@ * * @author federico * @cdk.githash - * + * @cdk.module qsarmolecular */ - +@TestClass("org.openscience.cdk.graph.matrix.TopologicalMatrixTest") public class TopologicalMatrix implements IGraphMatrix { /** @@ -23,7 +25,7 @@ public class TopologicalMatrix implements IGraphMatrix { * @param container The AtomContainer for which the matrix is calculated * @return A topological matrix representating this AtomContainer */ - + @TestMethod("testTopologicalMatrix_IAtomContainer") public static int[][] getMatrix(IAtomContainer container) { int[][]conMat = AdjacencyMatrix.getMatrix(container); int[][]TopolDistance = PathTools.computeFloydAPSP(conMat); diff --git a/src/main/org/openscience/cdk/qsar/descriptors/atomic/RDFProtonDescriptor_G3R.java b/src/main/org/openscience/cdk/qsar/descriptors/atomic/RDFProtonDescriptor_G3R.java index 369ba090df5..657c58537a1 100644 --- a/src/main/org/openscience/cdk/qsar/descriptors/atomic/RDFProtonDescriptor_G3R.java +++ b/src/main/org/openscience/cdk/qsar/descriptors/atomic/RDFProtonDescriptor_G3R.java @@ -1,6 +1,4 @@ -/* $Revision$ $Author$ $Date$ - * - * Copyright (C) 2004-2007 Matteo Floris +/* Copyright (C) 2004-2007 Matteo Floris * Copyright (C) 2006-2007 Federico * * Contact: cdk-devel@lists.sourceforge.net @@ -29,7 +27,6 @@ import javax.vecmath.Vector3d; import org.openscience.cdk.CDKConstants; -import org.openscience.cdk.Ring; import org.openscience.cdk.annotations.TestClass; import org.openscience.cdk.annotations.TestMethod; import org.openscience.cdk.aromaticity.CDKHueckelAromaticityDetector; @@ -40,6 +37,7 @@ import org.openscience.cdk.interfaces.IAtomContainer; import org.openscience.cdk.interfaces.IAtomContainerSet; import org.openscience.cdk.interfaces.IBond; +import org.openscience.cdk.interfaces.IRing; import org.openscience.cdk.interfaces.IRingSet; import org.openscience.cdk.qsar.DescriptorSpecification; import org.openscience.cdk.qsar.DescriptorValue; @@ -228,7 +226,7 @@ public DescriptorValue calculate(IAtom atom, } } IRingSet rsAtom; - Ring ring; + IRing ring; IRingSet ringsWithThisBond; // SET ISINRING FLAGS FOR BONDS // org.openscience.cdk.interfaces.IBond[] bondsInContainer = varAtomContainer.getBonds(); @@ -331,7 +329,7 @@ && getIfBondIsNotRotatable(mol, thirdBond, if (!curAtomThird.equals(neighbour0)) { rsAtom = varRingSet.getRings(thirdBond); for (IAtomContainer aRsAtom : rsAtom.atomContainers()) { - ring = (Ring) aRsAtom; + ring = (IRing) aRsAtom; if (ring.getRingSize() > 4 && ring.contains(thirdBond)) { theBondIsInA6MemberedRing = true; diff --git a/src/main/org/openscience/cdk/qsar/descriptors/atomic/RDFProtonDescriptor_GDR.java b/src/main/org/openscience/cdk/qsar/descriptors/atomic/RDFProtonDescriptor_GDR.java index 3be3a9da9c7..3856710ed8f 100644 --- a/src/main/org/openscience/cdk/qsar/descriptors/atomic/RDFProtonDescriptor_GDR.java +++ b/src/main/org/openscience/cdk/qsar/descriptors/atomic/RDFProtonDescriptor_GDR.java @@ -1,6 +1,4 @@ -/* $Revision$ $Author$ $Date$ - * - * Copyright (C) 2004-2007 Matteo Floris +/* Copyright (C) 2004-2007 Matteo Floris * Copyright (C) 2006-2007 Federico * * Contact: cdk-devel@lists.sourceforge.net @@ -29,7 +27,6 @@ import javax.vecmath.Vector3d; import org.openscience.cdk.CDKConstants; -import org.openscience.cdk.Ring; import org.openscience.cdk.annotations.TestClass; import org.openscience.cdk.annotations.TestMethod; import org.openscience.cdk.aromaticity.CDKHueckelAromaticityDetector; @@ -40,6 +37,7 @@ import org.openscience.cdk.interfaces.IAtomContainer; import org.openscience.cdk.interfaces.IAtomContainerSet; import org.openscience.cdk.interfaces.IBond; +import org.openscience.cdk.interfaces.IRing; import org.openscience.cdk.interfaces.IRingSet; import org.openscience.cdk.qsar.DescriptorSpecification; import org.openscience.cdk.qsar.DescriptorValue; @@ -219,7 +217,7 @@ public DescriptorValue calculate(IAtom atom, IAtomContainer atomContainer, IRing } } IRingSet rsAtom; - Ring ring; + IRing ring; IRingSet ringsWithThisBond; // SET ISINRING FLAGS FOR BONDS @@ -302,7 +300,7 @@ public DescriptorValue calculate(IAtom atom, IAtomContainer atomContainer, IRing if (!curAtomThird.equals(neighbour0)) { rsAtom = varRingSet.getRings(thirdBond); for (Object aRsAtom : rsAtom.atomContainers()) { - ring = (Ring) aRsAtom; + ring = (IRing) aRsAtom; if (ring.getRingSize() > 4 && ring.contains(thirdBond)) { theBondIsInA6MemberedRing = true; } diff --git a/src/main/org/openscience/cdk/qsar/descriptors/atomic/RDFProtonDescriptor_GHR.java b/src/main/org/openscience/cdk/qsar/descriptors/atomic/RDFProtonDescriptor_GHR.java index 0c783df7f3c..d9ba9d242fa 100644 --- a/src/main/org/openscience/cdk/qsar/descriptors/atomic/RDFProtonDescriptor_GHR.java +++ b/src/main/org/openscience/cdk/qsar/descriptors/atomic/RDFProtonDescriptor_GHR.java @@ -1,6 +1,4 @@ -/* $Revision$ $Author$ $Date$ - * - * Copyright (C) 2004-2007 Matteo Floris +/* Copyright (C) 2004-2007 Matteo Floris * Copyright (C) 2006-2007 Federico * * Contact: cdk-devel@lists.sourceforge.net @@ -29,7 +27,6 @@ import javax.vecmath.Vector3d; import org.openscience.cdk.CDKConstants; -import org.openscience.cdk.Ring; import org.openscience.cdk.annotations.TestClass; import org.openscience.cdk.annotations.TestMethod; import org.openscience.cdk.aromaticity.CDKHueckelAromaticityDetector; @@ -40,6 +37,7 @@ import org.openscience.cdk.interfaces.IAtomContainer; import org.openscience.cdk.interfaces.IAtomContainerSet; import org.openscience.cdk.interfaces.IBond; +import org.openscience.cdk.interfaces.IRing; import org.openscience.cdk.interfaces.IRingSet; import org.openscience.cdk.qsar.DescriptorSpecification; import org.openscience.cdk.qsar.DescriptorValue; @@ -217,7 +215,7 @@ public DescriptorValue calculate(IAtom atom, IAtomContainer atomContainer, IRing } } IRingSet rsAtom; - Ring ring; + IRing ring; IRingSet ringsWithThisBond; // SET ISINRING FLAGS FOR BONDS Iterator bondsInContainer = varAtomContainer.bonds().iterator(); @@ -302,7 +300,7 @@ public DescriptorValue calculate(IAtom atom, IAtomContainer atomContainer, IRing if (!curAtomThird.equals(neighbour0)) { rsAtom = varRingSet.getRings(thirdBond); for (int f = 0; f < rsAtom.getAtomContainerCount(); f++) { - ring = (Ring) rsAtom.getAtomContainer(f); + ring = (IRing) rsAtom.getAtomContainer(f); if (ring.getRingSize() > 4 && ring.contains(thirdBond)) { theBondIsInA6MemberedRing = true; } diff --git a/src/main/org/openscience/cdk/qsar/descriptors/atomic/RDFProtonDescriptor_GHR_topol.java b/src/main/org/openscience/cdk/qsar/descriptors/atomic/RDFProtonDescriptor_GHR_topol.java index 71ea6c661a1..600efed65fb 100644 --- a/src/main/org/openscience/cdk/qsar/descriptors/atomic/RDFProtonDescriptor_GHR_topol.java +++ b/src/main/org/openscience/cdk/qsar/descriptors/atomic/RDFProtonDescriptor_GHR_topol.java @@ -1,6 +1,4 @@ -/* $Revision$ $Author$ $Date$ - * - * Copyright (C) 2004-2007 Matteo Floris +/* Copyright (C) 2004-2007 Matteo Floris * Copyright (C) 2006-2007 Federico * * Contact: cdk-devel@lists.sourceforge.net @@ -30,7 +28,6 @@ import org._3pq.jgrapht.Edge; import org.openscience.cdk.CDKConstants; -import org.openscience.cdk.Ring; import org.openscience.cdk.annotations.TestClass; import org.openscience.cdk.annotations.TestMethod; import org.openscience.cdk.aromaticity.CDKHueckelAromaticityDetector; @@ -42,6 +39,7 @@ import org.openscience.cdk.interfaces.IAtomContainer; import org.openscience.cdk.interfaces.IAtomContainerSet; import org.openscience.cdk.interfaces.IBond; +import org.openscience.cdk.interfaces.IRing; import org.openscience.cdk.interfaces.IRingSet; import org.openscience.cdk.qsar.DescriptorSpecification; import org.openscience.cdk.qsar.DescriptorValue; @@ -217,7 +215,7 @@ public DescriptorValue calculate(IAtom atom, IAtomContainer atomContainer, IRing } } IRingSet rsAtom; - Ring ring; + IRing ring; IRingSet ringsWithThisBond; // SET ISINRING FLAGS FOR BONDS Iterator bondsInContainer = varAtomContainer.bonds().iterator(); @@ -302,7 +300,7 @@ public DescriptorValue calculate(IAtom atom, IAtomContainer atomContainer, IRing if (!curAtomThird.equals(neighbour0)) { rsAtom = varRingSet.getRings(thirdBond); for (Object aRsAtom : rsAtom.atomContainers()) { - ring = (Ring) aRsAtom; + ring = (IRing) aRsAtom; if (ring.getRingSize() > 4 && ring.contains(thirdBond)) { theBondIsInA6MemberedRing = true; } diff --git a/src/main/org/openscience/cdk/qsar/descriptors/atomic/RDFProtonDescriptor_GSR.java b/src/main/org/openscience/cdk/qsar/descriptors/atomic/RDFProtonDescriptor_GSR.java index 8d28e8f6008..e21da803781 100644 --- a/src/main/org/openscience/cdk/qsar/descriptors/atomic/RDFProtonDescriptor_GSR.java +++ b/src/main/org/openscience/cdk/qsar/descriptors/atomic/RDFProtonDescriptor_GSR.java @@ -1,6 +1,4 @@ -/* $Revision$ $Author$ $Date$ - * - * Copyright (C) 2004-2007 Matteo Floris +/* Copyright (C) 2004-2007 Matteo Floris * Copyright (C) 2006-2007 Federico * * Contact: cdk-devel@lists.sourceforge.net @@ -29,7 +27,6 @@ import javax.vecmath.Vector3d; import org.openscience.cdk.CDKConstants; -import org.openscience.cdk.Ring; import org.openscience.cdk.annotations.TestClass; import org.openscience.cdk.annotations.TestMethod; import org.openscience.cdk.aromaticity.CDKHueckelAromaticityDetector; @@ -40,6 +37,7 @@ import org.openscience.cdk.interfaces.IAtomContainer; import org.openscience.cdk.interfaces.IAtomContainerSet; import org.openscience.cdk.interfaces.IBond; +import org.openscience.cdk.interfaces.IRing; import org.openscience.cdk.interfaces.IRingSet; import org.openscience.cdk.qsar.DescriptorSpecification; import org.openscience.cdk.qsar.DescriptorValue; @@ -218,7 +216,7 @@ public DescriptorValue calculate(IAtom atom, IAtomContainer atomContainer, IRing } } IRingSet rsAtom; - Ring ring; + IRing ring; IRingSet ringsWithThisBond; // SET ISINRING FLAGS FOR BONDS Iterator bondsInContainer = varAtomContainer.bonds().iterator(); @@ -301,7 +299,7 @@ public DescriptorValue calculate(IAtom atom, IAtomContainer atomContainer, IRing if (!curAtomThird.equals(neighbour0)) { rsAtom = varRingSet.getRings(thirdBond); for (int f = 0; f < rsAtom.getAtomContainerCount(); f++) { - ring = (Ring) rsAtom.getAtomContainer(f); + ring = (IRing) rsAtom.getAtomContainer(f); if (ring.getRingSize() > 4 && ring.contains(thirdBond)) { theBondIsInA6MemberedRing = true; } diff --git a/src/main/org/openscience/cdk/qsar/descriptors/molecular/AutocorrelationDescriptorMass.java b/src/main/org/openscience/cdk/qsar/descriptors/molecular/AutocorrelationDescriptorMass.java index 4902c851a7a..9a9b6b6ff4f 100644 --- a/src/main/org/openscience/cdk/qsar/descriptors/molecular/AutocorrelationDescriptorMass.java +++ b/src/main/org/openscience/cdk/qsar/descriptors/molecular/AutocorrelationDescriptorMass.java @@ -20,7 +20,6 @@ */ package org.openscience.cdk.qsar.descriptors.molecular; -import org.openscience.cdk.ChemObject; import org.openscience.cdk.annotations.TestClass; import org.openscience.cdk.annotations.TestMethod; import org.openscience.cdk.config.IsotopeFactory; @@ -55,7 +54,7 @@ public class AutocorrelationDescriptorMass implements IMolecularDescriptor{ private static double scaledAtomicMasses(IElement element) throws java.io.IOException, ClassNotFoundException { - IsotopeFactory isofac = IsotopeFactory.getInstance(new ChemObject().getBuilder()); + IsotopeFactory isofac = IsotopeFactory.getInstance(element.getBuilder()); double realmasses = isofac.getNaturalMass(element); return (realmasses / CARBON_MASS); diff --git a/src/main/org/openscience/cdk/qsar/descriptors/molecular/ChiChainDescriptor.java b/src/main/org/openscience/cdk/qsar/descriptors/molecular/ChiChainDescriptor.java index 48c66cd0ce6..73d9a8d65d4 100644 --- a/src/main/org/openscience/cdk/qsar/descriptors/molecular/ChiChainDescriptor.java +++ b/src/main/org/openscience/cdk/qsar/descriptors/molecular/ChiChainDescriptor.java @@ -1,10 +1,4 @@ -/* - * $RCSfile$ - * $Author$ - * $Date$ - * $Revision$ - * - * Copyright (C) 2004-2007 Rajarshi Guha +/* Copyright (C) 2004-2007 Rajarshi Guha * * Contact: cdk-devel@lists.sourceforge.net * @@ -22,14 +16,12 @@ * 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.qsar.descriptors.molecular; import java.util.ArrayList; import java.util.Iterator; import java.util.List; -import org.openscience.cdk.DefaultChemObjectBuilder; import org.openscience.cdk.annotations.TestClass; import org.openscience.cdk.annotations.TestMethod; import org.openscience.cdk.atomtype.CDKAtomTypeMatcher; @@ -105,8 +97,6 @@ public class ChiChainDescriptor implements IMolecularDescriptor { public ChiChainDescriptor() { - sp = new SmilesParser(DefaultChemObjectBuilder.getInstance()); - } @TestMethod("testGetSpecification") @@ -155,6 +145,7 @@ private DescriptorValue getDummyDescriptorValue(Exception e) { @TestMethod("testCalculate_IAtomContainer") public DescriptorValue calculate(IAtomContainer container) { + if (sp == null) sp = new SmilesParser(container.getBuilder()); // we don't make a clone, since removeHydrogens returns a deep copy IAtomContainer localAtomContainer = AtomContainerManipulator.removeHydrogens(container); diff --git a/src/main/org/openscience/cdk/qsar/descriptors/molecular/ChiClusterDescriptor.java b/src/main/org/openscience/cdk/qsar/descriptors/molecular/ChiClusterDescriptor.java index 72bca5d8063..a32206e16b6 100644 --- a/src/main/org/openscience/cdk/qsar/descriptors/molecular/ChiClusterDescriptor.java +++ b/src/main/org/openscience/cdk/qsar/descriptors/molecular/ChiClusterDescriptor.java @@ -1,10 +1,4 @@ -/* - * $RCSfile$ - * $Author$ - * $Date$ - * $Revision$ - * - * Copyright (C) 2004-2007 Rajarshi Guha +/* Copyright (C) 2004-2007 Rajarshi Guha * * Contact: cdk-devel@lists.sourceforge.net * @@ -22,13 +16,11 @@ * 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.qsar.descriptors.molecular; import java.util.Iterator; import java.util.List; -import org.openscience.cdk.DefaultChemObjectBuilder; import org.openscience.cdk.annotations.TestClass; import org.openscience.cdk.annotations.TestMethod; import org.openscience.cdk.atomtype.CDKAtomTypeMatcher; @@ -98,7 +90,6 @@ public class ChiClusterDescriptor implements IMolecularDescriptor { }; public ChiClusterDescriptor() { - sp = new SmilesParser(DefaultChemObjectBuilder.getInstance()); } @TestMethod("testGetSpecification") @@ -146,6 +137,7 @@ private DescriptorValue getDummyDescriptorValue(Exception e) { @TestMethod("testCalculate_IAtomContainer") public DescriptorValue calculate(IAtomContainer container) { + if (sp == null) sp = new SmilesParser(container.getBuilder()); // removeHydrogens does a deep copy, so no need to clone IAtomContainer localAtomContainer = AtomContainerManipulator.removeHydrogens(container); diff --git a/src/main/org/openscience/cdk/qsar/descriptors/molecular/ChiIndexUtils.java b/src/main/org/openscience/cdk/qsar/descriptors/molecular/ChiIndexUtils.java index 6096ee2008f..e0630f7a1f1 100644 --- a/src/main/org/openscience/cdk/qsar/descriptors/molecular/ChiIndexUtils.java +++ b/src/main/org/openscience/cdk/qsar/descriptors/molecular/ChiIndexUtils.java @@ -18,7 +18,6 @@ */ package org.openscience.cdk.qsar.descriptors.molecular; -import org.openscience.cdk.DefaultChemObjectBuilder; import org.openscience.cdk.annotations.TestClass; import org.openscience.cdk.annotations.TestMethod; import org.openscience.cdk.config.IsotopeFactory; @@ -133,7 +132,7 @@ public static double evalSimpleIndex(IAtomContainer atomContainer, List +/* Copyright (C) 2004-2007 Rajarshi Guha * * Contact: cdk-devel@lists.sourceforge.net * @@ -27,7 +21,6 @@ import java.util.Iterator; import java.util.List; -import org.openscience.cdk.DefaultChemObjectBuilder; import org.openscience.cdk.annotations.TestClass; import org.openscience.cdk.annotations.TestMethod; import org.openscience.cdk.atomtype.CDKAtomTypeMatcher; @@ -96,7 +89,6 @@ public class ChiPathClusterDescriptor implements IMolecularDescriptor { }; public ChiPathClusterDescriptor() { - sp = new SmilesParser(DefaultChemObjectBuilder.getInstance()); } @TestMethod("testGetSpecification") @@ -136,6 +128,7 @@ public String[] getDescriptorNames() { @TestMethod("testCalculate_IAtomContainer") public DescriptorValue calculate(IAtomContainer container) { + if (sp == null) sp = new SmilesParser(container.getBuilder()); IAtomContainer localAtomContainer = AtomContainerManipulator.removeHydrogens(container); CDKAtomTypeMatcher matcher = CDKAtomTypeMatcher.getInstance(container.getBuilder()); diff --git a/src/main/org/openscience/cdk/qsar/descriptors/molecular/ChiPathDescriptor.java b/src/main/org/openscience/cdk/qsar/descriptors/molecular/ChiPathDescriptor.java index c08e389f506..526fef981d2 100644 --- a/src/main/org/openscience/cdk/qsar/descriptors/molecular/ChiPathDescriptor.java +++ b/src/main/org/openscience/cdk/qsar/descriptors/molecular/ChiPathDescriptor.java @@ -1,10 +1,4 @@ -/* -* $RCSfile$ -* $Author$ -* $Date$ -* $Revision$ -* -* Copyright (C) 2004-2007 Rajarshi Guha +/* Copyright (C) 2004-2007 Rajarshi Guha * * Contact: cdk-devel@lists.sourceforge.net * @@ -22,14 +16,12 @@ * 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.qsar.descriptors.molecular; import java.util.ArrayList; import java.util.Iterator; import java.util.List; -import org.openscience.cdk.DefaultChemObjectBuilder; import org.openscience.cdk.annotations.TestClass; import org.openscience.cdk.annotations.TestMethod; import org.openscience.cdk.atomtype.CDKAtomTypeMatcher; @@ -85,7 +77,6 @@ public class ChiPathDescriptor implements IMolecularDescriptor { private SmilesParser sp; public ChiPathDescriptor() { - sp = new SmilesParser(DefaultChemObjectBuilder.getInstance()); } @TestMethod("testGetSpecification") @@ -130,6 +121,7 @@ public String[] getDescriptorNames() { @TestMethod("testCalculate_IAtomContainer") public DescriptorValue calculate(IAtomContainer container) { + if (sp == null) sp = new SmilesParser(container.getBuilder()); IAtomContainer localAtomContainer = AtomContainerManipulator.removeHydrogens(container); CDKAtomTypeMatcher matcher = CDKAtomTypeMatcher.getInstance(container.getBuilder()); diff --git a/src/main/org/openscience/cdk/qsar/descriptors/molecular/FragmentComplexityDescriptor.java b/src/main/org/openscience/cdk/qsar/descriptors/molecular/FragmentComplexityDescriptor.java index 71cffc461b2..c5eed693cce 100644 --- a/src/main/org/openscience/cdk/qsar/descriptors/molecular/FragmentComplexityDescriptor.java +++ b/src/main/org/openscience/cdk/qsar/descriptors/molecular/FragmentComplexityDescriptor.java @@ -1,6 +1,4 @@ -/* $Revision$ $Author$ $Date$ - * - * Copyright (C) 2004-2007 Christian Hoppe +/* Copyright (C) 2004-2007 Christian Hoppe * * Contact: cdk-devel@lists.sourceforge.net * @@ -20,7 +18,6 @@ */ package org.openscience.cdk.qsar.descriptors.molecular; -import org.openscience.cdk.AtomContainer; import org.openscience.cdk.annotations.TestClass; import org.openscience.cdk.annotations.TestMethod; import org.openscience.cdk.exception.CDKException; @@ -47,7 +44,6 @@ * @cdk.set qsar-descriptors * @cdk.dictref qsar-descriptors:NilaComplexity */ - @TestClass("org.openscience.cdk.qsar.descriptors.molecular.FragmentComplexityDescriptorTest") public class FragmentComplexityDescriptor implements IMolecularDescriptor { private static final String[] names = {"fragC"}; diff --git a/src/main/org/openscience/cdk/qsar/descriptors/molecular/HybridizationRatioDescriptor.java b/src/main/org/openscience/cdk/qsar/descriptors/molecular/HybridizationRatioDescriptor.java index b00f6d7807b..934d57ed0d6 100644 --- a/src/main/org/openscience/cdk/qsar/descriptors/molecular/HybridizationRatioDescriptor.java +++ b/src/main/org/openscience/cdk/qsar/descriptors/molecular/HybridizationRatioDescriptor.java @@ -21,12 +21,12 @@ */ package org.openscience.cdk.qsar.descriptors.molecular; -import org.openscience.cdk.AtomType; import org.openscience.cdk.annotations.TestClass; import org.openscience.cdk.annotations.TestMethod; import org.openscience.cdk.exception.CDKException; import org.openscience.cdk.interfaces.IAtom; import org.openscience.cdk.interfaces.IAtomContainer; +import org.openscience.cdk.interfaces.IAtomType.Hybridization; import org.openscience.cdk.qsar.DescriptorSpecification; import org.openscience.cdk.qsar.DescriptorValue; import org.openscience.cdk.qsar.IMolecularDescriptor; @@ -132,8 +132,8 @@ public DescriptorValue calculate(IAtomContainer container) { int nsp3 = 0; for (IAtom atom : clone.atoms()) { if (!atom.getSymbol().equals("C")) continue; - if (atom.getHybridization() == AtomType.Hybridization.SP2) nsp2++; - else if (atom.getHybridization() == AtomType.Hybridization.SP3) nsp3++; + if (atom.getHybridization() == Hybridization.SP2) nsp2++; + else if (atom.getHybridization() == Hybridization.SP3) nsp3++; } double ratio = nsp3 / (double) (nsp2 + nsp3); return new DescriptorValue(getSpecification(), getParameterNames(), getParameters(), diff --git a/src/main/org/openscience/cdk/qsar/descriptors/molecular/LargestChainDescriptor.java b/src/main/org/openscience/cdk/qsar/descriptors/molecular/LargestChainDescriptor.java index a0a6c356c6d..187eefa1930 100644 --- a/src/main/org/openscience/cdk/qsar/descriptors/molecular/LargestChainDescriptor.java +++ b/src/main/org/openscience/cdk/qsar/descriptors/molecular/LargestChainDescriptor.java @@ -1,10 +1,4 @@ -/* - * $RCSfile$ - * $Author$ - * $Date$ - * $Revision$ - * - * Copyright (C) 2005-2007 Christian Hoppe +/* Copyright (C) 2005-2007 Christian Hoppe * * Contact: cdk-devel@lists.sourceforge.net * @@ -24,7 +18,6 @@ */ package org.openscience.cdk.qsar.descriptors.molecular; -import org.openscience.cdk.AtomContainer; import org.openscience.cdk.CDKConstants; import org.openscience.cdk.annotations.TestClass; import org.openscience.cdk.annotations.TestMethod; @@ -78,7 +71,6 @@ * @cdk.set qsar-descriptors * @cdk.dictref qsar-descriptors:largestChain */ - @TestClass("org.openscience.cdk.qsar.descriptors.molecular.LargestChainDescriptorTest") public class LargestChainDescriptor implements IMolecularDescriptor { private boolean checkAromaticity = false; diff --git a/src/main/org/openscience/cdk/qsar/descriptors/molecular/LargestPiSystemDescriptor.java b/src/main/org/openscience/cdk/qsar/descriptors/molecular/LargestPiSystemDescriptor.java index eb659bf419b..2b67cdd02b5 100644 --- a/src/main/org/openscience/cdk/qsar/descriptors/molecular/LargestPiSystemDescriptor.java +++ b/src/main/org/openscience/cdk/qsar/descriptors/molecular/LargestPiSystemDescriptor.java @@ -1,10 +1,4 @@ -/* - * $RCSfile$ - * $Author$ - * $Date$ - * $Revision$ - * - * Copyright (C) 2005-2007 Christian Hoppe +/* Copyright (C) 2005-2007 Christian Hoppe * * Contact: cdk-devel@lists.sourceforge.net * @@ -24,7 +18,6 @@ */ package org.openscience.cdk.qsar.descriptors.molecular; -import org.openscience.cdk.AtomContainer; import org.openscience.cdk.CDKConstants; import org.openscience.cdk.annotations.TestClass; import org.openscience.cdk.annotations.TestMethod; @@ -69,8 +62,6 @@ * @cdk.set qsar-descriptors * @cdk.dictref qsar-descriptors:largestPiSystem */ - - @TestClass("org.openscience.cdk.qsar.descriptors.molecular.LargestPiSystemDescriptorTest") public class LargestPiSystemDescriptor implements IMolecularDescriptor { diff --git a/src/main/org/openscience/cdk/qsar/descriptors/molecular/LongestAliphaticChainDescriptor.java b/src/main/org/openscience/cdk/qsar/descriptors/molecular/LongestAliphaticChainDescriptor.java index d2c403cbcc9..3718b55d8dd 100644 --- a/src/main/org/openscience/cdk/qsar/descriptors/molecular/LongestAliphaticChainDescriptor.java +++ b/src/main/org/openscience/cdk/qsar/descriptors/molecular/LongestAliphaticChainDescriptor.java @@ -1,10 +1,4 @@ -/* - * $RCSfile$ - * $Author$ - * $Date$ - * $Revision$ - * - * Copyright (C) 2005-2007 Christian Hoppe +/* Copyright (C) 2005-2007 Christian Hoppe * * Contact: cdk-devel@lists.sourceforge.net * @@ -27,9 +21,7 @@ import java.util.ArrayList; import java.util.List; -import org.openscience.cdk.AtomContainer; import org.openscience.cdk.CDKConstants; -import org.openscience.cdk.DefaultChemObjectBuilder; import org.openscience.cdk.annotations.TestClass; import org.openscience.cdk.annotations.TestMethod; import org.openscience.cdk.exception.CDKException; @@ -73,7 +65,6 @@ * @cdk.set qsar-descriptors * @cdk.dictref qsar-descriptors:largestAliphaticChain */ - @TestClass("org.openscience.cdk.qsar.descriptors.molecular.LongestAliphaticChainDescriptorTest") public class LongestAliphaticChainDescriptor implements IMolecularDescriptor { private boolean checkRingSystem = false; @@ -265,7 +256,7 @@ private int getLongestChainPath(int[][] apsp){ private IAtomContainer createAtomContainerFromPath(IAtomContainer container, List path){ - IAtomContainer aliphaticChain = DefaultChemObjectBuilder.getInstance().newInstance(IAtomContainer.class); + IAtomContainer aliphaticChain = container.getBuilder().newInstance(IAtomContainer.class); for (int i=0;i 0){ - node = (Atom)queue.pop(); + node = (IAtom)queue.pop(); mAtoms = molecule.getConnectedAtomsList(node); for (int f = 0; f < mAtoms.size(); f++){ mAtom = (IAtom)mAtoms.get(f); @@ -285,12 +283,12 @@ private Ring getRing(IAtom rootNode, IAtomContainer molecule) * @param mol The molecule this ring is a substructure of * @return The ring formed by the given atoms */ - private Ring prepareRing(List vec, IAtomContainer mol) + private IRing prepareRing(List vec, IAtomContainer mol) { // add the atoms in vec to the new ring int atomCount = vec.size(); - Ring ring = new Ring(atomCount); - Atom[] atoms = new Atom[atomCount]; + IRing ring = mol.getBuilder().newInstance(IRing.class, atomCount); + IAtom[] atoms = new IAtom[atomCount]; vec.toArray(atoms); ring.setAtoms(atoms); // add the bonds in mol to the new ring @@ -357,7 +355,7 @@ private void initPath(IAtomContainer molecule) private List getIntersection(List vec1, List vec2) { List is = new Vector(); for (int f = 0; f < vec1.size(); f++){ - if (vec2.contains((Atom)vec1.get(f))) is.add((Atom)vec1.get(f)); + if (vec2.contains((IAtom)vec1.get(f))) is.add((IAtom)vec1.get(f)); } return is; } @@ -373,7 +371,7 @@ private Vector getUnion(Vector vec1, Vector vec2){ // FIXME: the JavaDoc does not describe what happens: that vec1 gets to be the union! Vector is = (Vector)vec1.clone(); for (int f = vec2.size()- 1; f > -1; f--){ - if (!vec1.contains((Atom)vec2.elementAt(f))) is.addElement((Atom)vec2.elementAt(f)); + if (!vec1.contains((IAtom)vec2.elementAt(f))) is.addElement((IAtom)vec2.elementAt(f)); } return is; } @@ -384,7 +382,7 @@ private Vector getUnion(Vector vec1, Vector vec2){ * @param atom The atom one bond is eliminated of * @param molecule The molecule that contains the atom */ - private void breakBond(Atom atom, IAtomContainer molecule) { + private void breakBond(IAtom atom, IAtomContainer molecule) { Iterator bonds = molecule.bonds().iterator(); while (bonds.hasNext()) { IBond bond = (IBond) bonds.next(); @@ -405,10 +403,10 @@ private void breakBond(Atom atom, IAtomContainer molecule) { * @param ring * @param molecule */ - private IBond checkEdges(Ring ring, IAtomContainer molecule) + private IBond checkEdges(IRing ring, IAtomContainer molecule) { - Ring r1, r2; - RingSet ringSet = new RingSet(); + IRing r1, r2; + IRingSet ringSet = ring.getBuilder().newInstance(IRingSet.class); IBond bond; int minMaxSize = Integer.MAX_VALUE; int minMax = 0; @@ -433,9 +431,9 @@ private IBond checkEdges(Ring ring, IAtomContainer molecule) } for (int i = 0; i < ringSet.getAtomContainerCount(); i++) { - if (((Ring)ringSet.getAtomContainer(i)).getBondCount() < minMaxSize) + if (((IRing)ringSet.getAtomContainer(i)).getBondCount() < minMaxSize) { - minMaxSize = ((Ring)ringSet.getAtomContainer(i)).getBondCount(); + minMaxSize = ((IRing)ringSet.getAtomContainer(i)).getBondCount(); minMax = i; } } diff --git a/src/main/org/openscience/cdk/templates/saturatedhydrocarbons/IsoAlkanes.java b/src/main/org/openscience/cdk/templates/saturatedhydrocarbons/IsoAlkanes.java index d8aa625679f..18c59b62be9 100644 --- a/src/main/org/openscience/cdk/templates/saturatedhydrocarbons/IsoAlkanes.java +++ b/src/main/org/openscience/cdk/templates/saturatedhydrocarbons/IsoAlkanes.java @@ -1,9 +1,4 @@ -/* $RCSfile$ - * $Author$ - * $Date$ - * $Revision$ - * - * Copyright (C) 2002-2007 The Chemistry Development Kit (CDK) project +/* Copyright (C) 2002-2007 The Chemistry Development Kit (CDK) project * * Contact: cdk-devel@lists.sourceforge.net * @@ -23,10 +18,10 @@ */ package org.openscience.cdk.templates.saturatedhydrocarbons; -import org.openscience.cdk.Atom; -import org.openscience.cdk.DefaultChemObjectBuilder; +import org.openscience.cdk.interfaces.IAtom; import org.openscience.cdk.interfaces.IAtomContainer; import org.openscience.cdk.interfaces.IBond; +import org.openscience.cdk.interfaces.IChemObjectBuilder; /** * This class contains methods for generating simple organic alkanes. @@ -36,12 +31,12 @@ */ public class IsoAlkanes { - public static IAtomContainer getIsobutane() { - IAtomContainer mol = DefaultChemObjectBuilder.getInstance().newInstance(IAtomContainer.class); - mol.addAtom(new Atom("C")); - mol.addAtom(new Atom("C")); - mol.addAtom(new Atom("C")); - mol.addAtom(new Atom("C")); + public static IAtomContainer getIsobutane(IChemObjectBuilder builder) { + IAtomContainer mol = builder.newInstance(IAtomContainer.class); + mol.addAtom(builder.newInstance(IAtom.class, "C")); + mol.addAtom(builder.newInstance(IAtom.class, "C")); + mol.addAtom(builder.newInstance(IAtom.class, "C")); + mol.addAtom(builder.newInstance(IAtom.class, "C")); mol.addBond(0, 1, IBond.Order.SINGLE); mol.addBond(0, 2, IBond.Order.SINGLE); @@ -49,13 +44,13 @@ public static IAtomContainer getIsobutane() { return mol; } - public static IAtomContainer getIsopentane() { - IAtomContainer mol = DefaultChemObjectBuilder.getInstance().newInstance(IAtomContainer.class); - mol.addAtom(new Atom("C")); - mol.addAtom(new Atom("C")); - mol.addAtom(new Atom("C")); - mol.addAtom(new Atom("C")); - mol.addAtom(new Atom("C")); + public static IAtomContainer getIsopentane(IChemObjectBuilder builder) { + IAtomContainer mol = builder.newInstance(IAtomContainer.class); + mol.addAtom(builder.newInstance(IAtom.class, "C")); + mol.addAtom(builder.newInstance(IAtom.class, "C")); + mol.addAtom(builder.newInstance(IAtom.class, "C")); + mol.addAtom(builder.newInstance(IAtom.class, "C")); + mol.addAtom(builder.newInstance(IAtom.class, "C")); mol.addBond(0, 1, IBond.Order.SINGLE); mol.addBond(0, 2, IBond.Order.SINGLE); @@ -64,14 +59,14 @@ public static IAtomContainer getIsopentane() { return mol; } - public static IAtomContainer getIsohexane() { - IAtomContainer mol = DefaultChemObjectBuilder.getInstance().newInstance(IAtomContainer.class); - mol.addAtom(new Atom("C")); - mol.addAtom(new Atom("C")); - mol.addAtom(new Atom("C")); - mol.addAtom(new Atom("C")); - mol.addAtom(new Atom("C")); - mol.addAtom(new Atom("C")); + public static IAtomContainer getIsohexane(IChemObjectBuilder builder) { + IAtomContainer mol = builder.newInstance(IAtomContainer.class); + mol.addAtom(builder.newInstance(IAtom.class, "C")); + mol.addAtom(builder.newInstance(IAtom.class, "C")); + mol.addAtom(builder.newInstance(IAtom.class, "C")); + mol.addAtom(builder.newInstance(IAtom.class, "C")); + mol.addAtom(builder.newInstance(IAtom.class, "C")); + mol.addAtom(builder.newInstance(IAtom.class, "C")); mol.addBond(0, 1, IBond.Order.SINGLE); mol.addBond(0, 2, IBond.Order.SINGLE); diff --git a/src/test/org/openscience/cdk/coverage/FragmentCoverageTest.java b/src/test/org/openscience/cdk/coverage/FragmentCoverageTest.java new file mode 100644 index 00000000000..04a831c4de9 --- /dev/null +++ b/src/test/org/openscience/cdk/coverage/FragmentCoverageTest.java @@ -0,0 +1,43 @@ +/* Copyright (C) 2012 Egon Willighagen + * + * 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.coverage; + +import org.junit.BeforeClass; +import org.junit.Test; + +/** + * TestSuite that tests whether all public methods in the fragment + * module are tested. Unlike Emma, it does not test that all code is + * tested, just all methods. + * + * @cdk.module test-fragment + */ +public class FragmentCoverageTest extends CoverageAnnotationTest { + + private final static String CLASS_LIST = "fragment.javafiles"; + + @BeforeClass public static void setUp() throws Exception { + loadClassList(CLASS_LIST, FragmentCoverageTest.class.getClassLoader()); + } + + @Test public void testCoverage() { + super.runCoverageTest(); + } + +} diff --git a/src/test/org/openscience/cdk/fragment/ExhaustiveFragmenterTest.java b/src/test/org/openscience/cdk/fragment/ExhaustiveFragmenterTest.java index 5b176e18ec8..b88bf81c1c2 100644 --- a/src/test/org/openscience/cdk/fragment/ExhaustiveFragmenterTest.java +++ b/src/test/org/openscience/cdk/fragment/ExhaustiveFragmenterTest.java @@ -30,7 +30,7 @@ /** * Test exhaustive fragmenter. * - * @cdk.module test-extra + * @cdk.module test-fragment */ public class ExhaustiveFragmenterTest extends CDKTestCase { diff --git a/src/test/org/openscience/cdk/fragment/FragmentUtilsTest.java b/src/test/org/openscience/cdk/fragment/FragmentUtilsTest.java index 06161a156d1..6dddd578288 100644 --- a/src/test/org/openscience/cdk/fragment/FragmentUtilsTest.java +++ b/src/test/org/openscience/cdk/fragment/FragmentUtilsTest.java @@ -39,7 +39,7 @@ /** * Test fragment utils * - * @cdk.module test-extra + * @cdk.module test-fragment */ public class FragmentUtilsTest extends CDKTestCase { diff --git a/src/test/org/openscience/cdk/fragment/MurckoFragmenterTest.java b/src/test/org/openscience/cdk/fragment/MurckoFragmenterTest.java index 3efda833539..4854e8398a4 100644 --- a/src/test/org/openscience/cdk/fragment/MurckoFragmenterTest.java +++ b/src/test/org/openscience/cdk/fragment/MurckoFragmenterTest.java @@ -36,7 +36,7 @@ /** * Test Murcko fragmenter. * - * @cdk.module test-extra + * @cdk.module test-fragment */ public class MurckoFragmenterTest extends CDKTestCase { diff --git a/src/test/org/openscience/cdk/graph/matrix/TopologicalMatrixTest.java b/src/test/org/openscience/cdk/graph/matrix/TopologicalMatrixTest.java index a008bfc3a90..7c05d2d3418 100644 --- a/src/test/org/openscience/cdk/graph/matrix/TopologicalMatrixTest.java +++ b/src/test/org/openscience/cdk/graph/matrix/TopologicalMatrixTest.java @@ -11,7 +11,7 @@ import org.openscience.cdk.io.MDLReader; /** - * @cdk.module test-standard + * @cdk.module test-qsarmolecular */ public class TopologicalMatrixTest extends CDKTestCase { diff --git a/src/test/org/openscience/cdk/modulesuites/MextraTests.java b/src/test/org/openscience/cdk/modulesuites/MextraTests.java index a6284fbbbd8..49e8c7a1de7 100644 --- a/src/test/org/openscience/cdk/modulesuites/MextraTests.java +++ b/src/test/org/openscience/cdk/modulesuites/MextraTests.java @@ -25,8 +25,6 @@ import org.junit.runners.Suite.SuiteClasses; import org.openscience.cdk.CloneAtomContainerTest; import org.openscience.cdk.coverage.ExtraCoverageTest; -import org.openscience.cdk.fragment.ExhaustiveFragmenterTest; -import org.openscience.cdk.fragment.MurckoFragmenterTest; import org.openscience.cdk.geometry.RDFCalculatorTest; import org.openscience.cdk.geometry.alignment.KabschAlignmentTest; import org.openscience.cdk.index.CASNumberTest; @@ -56,8 +54,6 @@ ShelXWriterTest.class, BremserPredictorTest.class, ParserTest.class, - ExhaustiveFragmenterTest.class, - ReactionChainTest.class, - MurckoFragmenterTest.class + ReactionChainTest.class }) public class MextraTests {} diff --git a/src/test/org/openscience/cdk/modulesuites/MfragmentTests.java b/src/test/org/openscience/cdk/modulesuites/MfragmentTests.java new file mode 100644 index 00000000000..3058a43d917 --- /dev/null +++ b/src/test/org/openscience/cdk/modulesuites/MfragmentTests.java @@ -0,0 +1,40 @@ +/* Copyright (C) 2012 Egon Willighagen + * + * 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.modulesuites; + +import org.junit.runner.RunWith; +import org.junit.runners.Suite; +import org.junit.runners.Suite.SuiteClasses; +import org.openscience.cdk.coverage.FragmentCoverageTest; +import org.openscience.cdk.fragment.ExhaustiveFragmenterTest; +import org.openscience.cdk.fragment.FragmentUtilsTest; +import org.openscience.cdk.fragment.MurckoFragmenterTest; + +/** + * @cdk.module test-fragment + */ +@RunWith(value=Suite.class) +@SuiteClasses(value={ + FragmentCoverageTest.class, + + MurckoFragmenterTest.class, + ExhaustiveFragmenterTest.class, + FragmentUtilsTest.class +}) +public class MfragmentTests {} diff --git a/src/test/org/openscience/cdk/modulesuites/MqsarmolecularTests.java b/src/test/org/openscience/cdk/modulesuites/MqsarmolecularTests.java index 658940a696b..dfe5fcbbb6d 100644 --- a/src/test/org/openscience/cdk/modulesuites/MqsarmolecularTests.java +++ b/src/test/org/openscience/cdk/modulesuites/MqsarmolecularTests.java @@ -19,13 +19,59 @@ */ package org.openscience.cdk.modulesuites; -import org.junit.runner.RunWith; -import org.junit.runners.Suite; -import org.junit.runners.Suite.SuiteClasses; -import org.openscience.cdk.coverage.QsarmolecularCoverageTest; -import org.openscience.cdk.qsar.DescriptorEngineTest; -import org.openscience.cdk.qsar.DescriptorNamesTest; -import org.openscience.cdk.qsar.descriptors.molecular.*; +import org.junit.runner.RunWith; +import org.junit.runners.Suite; +import org.junit.runners.Suite.SuiteClasses; +import org.openscience.cdk.coverage.QsarmolecularCoverageTest; +import org.openscience.cdk.graph.matrix.TopologicalMatrixTest; +import org.openscience.cdk.qsar.DescriptorEngineTest; +import org.openscience.cdk.qsar.DescriptorNamesTest; +import org.openscience.cdk.qsar.descriptors.molecular.ALOGPDescriptorTest; +import org.openscience.cdk.qsar.descriptors.molecular.APolDescriptorTest; +import org.openscience.cdk.qsar.descriptors.molecular.AcidicGroupCountDescriptorTest; +import org.openscience.cdk.qsar.descriptors.molecular.AromaticAtomsCountDescriptorTest; +import org.openscience.cdk.qsar.descriptors.molecular.AromaticBondsCountDescriptorTest; +import org.openscience.cdk.qsar.descriptors.molecular.AtomCountDescriptorTest; +import org.openscience.cdk.qsar.descriptors.molecular.AutocorrelationDescriptorChargeTest; +import org.openscience.cdk.qsar.descriptors.molecular.AutocorrelationDescriptorMassTest; +import org.openscience.cdk.qsar.descriptors.molecular.AutocorrelationDescriptorPolarizabilityTest; +import org.openscience.cdk.qsar.descriptors.molecular.BCUTDescriptorTest; +import org.openscience.cdk.qsar.descriptors.molecular.BPolDescriptorTest; +import org.openscience.cdk.qsar.descriptors.molecular.BasicGroupCountDescriptorTest; +import org.openscience.cdk.qsar.descriptors.molecular.BondCountDescriptorTest; +import org.openscience.cdk.qsar.descriptors.molecular.CPSADescriptorTest; +import org.openscience.cdk.qsar.descriptors.molecular.CarbonTypesDescriptorTest; +import org.openscience.cdk.qsar.descriptors.molecular.ChiChainDescriptorTest; +import org.openscience.cdk.qsar.descriptors.molecular.ChiClusterDescriptorTest; +import org.openscience.cdk.qsar.descriptors.molecular.ChiIndexUtilsTest; +import org.openscience.cdk.qsar.descriptors.molecular.ChiPathClusterDescriptorTest; +import org.openscience.cdk.qsar.descriptors.molecular.ChiPathDescriptorTest; +import org.openscience.cdk.qsar.descriptors.molecular.EccentricConnectivityIndexDescriptorTest; +import org.openscience.cdk.qsar.descriptors.molecular.FMFDescriptorTest; +import org.openscience.cdk.qsar.descriptors.molecular.GravitationalIndexDescriptorTest; +import org.openscience.cdk.qsar.descriptors.molecular.HBondAcceptorCountDescriptorTest; +import org.openscience.cdk.qsar.descriptors.molecular.HBondDonorCountDescriptorTest; +import org.openscience.cdk.qsar.descriptors.molecular.HybridizationRatioDescriptorTest; +import org.openscience.cdk.qsar.descriptors.molecular.KappaShapeIndicesDescriptorTest; +import org.openscience.cdk.qsar.descriptors.molecular.KierHallSmartsDescriptorTest; +import org.openscience.cdk.qsar.descriptors.molecular.LargestChainDescriptorTest; +import org.openscience.cdk.qsar.descriptors.molecular.LargestPiSystemDescriptorTest; +import org.openscience.cdk.qsar.descriptors.molecular.LengthOverBreadthDescriptorTest; +import org.openscience.cdk.qsar.descriptors.molecular.LongestAliphaticChainDescriptorTest; +import org.openscience.cdk.qsar.descriptors.molecular.MDEDescriptorTest; +import org.openscience.cdk.qsar.descriptors.molecular.MomentOfInertiaDescriptorTest; +import org.openscience.cdk.qsar.descriptors.molecular.PetitjeanNumberDescriptorTest; +import org.openscience.cdk.qsar.descriptors.molecular.PetitjeanShapeIndexDescriptorTest; +import org.openscience.cdk.qsar.descriptors.molecular.RotatableBondsCountDescriptorTest; +import org.openscience.cdk.qsar.descriptors.molecular.RuleOfFiveDescriptorTest; +import org.openscience.cdk.qsar.descriptors.molecular.TPSADescriptorTest; +import org.openscience.cdk.qsar.descriptors.molecular.VAdjMaDescriptorTest; +import org.openscience.cdk.qsar.descriptors.molecular.WHIMDescriptorTest; +import org.openscience.cdk.qsar.descriptors.molecular.WeightDescriptorTest; +import org.openscience.cdk.qsar.descriptors.molecular.WeightedPathDescriptorTest; +import org.openscience.cdk.qsar.descriptors.molecular.WienerNumbersDescriptorTest; +import org.openscience.cdk.qsar.descriptors.molecular.XLogPDescriptorTest; +import org.openscience.cdk.qsar.descriptors.molecular.ZagrebIndexDescriptorTest; /** * TestSuite that runs all the sample tests. @@ -43,7 +89,7 @@ // Individual Tests - Please add correlatively ChiIndexUtilsTest.class, DescriptorEngineTest.class, - DescriptorNamesTest.class, + DescriptorNamesTest.class, // from cdk.test.qsar.molecular AcidicGroupCountDescriptorTest.class, @@ -90,6 +136,7 @@ AutocorrelationDescriptorPolarizabilityTest.class, CarbonTypesDescriptorTest.class, HybridizationRatioDescriptorTest.class, - FMFDescriptorTest.class + FMFDescriptorTest.class, + TopologicalMatrixTest.class }) public class MqsarmolecularTests {}