Skip to content

Commit

Permalink
Updated for ChemoJava 1.4.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
egonw committed Sep 17, 2011
1 parent a7447e4 commit 46c9894
Show file tree
Hide file tree
Showing 59 changed files with 7,493 additions and 51 deletions.
5 changes: 3 additions & 2 deletions plugins/net.bioclipse.medea/META-INF/MANIFEST.MF
Expand Up @@ -29,14 +29,15 @@ Require-Bundle: org.eclipse.ui,
org.openscience.cdk.isomorphism,
org.eclipse.core.resources,
net.sourceforge.weka,
org.openscience.cdk.qsarweka,
net.bioclipse.core,
slf4j.api,
net.bioclipse.cdk.business,
net.bioclipse.reaction,
org.springframework.bundle.spring.aop,
org.springframework.osgi.aopalliance.osgi,
net.sf.cglib
net.sf.cglib,
org.openscience.chemojava.qsar,
org.openscience.chemojava.qsarweka
Bundle-ActivationPolicy: lazy
Export-Package: net.bioclipse.medea,
net.bioclipse.medea.business,
Expand Down
Expand Up @@ -7,7 +7,6 @@
import net.bioclipse.medea.core.learning.ExtractorProbability;

import org.openscience.cdk.CDKConstants;
import org.openscience.cdk.DefaultChemObjectBuilder;
import org.openscience.cdk.exception.CDKException;
import org.openscience.cdk.interfaces.IAtom;
import org.openscience.cdk.interfaces.IMapping;
Expand Down Expand Up @@ -121,7 +120,8 @@ public Fragmenter(int process, IMolecule molecule, ArrayList<Double> peaksX) thr
molecule_ = (IMolecule) molecule.clone();
molecule_.getAtom(i).setFlag(CDKConstants.REACTIVE_CENTER,true);

IMoleculeSet setOfReactants = DefaultChemObjectBuilder.getInstance().newMoleculeSet();
IMoleculeSet setOfReactants = molecule.getBuilder()
.newInstance(IMoleculeSet.class);
setOfReactants.addMolecule(molecule_);
IReactionProcess type = new ElectronImpactNBEReaction();
List<IParameterReact> paramList = new ArrayList<IParameterReact>();
Expand Down Expand Up @@ -205,7 +205,8 @@ public Fragmenter(int process, IMolecule molecule, ArrayList<Double> peaksX) thr

try {

IMoleculeSet setOfReactants = molecule.getBuilder().newMoleculeSet();
IMoleculeSet setOfReactants = molecule.getBuilder()
.newInstance(IMoleculeSet.class);
cleanFlagReactiveCenter((IMolecule)fragmentToStudy);
setOfReactants.addMolecule((IMolecule)fragmentToStudy);
setOfReactions = type.initiate(setOfReactants, null);
Expand Down
@@ -1,8 +1,6 @@
package net.bioclipse.medea.core.prediction;

import java.io.BufferedInputStream;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
Expand Down
@@ -1,14 +1,12 @@
package net.bioclipse.medea.core.reaction;

import java.util.ArrayList;
import java.util.List;

import net.bioclipse.medea.core.FragmentMolecule;
import net.bioclipse.medea.core.FragmentTree;
import net.bioclipse.medea.core.Position;

import org.openscience.cdk.DefaultChemObjectBuilder;
import org.openscience.cdk.interfaces.IMapping;
import org.openscience.cdk.interfaces.IMolecularFormula;
import org.openscience.cdk.interfaces.IMolecule;
import org.openscience.cdk.interfaces.IReactionSet;
Expand All @@ -33,7 +31,8 @@ public ExtractorSetReactions(FragmentTree fragmentTree){
* @return A set of reactions
*/
public IReactionSet extract() {
IReactionSet setOfReactions = DefaultChemObjectBuilder.getInstance().newReactionSet();
IReactionSet setOfReactions = DefaultChemObjectBuilder.getInstance()
.newInstance(IReactionSet.class);

IMolecule molecule = fragmentTree.getMolecule();
IMolecularFormula formula = MolecularFormulaManipulator.getMolecularFormula(molecule);
Expand Down
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>org.openscience.cdk.qsarweka</name>
<name>org.openscience.chemojava.qsar</name>
<comment></comment>
<projects>
</projects>
Expand Down
27 changes: 27 additions & 0 deletions plugins/org.openscience.chemojava.qsar/META-INF/MANIFEST.MF
@@ -0,0 +1,27 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: CDK plugin
Bundle-SymbolicName: org.openscience.chemojava.qsar;singleton:=true
Bundle-Version: 1.4.2.1
Bundle-Vendor: The Chemistry Development Kit Project
Bundle-ActivationPolicy: lazy
Bundle-Activator: org.openscience.chemojava.qsar.Activator
Bundle-ClassPath: .
Require-Bundle: org.openscience.cdk.annotation,
org.openscience.cdk.interfaces,
org.openscience.cdk.core,
org.openscience.cdk.standard,
org.openscience.cdk.valencycheck,
org.openscience.cdk.reaction,
org.jama,
org.3pq.jgrapht,
javax.vecmath,
org.rosuda.jri,
org.omegahat.sjava,
org.eclipse.core.runtime
Import-Package: nu.xom
Export-Package: org.openscience.cdk.qsar.model.R2,
org.openscience.cdk.qsar.model.R,
org.openscience.cdk.qsar.model,
org.openscience.cdk.qsar.model.data,
org.openscience.chemojava.qsar
@@ -0,0 +1,51 @@
/*
* Copyright (C) 2004-2007 Rajarshi Guha <rajarshi@users.sourceforge.net>
*
* Contact: cdk-devel@lists.sourceforge.net
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2.1
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*/

package org.openscience.cdk.qsar.model;

/**
* Classes that implement this interface will build statistical models.
*
* Currently the design of the modeling system is that classes based on
* a given backend should be based of an abtract class that implements
* this interface. See <code>RModel</code> as an example.
*
* @author Rajarshi Guha
* @cdk.module qsar
* @cdk.githash
*/
public interface IModel {

/**
* Builds (trains) the model.
*
* @throws QSARModelException if errors occur in data types, calls to the R session. See
* the corresponding method in subclasses of this class for further details.
*/
public void build() throws QSARModelException;
/**
* Makes predictions using a previously built model.
*
* @throws QSARModelException if errors occur in data types, calls to the R session. See
* the corresponding method in subclasses of this class for further details.
*/
public void predict() throws QSARModelException;
}

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

package org.openscience.cdk.qsar.model;

import org.openscience.cdk.exception.CDKException;

/**
* Exception that is thrown by model routines when a problem has occured.
*
* @author Rajarshi Guha
* @cdk.module qsar
* @cdk.githash
*/
public class QSARModelException extends CDKException {

private static final long serialVersionUID = 4931287199065879144L;

/**
* Constructs a new QSARModelException with the given message.
*
* @param message for the constructed exception
*/
public QSARModelException(String message) {
super( message );
}
}

0 comments on commit 46c9894

Please sign in to comment.