From: <mar...@us...> - 2006-10-27 10:23:10
|
Revision: 7200 http://svn.sourceforge.net/cdk/?rev=7200&view=rev Author: mario_baseda Date: 2006-10-27 03:20:30 -0700 (Fri, 27 Oct 2006) Log Message: ----------- Resulting errors, after update the cdk, removed Changed the qsar classes, so only one access to the writer class is needed to write the results as file Upgraded the test classes if the correct filename will set Modified Paths: -------------- trunk/cdk-taverna/.classpath trunk/cdk-taverna/META-INF/services/org.embl.ebi.escience.scuflworkers.java.LocalWorker trunk/cdk-taverna/build.xml trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/aromaticity/DetectHueckelAromaticity.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/atomtype/PerceiveMM2AtomTypes.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/atomtype/PerceiveMMFF94AtomTypes.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/charges/PartialChargesCalculator.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/fingerprint/FingerprintCalculator.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/io/CDKIOReader.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/io/WriteToMDLMolFile.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/io/writeCMLChemFileToFile.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/isomorphism/SubstructureFilter.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/layout/StructureDiagramCreator.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/modeling/Model3DBuilders.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/qsar/DescriptorCalculatorLocalWorker.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/qsar/descriptors/atomic/AtomCount.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/qsar/descriptors/atomic/AtomDegree.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/qsar/descriptors/atomic/AtomHybridization.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/qsar/descriptors/atomic/AtomHybridizationVSEPR.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/qsar/descriptors/atomic/AtomValence.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/qsar/descriptors/atomic/BondsToAtom.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/qsar/descriptors/atomic/CovalentRadius.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/qsar/descriptors/atomic/DistanceToAtom.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/qsar/descriptors/atomic/EffectiveAtomPolarizability.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/qsar/descriptors/atomic/IPAtomic.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/qsar/descriptors/atomic/InductiveAtomicHardness.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/qsar/descriptors/atomic/InductiveAtomicSoftness.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/qsar/descriptors/atomic/IsProtonInAromaticSystem.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/qsar/descriptors/atomic/IsProtonInConjugatedPiSystem.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/qsar/descriptors/atomic/PartialPiCharge.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/qsar/descriptors/atomic/PartialSigmaCharge.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/qsar/descriptors/atomic/PartialTChargeMMFF94.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/qsar/descriptors/atomic/PartialTChargePEOE.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/qsar/descriptors/atomic/PeriodicTablePosition.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/qsar/descriptors/atomic/PiElectronegativity.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/qsar/descriptors/atomic/ProtonTotalPartialCharge.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/qsar/descriptors/atomic/RDFProton.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/qsar/descriptors/atomic/SigmaElectronegativity.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/qsar/descriptors/atomic/VdWRadius.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/qsar/descriptors/atomic/Weight.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/qsar/descriptors/bond/BondCount.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/qsar/descriptors/bond/BondPartialPiCharge.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/qsar/descriptors/bond/BondPartialSigmaCharge.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/qsar/descriptors/bond/BondPartialTCharge.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/qsar/descriptors/bond/BondSigmaElectronegativity.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/qsar/descriptors/bond/ResonancePositiveCharge.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/qsar/descriptors/molecular/APol.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/qsar/descriptors/molecular/AminoAcidCount.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/qsar/descriptors/molecular/AromaticAtomsCount.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/qsar/descriptors/molecular/AromaticBondsCount.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/qsar/descriptors/molecular/BCUTCalculator.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/qsar/descriptors/molecular/BPol.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/qsar/descriptors/molecular/CPSACalculator.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/qsar/descriptors/molecular/CarbonConnectivityOrderOne.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/qsar/descriptors/molecular/CarbonConnectivityOrderZero.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/qsar/descriptors/molecular/ConnectivityOrderOne.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/qsar/descriptors/molecular/ConnectivityOrderZero.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/qsar/descriptors/molecular/EccentricConnectivityIndex.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/qsar/descriptors/molecular/GraviationalIndexCalculator.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/qsar/descriptors/molecular/HBondAcceptorCount.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/qsar/descriptors/molecular/HBondDonorCount.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/qsar/descriptors/molecular/KappaShapeIndicesCalculator.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/qsar/descriptors/molecular/LargestChain.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/qsar/descriptors/molecular/LargestPiSystem.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/qsar/descriptors/molecular/LongestAliphaticChain.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/qsar/descriptors/molecular/MomentOfInertia.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/qsar/descriptors/molecular/PetitjeanNumberCalculator.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/qsar/descriptors/molecular/PetitjeanShapeIndex.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/qsar/descriptors/molecular/RotatableBondsCount.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/qsar/descriptors/molecular/RuleOfFiveFilter.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/qsar/descriptors/molecular/TPSACalculator.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/qsar/descriptors/molecular/VAdjMa.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/qsar/descriptors/molecular/ValenceCarbonConnectivityOrderOne.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/qsar/descriptors/molecular/ValenceCarbonConnectivityOrderZero.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/qsar/descriptors/molecular/ValenceConnectivityOrderOne.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/qsar/descriptors/molecular/ValenceConnectivityOrderZero.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/qsar/descriptors/molecular/WHIMCalculator.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/qsar/descriptors/molecular/WeightedPath.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/qsar/descriptors/molecular/WienerNumbers.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/qsar/descriptors/molecular/XLogPCalculator.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/qsar/descriptors/molecular/ZagrebIndex.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/smiles/SmilesTools.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/test/CDKTavernaTests.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/test/basicutilities/StringDoubleConverterTest.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/test/io/CDKIOReaderTest.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/test/io/WriteToMDLMolFileTest.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/test/qsar/descriptors/atomic/AtomCountTest.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/test/qsar/descriptors/atomic/AtomDegreeTest.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/test/qsar/descriptors/atomic/AtomHybridizationTest.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/test/qsar/descriptors/atomic/AtomHybridizationVSEPRTest.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/test/qsar/descriptors/atomic/AtomValenceTest.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/test/qsar/descriptors/atomic/BondsToAtomTest.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/test/qsar/descriptors/atomic/CovalentRadiusTest.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/test/qsar/descriptors/atomic/DistanceToAtomTest.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/test/qsar/descriptors/atomic/EffectiveAtomPolarizabilityTest.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/test/qsar/descriptors/atomic/IPAtomicTest.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/test/qsar/descriptors/atomic/InductiveAtomicHardnessTest.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/test/qsar/descriptors/atomic/InductiveAtomicSoftnessTest.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/test/qsar/descriptors/atomic/IsProtonInAromaticSystemTest.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/test/qsar/descriptors/atomic/IsProtonInConjugatedPiSystemTest.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/test/qsar/descriptors/atomic/PartialPiChargeTest.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/test/qsar/descriptors/atomic/PartialSigmaChargeTest.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/test/qsar/descriptors/atomic/PartialTChargeMMFF94Test.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/test/qsar/descriptors/atomic/PartialTChargePEOETest.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/test/qsar/descriptors/atomic/PeriodicTablePositionTest.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/test/qsar/descriptors/atomic/PiElectronegativityTest.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/test/qsar/descriptors/atomic/ProtonTotalPartialChargeTest.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/test/qsar/descriptors/atomic/RDFProtonTest.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/test/qsar/descriptors/atomic/SigmaElectronegativityTest.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/test/qsar/descriptors/atomic/VdWRadiusTest.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/test/qsar/descriptors/atomic/WeightTest.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/test/qsar/descriptors/bond/BondCountTest.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/test/qsar/descriptors/bond/BondPartialPiChargeTest.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/test/qsar/descriptors/bond/BondPartialSigmaChargeTest.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/test/qsar/descriptors/bond/BondPartialTChargeTest.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/test/qsar/descriptors/bond/BondSigmaElectronegativityTest.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/test/qsar/descriptors/bond/ResonancePositiveChargeTest.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/test/qsar/descriptors/molecular/APolTest.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/test/qsar/descriptors/molecular/AminoAcidCountTest.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/test/qsar/descriptors/molecular/AromaticAtomsCountTest.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/test/qsar/descriptors/molecular/AromaticBondsCountTest.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/test/qsar/descriptors/molecular/BCUTCalculatorTest.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/test/qsar/descriptors/molecular/BPolTest.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/test/qsar/descriptors/molecular/CPSACalculatorTest.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/test/qsar/descriptors/molecular/CarbonConnectivityOrderOneTest.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/test/qsar/descriptors/molecular/CarbonConnectivityOrderZeroTest.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/test/qsar/descriptors/molecular/ConnectivityOrderOneTest.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/test/qsar/descriptors/molecular/ConnectivityOrderZeroTest.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/test/qsar/descriptors/molecular/EccentricConnectivityIndexTest.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/test/qsar/descriptors/molecular/GraviationalIndexCalculatorTest.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/test/qsar/descriptors/molecular/HBondAcceptorCountTest.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/test/qsar/descriptors/molecular/HBondDonorCountTest.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/test/qsar/descriptors/molecular/KappaShapeIndicesCalculatorTest.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/test/qsar/descriptors/molecular/LargestChainTest.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/test/qsar/descriptors/molecular/LargestPiSystemTest.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/test/qsar/descriptors/molecular/LongestAliphaticChainTest.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/test/qsar/descriptors/molecular/MomentOfInertiaTest.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/test/qsar/descriptors/molecular/PetitjeanNumberCalculatorTest.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/test/qsar/descriptors/molecular/PetitjeanShapeIndexTest.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/test/qsar/descriptors/molecular/RotatableBondsCountTest.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/test/qsar/descriptors/molecular/RuleOfFiveTest.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/test/qsar/descriptors/molecular/TPSACalculatorTest.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/test/qsar/descriptors/molecular/VAdjMaTest.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/test/qsar/descriptors/molecular/ValenceCarbonConnectivityOrderOneTest.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/test/qsar/descriptors/molecular/ValenceCarbonConnectivityOrderZeroTest.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/test/qsar/descriptors/molecular/ValenceConnectivityOrderOneTest.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/test/qsar/descriptors/molecular/ValenceConnectivityOrderZeroTest.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/test/qsar/descriptors/molecular/WHIMCalculatorTest.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/test/qsar/descriptors/molecular/WeightedPathTest.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/test/qsar/descriptors/molecular/WienerNumbersTest.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/test/qsar/descriptors/molecular/XLogPCalculatorTest.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/test/qsar/descriptors/molecular/ZagrebIndexTest.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/tools/CMLChemFileWrapper.java trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/tools/HydrogenTools.java Modified: trunk/cdk-taverna/.classpath =================================================================== --- trunk/cdk-taverna/.classpath 2006-10-26 11:06:02 UTC (rev 7199) +++ trunk/cdk-taverna/.classpath 2006-10-27 10:20:30 UTC (rev 7200) @@ -4,8 +4,8 @@ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> <classpathentry kind="lib" path="develjar/jdom-1.0.jar"/> <classpathentry kind="lib" path="develjar/junit.jar"/> - <classpathentry sourcepath="/taverna1.0" kind="lib" path="develjar/taverna-workbench-1.4.jar"/> + <classpathentry kind="lib" path="develjar/taverna-workbench-1.4.jar" sourcepath="/taverna1.0"/> <classpathentry kind="lib" path="develjar/JRI.jar"/> - <classpathentry kind="lib" path="develjar/cdk-svn-20060912.jar"/> + <classpathentry kind="lib" path="develjar/cdk-svn-20061027.jar" sourcepath="/cdk"/> <classpathentry kind="output" path="bin"/> </classpath> Modified: trunk/cdk-taverna/META-INF/services/org.embl.ebi.escience.scuflworkers.java.LocalWorker =================================================================== --- trunk/cdk-taverna/META-INF/services/org.embl.ebi.escience.scuflworkers.java.LocalWorker 2006-10-26 11:06:02 UTC (rev 7199) +++ trunk/cdk-taverna/META-INF/services/org.embl.ebi.escience.scuflworkers.java.LocalWorker 2006-10-27 10:20:30 UTC (rev 7200) @@ -3,6 +3,7 @@ org.openscience.cdk.applications.taverna.isomorphism.SubstructureFilter = chemoinformatics:Substructure Filter org.openscience.cdk.applications.taverna.aromaticity.DetectHueckelAromaticity = chemoinformatics:Hueckel Aromaticity Detector org.openscience.cdk.applications.taverna.io.writeCMLChemFileToFile = chemoinformatics:Write CMLChemFile to File +org.openscience.cdk.applications.taverna.io.WriteToMDLMolFile = chemoinformatics:Write MDL Mol File to File org.openscience.cdk.applications.taverna.bioclipse.BioclipseResultViewer = chemoinformatics:Start Bioclipse org.openscience.cdk.applications.taverna.qsar.descriptors.molecular.AminoAcidCount = CDK_QSAR_Molecular:AminoAcidCount-Descriptor org.openscience.cdk.applications.taverna.qsar.descriptors.molecular.APol = CDK_QSAR_Molecular:APol-Descriptor Modified: trunk/cdk-taverna/build.xml =================================================================== --- trunk/cdk-taverna/build.xml 2006-10-26 11:06:02 UTC (rev 7199) +++ trunk/cdk-taverna/build.xml 2006-10-27 10:20:30 UTC (rev 7200) @@ -35,7 +35,7 @@ </target> <target id="unjar.cdk" name="unjar.cdk"> - <unjar dest="${classes.dir}" src="${lib.dir}/cdk-svn-20060912.jar"> + <unjar dest="${classes.dir}" src="${lib.dir}/cdk-svn-20061027.jar"> <patternset> <include name="**/*"/> <exclude name="org/openscience/cdk/applications/jchempaint/**/*"/> Modified: trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/aromaticity/DetectHueckelAromaticity.java =================================================================== --- trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/aromaticity/DetectHueckelAromaticity.java 2006-10-26 11:06:02 UTC (rev 7199) +++ trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/aromaticity/DetectHueckelAromaticity.java 2006-10-27 10:20:30 UTC (rev 7200) @@ -31,6 +31,7 @@ import org.openscience.cdk.applications.taverna.CMLChemFile; import org.openscience.cdk.applications.taverna.LocalWorkerCDK; import org.openscience.cdk.aromaticity.HueckelAromaticityDetector; +import org.openscience.cdk.interfaces.IAtom; import org.openscience.cdk.interfaces.IAtomContainer; import org.openscience.cdk.tools.manipulator.ChemFileManipulator; @@ -46,11 +47,11 @@ private String[] inputNames = new String[] { "inputStructures" }; private String[] outputNames = new String[] { "isAromaticBooleanResult", "aromaticStructures", "nonAromaticStructures" }; - + public String[] inputNames() { return inputNames; } - + public String[] inputTypes() { return new String[] { LocalWorkerCDK.CMLChemFileList }; } @@ -70,7 +71,7 @@ List inputList = null; if(inputs.get(inputNames[0]) != null) { inputList = (List) ((DataThing) (inputs.get(inputNames[0]))) - .getDataObject(); + .getDataObject(); } else { return null; } @@ -81,8 +82,13 @@ try { for (Iterator iter = inputList.iterator(); iter.hasNext();) { CMLChemFile file = (CMLChemFile) iter.next(); - IAtomContainer[] structures = ChemFileManipulator - .getAllAtomContainers(file); + List moleculeList = ChemFileManipulator.getAllAtomContainers(file); + IAtomContainer[] structures = new IAtomContainer[moleculeList.size()]; + int p = 0; + for (Iterator iterator = moleculeList.iterator(); iterator.hasNext();){ + structures[p] = (IAtomContainer)iterator.next(); + p++; + } for (int i = 0; i < structures.length; i++) { if (HueckelAromaticityDetector .detectAromaticity(structures[i])) { Modified: trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/atomtype/PerceiveMM2AtomTypes.java =================================================================== --- trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/atomtype/PerceiveMM2AtomTypes.java 2006-10-26 11:06:02 UTC (rev 7199) +++ trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/atomtype/PerceiveMM2AtomTypes.java 2006-10-27 10:20:30 UTC (rev 7200) @@ -47,45 +47,52 @@ public class PerceiveMM2AtomTypes implements LocalWorker { private static MM2AtomTypeMatcher matcher = null; - - public String[] inputNames() { - return new String[]{"inputStructure"}; - } - public String[] inputTypes() { - return new String[]{"'java/org.openscience.cdk.applications.taverna.cmlchemfile'"}; - } - - public String[] outputNames() { - return new String[]{"outputStructure"}; - } - public String[] outputTypes() { - return new String[]{"'java/org.openscience.cdk.applications.taverna.cmlchemfile'"}; - } - - public Map execute(Map inputs) throws TaskExecutionException { - if (matcher == null) matcher = new MM2AtomTypeMatcher(); - - CMLChemFile file = (CMLChemFile)((DataThing)(inputs.get("inputStructure"))).getDataObject(); - Map output = new HashMap(); - try { - IAtomContainer[] molecules = ChemFileManipulator.getAllAtomContainers(file); - for (int i=0; i<molecules.length; i++) { - IAtom[] atoms = molecules[i].getAtoms(); - for (int j=0; j<atoms.length; j++) { - IAtomType type = matcher.findMatchingAtomType(molecules[i], atoms[j]); - atoms[i].setAtomTypeName(type.getAtomTypeName()); - // FIXME: maybe should do a full atom type configuration?? - } - } - - output.put("outputStructure", - DataThingFactory.bake(file) - ); - } catch (Exception exception) { - throw new TaskExecutionException(exception); - } - return output; - } + public String[] inputNames() { + return new String[]{"inputStructure"}; + } + public String[] inputTypes() { + return new String[]{"'java/org.openscience.cdk.applications.taverna.cmlchemfile'"}; + } + public String[] outputNames() { + return new String[]{"outputStructure"}; + } + public String[] outputTypes() { + return new String[]{"'java/org.openscience.cdk.applications.taverna.cmlchemfile'"}; + } + + public Map execute(Map inputs) throws TaskExecutionException { + if (matcher == null) matcher = new MM2AtomTypeMatcher(); + + + CMLChemFile file = (CMLChemFile)((DataThing)(inputs.get("inputStructure"))).getDataObject(); + Map output = new HashMap(); + try { + List moleculeList = ChemFileManipulator.getAllAtomContainers(file); + int z = 0; + List allAtoms = new ArrayList(); + for (Iterator iterator = moleculeList.iterator(); iterator.hasNext();){ + IAtomContainer[] molecules = {(IAtomContainer)iterator.next()}; + for (Iterator atoms = molecules[0].atoms(); atoms.hasNext();){ + allAtoms.add(atoms.next()); + } + for (int j=0; j<allAtoms.size(); j++) { + IAtomType type = matcher.findMatchingAtomType(molecules[0], ((IAtom)allAtoms.get(j))); + ((IAtom)(allAtoms.get(z))).setAtomTypeName(type.getAtomTypeName()); + // FIXME: maybe should do a full atom type configuration?? + } + z++; + allAtoms.clear(); + } + + output.put("outputStructure", + DataThingFactory.bake(file) + ); + } catch (Exception exception) { + throw new TaskExecutionException(exception); + } + return output; + } + } Modified: trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/atomtype/PerceiveMMFF94AtomTypes.java =================================================================== --- trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/atomtype/PerceiveMMFF94AtomTypes.java 2006-10-26 11:06:02 UTC (rev 7199) +++ trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/atomtype/PerceiveMMFF94AtomTypes.java 2006-10-27 10:20:30 UTC (rev 7200) @@ -25,7 +25,10 @@ */ package org.openscience.cdk.applications.taverna.atomtype; +import java.util.ArrayList; import java.util.HashMap; +import java.util.Iterator; +import java.util.List; import java.util.Map; import org.embl.ebi.escience.baclava.DataThing; @@ -42,43 +45,50 @@ public class PerceiveMMFF94AtomTypes implements LocalWorker{ - private static MMFF94AtomTypeMatcher matcher; - public String[] inputNames() { - return new String[]{"inputStructure"}; - } - public String[] inputTypes() { - return new String[]{"'java/org.openscience.cdk.applications.taverna.cmlchemfile'"}; - } - - public String[] outputNames() { - return new String[]{"outputStructure"}; - } - public String[] outputTypes() { - return new String[]{"'java/org.openscience.cdk.applications.taverna.cmlchemfile'"}; - } - public Map execute(Map inputs) throws TaskExecutionException { - if (matcher == null) matcher = new MMFF94AtomTypeMatcher(); - - CMLChemFile file = (CMLChemFile)((DataThing)(inputs.get("inputStructure"))).getDataObject(); - Map output = new HashMap(); - try { - IAtomContainer[] molecules = ChemFileManipulator.getAllAtomContainers(file); - for (int i=0; i<molecules.length; i++) { - IAtom[] atoms = molecules[i].getAtoms(); - for (int j=0; j<atoms.length; j++) { - IAtomType type = matcher.findMatchingAtomType(molecules[i], atoms[j]); - atoms[i].setAtomTypeName(type.getAtomTypeName()); - // FIXME: maybe should do a full atom type configuration?? - } - } - - output.put("outputStructure", - DataThingFactory.bake(file) - ); - } catch (Exception exception) { - throw new TaskExecutionException(exception); - } - return output; - } + private static MMFF94AtomTypeMatcher matcher; + public String[] inputNames() { + return new String[]{"inputStructure"}; + } + public String[] inputTypes() { + return new String[]{"'java/org.openscience.cdk.applications.taverna.cmlchemfile'"}; + } + public String[] outputNames() { + return new String[]{"outputStructure"}; + } + public String[] outputTypes() { + return new String[]{"'java/org.openscience.cdk.applications.taverna.cmlchemfile'"}; + } + public Map execute(Map inputs) throws TaskExecutionException { + if (matcher == null) matcher = new MMFF94AtomTypeMatcher(); + + CMLChemFile file = (CMLChemFile)((DataThing)(inputs.get("inputStructure"))).getDataObject(); + Map output = new HashMap(); + try { + List moleculeList = ChemFileManipulator.getAllAtomContainers(file); + int z = 0; + List allAtoms = new ArrayList(); + for (Iterator iterator = moleculeList.iterator(); iterator.hasNext();){ + IAtomContainer[] molecules = {(IAtomContainer)iterator.next()}; + for (Iterator atoms = molecules[0].atoms(); atoms.hasNext();){ + allAtoms.add(atoms.next()); + } + for (int j=0; j<allAtoms.size(); j++) { + IAtomType type = matcher.findMatchingAtomType(molecules[0], ((IAtom)allAtoms.get(j))); + ((IAtom)(allAtoms.get(z))).setAtomTypeName(type.getAtomTypeName()); + // FIXME: maybe should do a full atom type configuration?? + } + z++; + allAtoms.clear(); + } + + output.put("outputStructure", + DataThingFactory.bake(file) + ); + } catch (Exception exception) { + throw new TaskExecutionException(exception); + } + return output; + } + } Modified: trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/charges/PartialChargesCalculator.java =================================================================== --- trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/charges/PartialChargesCalculator.java 2006-10-26 11:06:02 UTC (rev 7199) +++ trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/charges/PartialChargesCalculator.java 2006-10-27 10:20:30 UTC (rev 7200) @@ -26,6 +26,10 @@ package org.openscience.cdk.applications.taverna.charges; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + import org.openscience.cdk.applications.taverna.CMLChemFile; import org.openscience.cdk.charges.GasteigerMarsiliPartialCharges; import org.openscience.cdk.charges.InductivePartialCharges; @@ -39,7 +43,7 @@ private static GasteigerMarsiliPartialCharges gmCalculator; private static InductivePartialCharges indCalculator; private static MMFF94PartialCharges mmff94Calculator; - + /** * Calculates Gasteiger-Marsili partial charges. * @@ -47,8 +51,13 @@ */ public static CMLChemFile calculateGesteigerMarsiliPartialCharges(CMLChemFile file) throws Exception { if (gmCalculator == null) gmCalculator = new GasteigerMarsiliPartialCharges(); - - IAtomContainer[] molecules = ChemFileManipulator.getAllAtomContainers(file); + List moleculeList = ChemFileManipulator.getAllAtomContainers(file); + IAtomContainer[] molecules = new IAtomContainer[moleculeList.size()]; + int p = 0; + for (Iterator iterator = moleculeList.iterator(); iterator.hasNext();){ + molecules[p] = (IAtomContainer)iterator.next(); + p++; + } for (int i=0; i<molecules.length; i++) { try { gmCalculator.assignGasteigerMarsiliSigmaPartialCharges(molecules[i], true); @@ -57,7 +66,7 @@ // what to do about it?? } } - + return file; } @@ -68,27 +77,33 @@ */ public static CMLChemFile calculateInductivePartialCharges(CMLChemFile file) throws Exception { if (indCalculator == null) indCalculator = new InductivePartialCharges(); - - IAtomContainer[] molecules = ChemFileManipulator.getAllAtomContainers(file); - for (int i=0; i<molecules.length; i++) { + List moleculeList = ChemFileManipulator.getAllAtomContainers(file); + int z = 0; + List allAtoms = new ArrayList(); + for (Iterator iterator = moleculeList.iterator(); iterator.hasNext();){ + IAtomContainer[] molecules = {(IAtomContainer)iterator.next()}; + for (Iterator atoms = molecules[0].atoms(); atoms.hasNext();){ + allAtoms.add(atoms.next()); + } try { - indCalculator.assignInductivePartialCharges(molecules[i]); - IAtom[] atoms = molecules[i].getAtoms(); - for (int j=0; j<atoms.length; j++) { - Object object = atoms[i].getProperty("InductivePartialCharge"); + indCalculator.assignInductivePartialCharges(molecules[0]); + for (int j=0; j<allAtoms.size(); j++) { + Object object = ((IAtom)allAtoms.get(z)).getProperty("InductivePartialCharge"); if (object != null && object instanceof Double) { - atoms[j].setCharge(((Double)object).doubleValue()); + ((IAtom)allAtoms.get(j)).setCharge(((Double)object).doubleValue()); } } } catch (Exception exception) { // this is going to happen a lot :( // what to do about it?? } + z++; + allAtoms.clear(); } - + return file; } - + /** * Calculates MMFF94 partial charges.. * @@ -96,24 +111,28 @@ */ public static CMLChemFile calculateMMFF94PartialCharges(CMLChemFile file) throws Exception { if (mmff94Calculator == null) mmff94Calculator = new MMFF94PartialCharges(); - - IAtomContainer[] molecules = ChemFileManipulator.getAllAtomContainers(file); - for (int i=0; i<molecules.length; i++) { + List moleculeList = ChemFileManipulator.getAllAtomContainers(file); + int z = 0; + List allAtoms = new ArrayList(); + for (Iterator iterator = moleculeList.iterator(); iterator.hasNext();){ + IAtomContainer[] molecules = {(IAtomContainer)iterator.next()}; + for (Iterator atoms = molecules[0].atoms(); atoms.hasNext();){ + allAtoms.add(atoms.next()); + } try { - mmff94Calculator.assignMMFF94PartialCharges(molecules[i]); - IAtom[] atoms = molecules[i].getAtoms(); - for (int j=0; j<atoms.length; j++) { - Object object = atoms[i].getProperty("MMFF94charge"); + mmff94Calculator.assignMMFF94PartialCharges(molecules[0]); + for (int j=0; j<allAtoms.size(); j++) { + Object object = ((IAtom)allAtoms.get(z)).getProperty("MMFF94charge"); if (object != null && object instanceof Double) { - atoms[j].setCharge(((Double)object).doubleValue()); + ((IAtom)allAtoms.get(j)).setCharge(((Double)object).doubleValue()); } } } catch (Exception exception) { // this is going to happen a lot :( // what to do about it?? } + z++; } - return file; } } Modified: trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/fingerprint/FingerprintCalculator.java =================================================================== --- trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/fingerprint/FingerprintCalculator.java 2006-10-26 11:06:02 UTC (rev 7199) +++ trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/fingerprint/FingerprintCalculator.java 2006-10-27 10:20:30 UTC (rev 7200) @@ -26,6 +26,9 @@ package org.openscience.cdk.applications.taverna.fingerprint; import java.util.BitSet; +import java.util.Iterator; +import java.util.List; + import org.openscience.cdk.applications.taverna.CMLChemFile; import org.openscience.cdk.exception.CDKException; import org.openscience.cdk.fingerprint.Fingerprinter; @@ -36,14 +39,20 @@ public class FingerprintCalculator { private static IFingerprinter fingerprinter = new Fingerprinter(); - + /** * Calculates a atom-path based fingerprint using the CDK algorithm. * * @taverna.consume */ public static BitSet calculateFingerprint(CMLChemFile file) throws Exception { - IAtomContainer[] molecules = ChemFileManipulator.getAllAtomContainers(file); + List moleculeList = ChemFileManipulator.getAllAtomContainers(file); + IAtomContainer[] molecules = new IAtomContainer[moleculeList.size()]; + int p = 0; + for (Iterator iterator = moleculeList.iterator(); iterator.hasNext();){ + molecules[p] = (IAtomContainer)iterator.next(); + p++; + } BitSet bitSet = null; for (int i=0; i<molecules.length; i++) { try { @@ -52,7 +61,7 @@ throw new CDKException("Could not calculate Fingerprints"); } } - + return bitSet; } } Modified: trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/io/CDKIOReader.java =================================================================== --- trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/io/CDKIOReader.java 2006-10-26 11:06:02 UTC (rev 7199) +++ trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/io/CDKIOReader.java 2006-10-27 10:20:30 UTC (rev 7200) @@ -28,12 +28,14 @@ import java.io.File; import java.io.FileReader; import java.util.ArrayList; +import java.util.Iterator; import java.util.List; import org.openscience.cdk.ChemSequence; import org.openscience.cdk.Reaction; import org.openscience.cdk.applications.taverna.CMLChemFile; import org.openscience.cdk.applications.taverna.basicutilities.FileNameGenerator; +import org.openscience.cdk.interfaces.IAtomContainer; import org.openscience.cdk.interfaces.IChemModel; import org.openscience.cdk.interfaces.IChemSequence; import org.openscience.cdk.interfaces.IMolecule; @@ -48,7 +50,7 @@ public class CDKIOReader { /** - * Reads the contents of a SMILES into a set of CML String's. + * Reads the contents of a SMILES into a set of CMLChemFile. * * @taverna.consume * @@ -57,25 +59,25 @@ * @throws Exception Thrown when a IO exception occured */ public static CMLChemFile[] readFromSMILESFile(String filename) throws Exception { - SMILESReader reader = new SMILESReader( - new FileReader(new File(filename)) - ); - IMoleculeSet som = (IMoleculeSet)reader.read(new CMLChemFile().getBuilder().newMoleculeSet()); - IMoleculeSet som2D = new CMLChemFile().getBuilder().newMoleculeSet(); - StructureDiagramGenerator str = new StructureDiagramGenerator(); - for (int i = 0; i < som.getMoleculeCount(); i++) { + SMILESReader reader = new SMILESReader( + new FileReader(new File(filename)) + ); + IMoleculeSet som = (IMoleculeSet)reader.read(new CMLChemFile().getBuilder().newMoleculeSet()); + IMoleculeSet som2D = new CMLChemFile().getBuilder().newMoleculeSet(); + StructureDiagramGenerator str = new StructureDiagramGenerator(); + for (int i = 0; i < som.getMoleculeCount(); i++) { str.setMolecule(som.getMolecule(i)); str.generateCoordinates(); som2D.addMolecule(str.getMolecule()); } - CMLChemFile[] results = new CMLChemFile[som2D.getMoleculeCount()]; - for (int i=0; i<results.length; i++) { - results[i] = wrapInChemModel(som2D.getMolecule(i)); - } - - return results; + CMLChemFile[] results = new CMLChemFile[som2D.getMoleculeCount()]; + for (int i=0; i<results.length; i++) { + results[i] = wrapInChemModel(som2D.getMolecule(i)); + } + + return results; } - + /** * Mehod which wraps a IMolecule to an CMLChemfile * @param molecule @@ -87,13 +89,13 @@ IChemSequence sequence = molecule.getBuilder().newChemSequence(); IMoleculeSet moleculeSet = molecule.getBuilder().newMoleculeSet(); moleculeSet.addMolecule(molecule); - model.setSetOfMolecules(moleculeSet); + model.setMoleculeSet(moleculeSet); sequence.addChemModel(model); file.addChemSequence(sequence); - + return file; } - + /** * Method which converts a cmlChemFile which contains multiple molecules to an * array of cmlChemFiles which contains only one molecle @@ -101,31 +103,28 @@ * @return Array of cmlChemFiles */ public static CMLChemFile[] wrapInChemModelArray(CMLChemFile cmlChemFile) { - IChemSequence[] chemSequences = cmlChemFile.getChemSequences(); - + FileNameGenerator fileNameGenerator = new FileNameGenerator(); int numberOfChemModels = 0; int chemModelNumber = 0; - for (int i = 0; i < chemSequences.length; i++) { - numberOfChemModels += chemSequences[i].getChemModelCount(); + for (Iterator iterator = cmlChemFile.chemSequences(); iterator.hasNext();){ + numberOfChemModels += ((IChemSequence) iterator.next()).getChemModelCount(); } CMLChemFile[] result = new CMLChemFile[numberOfChemModels]; - for (int i = 0; i < chemSequences.length; i++) { - IChemModel[] chemModel = chemSequences[i].getChemModels(); - for (int j = 0; j < chemModel.length; j++) { + for (Iterator iterator = cmlChemFile.chemSequences(); iterator.hasNext();){ + for (Iterator iter = ((IChemSequence) iterator.next()).chemModels(); iter.hasNext();){ + IChemModel[] chemModel = {(IChemModel) iter.next()}; result[chemModelNumber] = new CMLChemFile(); IChemSequence sequence = new ChemSequence(); - sequence.addChemModel(chemModel[j]); + sequence.addChemModel(chemModel[0]); result[chemModelNumber].addChemSequence(sequence); - List<String> fileName = new ArrayList<String>(); - - result[chemModelNumber].setProperty(FileNameGenerator.FILENAME, fileName); + result[chemModelNumber].setProperty(FileNameGenerator.FILENAME, fileNameGenerator.getNewFileNameList()); chemModelNumber++; } } return result; } /** - * Reads the contents of a MDL molfile into a CML String. + * Reads the contents of a MDL molfile into a CMLChemFile. * * @taverna.consume * @@ -135,16 +134,14 @@ */ public static CMLChemFile[] readFromMDLFile(String filename) throws Exception { CMLChemFile model = new CMLChemFile(); - IChemObjectReader reader = new MDLReader( - new FileReader(new File(filename)) + new FileReader(new File(filename)) ); reader.read(model); - return wrapInChemModelArray(model); } /** - * Reads the contents of a MDL SD file into a CML String. + * Reads the contents of a MDL SD file into a CMLChemFile. * * @taverna.consume */ Modified: trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/io/WriteToMDLMolFile.java =================================================================== --- trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/io/WriteToMDLMolFile.java 2006-10-26 11:06:02 UTC (rev 7199) +++ trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/io/WriteToMDLMolFile.java 2006-10-27 10:20:30 UTC (rev 7200) @@ -30,6 +30,7 @@ import java.io.PrintWriter; import java.io.StringWriter; import java.io.Writer; +import java.util.ArrayList; import java.util.Date; import java.util.HashMap; import java.util.Iterator; @@ -47,83 +48,76 @@ import uk.ac.soton.itinnovation.taverna.enactor.entities.TaskExecutionException; public class WriteToMDLMolFile implements LocalWorkerCDK{ private static int count = 0; - private String[] inputNames = new String[] { "inputStructures", "fileName" }; + private String[] inputNames = new String[] { "inputStructures"}; private String[] outputNames = new String[] { "Comment" }; - + // Region: input and outpout definition - + public String[] inputNames() { - return inputNames; - } - public String[] inputTypes() { - return new String[] { LocalWorkerCDK.CMLChemFileList, LocalWorkerCDK.STRING_ARRAY }; - } - - public String[] outputNames() { - return outputNames; - } - public String[] outputTypes() { - return new String[] {LocalWorkerCDK.STRING_ARRAY}; - } - - // End of region - - // Region: local worker execution - public Map execute(Map inputs) throws TaskExecutionException { - List inputList = null; - List fileNameList = null; - Date date = new Date(); - FileNameGenerator fileNameGenerator = new FileNameGenerator(); - int counter = 0; - String comment = "false"; - - if(inputs.get("inputStructures") != null) { - inputList = (List)((DataThing)(inputs.get("inputStructures"))).getDataObject(); - } else { - return null; - } - if((List)((DataThing)(inputs.get("fileName"))).getDataObject()!= null){ - fileNameList = (List)((DataThing)(inputs.get("fileName"))).getDataObject(); - } - else { - //fileNameList.add(0, "DefaultName" + date.getTime()); - fileNameList = null; - } - try { - String[] mdlContent = new String[1]; - for (Iterator iter = inputList.iterator(); iter.hasNext(); ) { - CMLChemFile file = (CMLChemFile)iter.next(); - String fileName = "ForSafty" + date.getTime() + ".mol"; - for (int i = 0; i < fileNameList.size(); i++) { - fileName = ""; - fileName += (String) fileNameList.get(0); - fileName += ".mol"; + return inputNames; + } + public String[] inputTypes() { + return new String[] { LocalWorkerCDK.CMLChemFileList, LocalWorkerCDK.STRING_ARRAY }; + } + + public String[] outputNames() { + return outputNames; + } + public String[] outputTypes() { + return new String[] {LocalWorkerCDK.STRING_ARRAY}; + } + + // End of region + + // Region: local worker execution + public Map execute(Map inputs) throws TaskExecutionException { + List inputList = null; + List matchedList = new ArrayList(); + FileNameGenerator fileNameGenerator = new FileNameGenerator(); + int counter = 0; + String comment = "false"; + if(inputs.get("inputStructures") != null) { + inputList = (List)((DataThing)(inputs.get("inputStructures"))).getDataObject(); + if (inputList.isEmpty()){ + matchedList.add("no entrie in list"); + Map outputs = new HashMap(); + outputs.put(outputNames[0], new DataThing(matchedList)); + return outputs; + } + } else { + matchedList.add("no entrie in map"); + Map outputs = new HashMap(); + outputs.put(outputNames[0], new DataThing(matchedList)); + return outputs; + } + try { + String[] mdlContent = new String[1]; + for (Iterator iter = inputList.iterator(); iter.hasNext(); ) { + CMLChemFile file = (CMLChemFile)iter.next(); + // Convert to MDL mol file + StringWriter writer = new StringWriter(); + MDLWriter molWriter = new MDLWriter(writer); + molWriter.write(file); + mdlContent[0] = writer.toString(); + if(mdlContent[0].length() != 0){ + count++; + writeFile(mdlContent, fileNameGenerator.generateFileNameAndPathFromList((List<String>)file.getProperty(FileNameGenerator.FILENAME), ".mol"), CDKTavernaConfig.getPathOfFileWriting()); } - // Convert to MDL mol file - StringWriter writer = new StringWriter(); - MDLWriter molWriter = new MDLWriter(writer); - molWriter.write(file); - - mdlContent[0] = writer.toString(); - - if(mdlContent[0].length() != 0){ - count++; - writeFile(mdlContent, fileNameGenerator.generateFileNameAndPathFromList((List<String>)file.getProperty(FileNameGenerator.FILENAME), ".mol"), CDKTavernaConfig.getPathOfFileWriting()); - } - else { - counter++; - System.out.println("Emtpyfile: " + counter); - } - comment = "true " + count; - } - } catch (Exception exception) { - throw new TaskExecutionException(exception); - } - Map outputs = new HashMap(); - outputs.put("done", new DataThing(comment)); - return outputs; - } -// End of region + else { + counter++; + System.out.println("Emtpyfile: " + counter); + } + comment = "true " + count; + matchedList.add((String)comment); + } + } catch (Exception exception) { + throw new TaskExecutionException(exception); + } + Map outputs = new HashMap(); + outputs.put(outputNames[0], new DataThing(matchedList)); + return outputs; + } +// End of region private void writeFile(String[] content, String fileName, String path) throws Exception { PrintWriter pw = null; Modified: trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/io/writeCMLChemFileToFile.java =================================================================== --- trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/io/writeCMLChemFileToFile.java 2006-10-26 11:06:02 UTC (rev 7199) +++ trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/io/writeCMLChemFileToFile.java 2006-10-27 10:20:30 UTC (rev 7200) @@ -31,6 +31,7 @@ import java.util.Iterator; import java.util.List; import java.util.Map; +import org.openscience.cdk.applications.taverna.basicutilities.FileNameGenerator; import org.embl.ebi.escience.baclava.DataThing; import org.embl.ebi.escience.scuflworkers.java.LocalWorker; @@ -41,66 +42,61 @@ import uk.ac.soton.itinnovation.taverna.enactor.entities.TaskExecutionException; public class writeCMLChemFileToFile implements LocalWorkerCDK{ - private String[] inputNames = new String[] { "inputStructures", "fileName" }; + private String[] inputNames = new String[] { "inputStructures"}; private String[] outputNames = new String[] { "Comment" }; // Region: input and outpout definition - - public String[] inputNames() { - return inputNames; - } - public String[] inputTypes() { - return new String[] { LocalWorkerCDK.CMLChemFileList, LocalWorkerCDK.STRING_ARRAY }; - } - - public String[] outputNames() { - return outputNames; - } - public String[] outputTypes() { - return new String[] {LocalWorker.STRING_ARRAY}; - } - - // End of region - - // Region: local worker execution - - public Map execute(Map inputs) throws TaskExecutionException { - List inputList = null; - List fileNameList = null; - Date date = new Date(); - List matchedList = new ArrayList(); - if(inputs.get(inputNames[0]) != null) { - inputList = (List)((DataThing)(inputs.get(inputNames[0]))).getDataObject(); - } else { - return null; - } - if((List)((DataThing)(inputs.get(inputNames[1]))).getDataObject()!= null){ - fileNameList = (List)((DataThing)(inputs.get(inputNames[1]))).getDataObject(); - } - else { - fileNameList.add(0, "ForSafty" + date.getTime() + ".cml"); - } - try { - for (Iterator iter = inputList.iterator(); iter.hasNext(); ) { - CMLChemFile file = (CMLChemFile)iter.next(); - String fileName = null; - // FIXME Different file name handling would be better!! Correct this! - for (int i = 0; i < fileNameList.size(); i++) { - if(((String) fileNameList.get(0)).length() != 0) { - fileName = (String) fileNameList.get(0); - } else { - fileName = "ForSafty" + date.getTime() + ".cml"; - } - } - CDKIOFileWriter.writeCMLChemFileToFile(new CMLChemFile[] {file}, fileName, - CDKTavernaConfig.getPathOfFileWriting() + File.separator + fileName.substring(0, fileName.length()-4)); - matchedList.add("done"); - } - } catch (Exception exception) { - throw new TaskExecutionException(exception); - } - Map outputs = new HashMap(); - outputs.put(outputNames[0], new DataThing(matchedList)); - return outputs; - } - // End of region + + public String[] inputNames() { + return inputNames; + } + public String[] inputTypes() { + return new String[] { LocalWorkerCDK.CMLChemFileList}; + } + + public String[] outputNames() { + return outputNames; + } + public String[] outputTypes() { + return new String[] {LocalWorker.STRING_ARRAY}; + } + + // End of region + + // Region: local worker execution + + public Map execute(Map inputs) throws TaskExecutionException { + FileNameGenerator fileNameGenerator = new FileNameGenerator(); + List inputList = null; + List matchedList = new ArrayList(); + if(inputs.get(inputNames[0]) != null) { + inputList = (List)((DataThing)(inputs.get(inputNames[0]))).getDataObject(); + if (inputList.isEmpty()){ + matchedList.add("no entrie in list"); + Map outputs = new HashMap(); + outputs.put(outputNames[0], new DataThing(matchedList)); + return outputs; + } + } + else { + matchedList.add("no entrie in map"); + Map outputs = new HashMap(); + outputs.put(outputNames[0], new DataThing(matchedList)); + return outputs; + } + try { + for (Iterator iter = inputList.iterator(); iter.hasNext(); ) { + CMLChemFile file = (CMLChemFile)iter.next(); + String fileName = fileNameGenerator.generateFileNameAndPathFromList((List<String>) file.getProperty(fileNameGenerator.FILENAME), ""); + CDKIOFileWriter.writeCMLChemFileToFile(new CMLChemFile[] {file}, fileName, + CDKTavernaConfig.getPathOfFileWriting()); + matchedList.add("done"); + } + } catch (Exception exception) { + throw new TaskExecutionException(exception); + } + Map outputs = new HashMap(); + outputs.put(outputNames[0], new DataThing(matchedList)); + return outputs; + } + // End of region } Modified: trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/isomorphism/SubstructureFilter.java =================================================================== --- trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/isomorphism/SubstructureFilter.java 2006-10-26 11:06:02 UTC (rev 7199) +++ trunk/cdk-taverna/src/org/openscience/cdk/applications/taverna/isomorphism/SubstructureFilter.java 2006-10-27 10:20:30 UTC (rev 7200) @@ -45,74 +45,78 @@ public class SubstructureFilter implements LocalWorkerCDK { private String[] inputNames = new String[] { "inputStructures", "subStructure" }; private String[] outputNames = new String[] { "matchingStructures", "otherStructures", "matchingStructuresFileName", - "otherStructuresFileName" }; + "otherStructuresFileName" }; // Region: input and outpout definition - public String[] inputNames() { - return inputNames; - } - public String[] inputTypes() { - return new String[] {LocalWorkerCDK.CMLChemFileList, LocalWorkerCDK.CMLChemFile }; - } - - public String[] outputNames() { - return outputNames; - } - public String[] outputTypes() { - return new String[] {LocalWorkerCDK.CMLChemFileList, LocalWorkerCDK.CMLChemFileList, - LocalWorkerCDK.STRING_ARRAY, LocalWorkerCDK.STRING_ARRAY}; - } - // End of region - - // Region: local worker execution - public Map execute(Map inputs) throws TaskExecutionException { - List inputList = null; - CMLChemFile query = null; - List matchedList = new ArrayList(); - List unmatchedList= new ArrayList(); - List fileNameMachtedStructures = new ArrayList(); - List fileNameOtherStructures = new ArrayList(); - // Filename generation related - FileNameGenerator fileNameGenerator = new FileNameGenerator(); + public String[] inputNames() { + return inputNames; + } + public String[] inputTypes() { + return new String[] {LocalWorkerCDK.CMLChemFileList, LocalWorkerCDK.CMLChemFile }; + } + + public String[] outputNames() { + return outputNames; + } + public String[] outputTypes() { + return new String[] {LocalWorkerCDK.CMLChemFileList, LocalWorkerCDK.CMLChemFileList, + LocalWorkerCDK.STRING_ARRAY, LocalWorkerCDK.STRING_ARRAY}; + } + // End of region + + // Region: local worker execution + public Map execute(Map inputs) throws TaskExecutionException { + List inputList = null; + CMLChemFile query = null; + List matchedList = new ArrayList(); + List unmatchedList= new ArrayList(); + List fileNameMachtedStructures = new ArrayList(); + List fileNameOtherStructures = new ArrayList(); + // Filename generation related + FileNameGenerator fileNameGenerator = new FileNameGenerator(); String fileNameMatched = "SubstructureFilter" + File.separator + "MatchedSturctures" + File.separator + "matchedStructure"; String fileNameOthers = "SubstructureFilter" + File.separator + "OtherSturctures" - + File.separator + "otherStructure"; - - if (inputs.get(inputNames[0]) != null && inputs.get(inputNames[1]) != null) { - inputList = (List)((DataThing)(inputs.get(inputNames[0]))).getDataObject(); - query = (CMLChemFile)((DataThing)(inputs.get(inputNames[1]))).getDataObject(); - } else { - return null; - } - try { - for (Iterator iter = inputList.iterator(); iter.hasNext(); ) { - CMLChemFile file = (CMLChemFile)iter.next(); - IAtomContainer queryStructure = ChemFileManipulator.getAllInOneContainer(query); - - IAtomContainer[] molecules = ChemFileManipulator.getAllAtomContainers(file); - for (int i=0; i<molecules.length; i++) { - if (UniversalIsomorphismTester.isSubgraph(molecules[i], queryStructure)) { - file.setProperty(fileNameGenerator.FILENAME, fileNameGenerator.addFileNameToFileNameList(fileNameMatched, (List<String>)file.getProperty(FileNameGenerator.FILENAME))); - matchedList.add(file); - break; - } else { // not a substructure - file.setProperty(fileNameGenerator.FILENAME, fileNameGenerator.addFileNameToFileNameList(fileNameMatched, (List<String>)file.getProperty(FileNameGenerator.FILENAME))); - unmatchedList.add(file); - break; - } - } - } - fileNameMachtedStructures.add(fileNameMatched); - fileNameOtherStructures.add(fileNameOthers); - } catch (Exception exception) { - throw new TaskExecutionException(exception); - } - Map outputs = new HashMap(); - outputs.put(outputNames[0],new DataThing(matchedList)); - outputs.put(outputNames[1],new DataThing(unmatchedList)); - outputs.put(outputNames[2], new DataThing(fileNameMachtedStructures)); - outputs.put(outputNames[3], new DataThing(fileNameOtherStructures)); - return outputs; - } - // End of region + + File.separator + "otherStructure"; + if (inputs.get(inputNames[0]) != null && inputs.get(inputNames[1]) != null) { + inputList = (List)((DataThing)(inputs.get(inputNames[0]))).getDataObject(); + query = (CMLChemFile)((DataThing)(inputs.get(inputNames[1]))).getDataObject(); + } else { + return null; + } + try { + for (Iterator iter = inputList.iterator(); iter.hasNext(); ) { + CMLChemFile file = (CMLChemFile)iter.next(); + IAtomContainer queryStructure = ChemFileManipulator.getAllInOneContainer(query); + List moleculeList = ChemFileManipulator.getAllAtomContainers(file); + IAtomContainer[] molecules = new IAtomContainer[moleculeList.size()]; + int p = 0; + for (Iterator iterator = moleculeList.iterator(); iterator.hasNext();){ + molecules[p] = (IAtomContainer)iterator.next(); + p++; + } + for (int i=0; i<molecules.length; i++) { + if (UniversalIsomorphismTester.isSubgraph(molecules[i], queryStructure)) { + file.setProperty(fileNameGenerator.FILENAME, fileNameGenerator.addFileNameToFileNameList(fileNameMatched, (List<String>)file.getProperty(FileNameGenerator.FILENAME))); + matchedList.add(file); + break; + } else { // not a substructure + file.setProperty(fileNameGenerator.FILENAME, fileNameGe... [truncated message content] |