Package org.openscience.cdk.tools

Examples of org.openscience.cdk.tools.CDKHydrogenAdder


      CDKAtomTypeMatcher matcher = CDKAtomTypeMatcher.getInstance(container.getBuilder());     
      for (IAtom atom : container.atoms()) {
        IAtomType type = matcher.findMatchingAtomType(container, atom);
        AtomTypeManipulator.configure(atom, type);
      }
        CDKHydrogenAdder hAdder = CDKHydrogenAdder.getInstance(container.getBuilder());
      hAdder.addImplicitHydrogens(container);
    }
View Full Code Here


        /*
         * Add implicit hydrogens (in ControllerParameters,
         * autoUpdateImplicitHydrogens is true by default, so we need to do that
         * anyway)
         */
        CDKHydrogenAdder hAdder = CDKHydrogenAdder.getInstance(chemModel
                .getBuilder());
        for (IAtomContainer molecule : ChemModelManipulator
                .getAllAtomContainers(chemModel)) {
            if (molecule != null) {
                try {
                    hAdder.addImplicitHydrogens(molecule);
                } catch (CDKException e) {
                    // do nothing
                }
            }
        }
View Full Code Here

      //add implicit hs
        if(jcpPanel.get2DHub().getController2DModel().getAutoUpdateImplicitHydrogens()){
            try {
                AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(toPaste);
                CDKHydrogenAdder hAdder = CDKHydrogenAdder.getInstance(toPaste
                        .getBuilder());
                hAdder.addImplicitHydrogens(toPaste);
            } catch (CDKException ex) {
                ex.printStackTrace();
                // do nothing
            }
            //valencies are set when doing atom typing, which we don't want in jcp
View Full Code Here

        MDLV2000Reader reader = new MDLV2000Reader(ins);
        IChemModel basic;
        try {
            basic = (IChemModel) reader.read(DefaultChemObjectBuilder.getInstance().newInstance(IChemModel.class));
            AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(basic.getMoleculeSet().getAtomContainer(0));
            CDKHydrogenAdder hAdder = CDKHydrogenAdder.getInstance(basic.getMoleculeSet().getAtomContainer(0)
                    .getBuilder());
            hAdder.addImplicitHydrogens(basic.getMoleculeSet().getAtomContainer(0));
            //valencies are set when doing atom typing, which we don't want in jcp
            for(int i=0;i<basic.getMoleculeSet().getAtomContainer(0).getAtomCount();i++){
                basic.getMoleculeSet().getAtomContainer(0).getAtom(i).setValency(null);
            }
            panel.setChemModel(basic);
View Full Code Here

        File theCdkErrors = new File(theErrorFilePath);
        BufferedWriter theFileWriter = new BufferedWriter(new FileWriter(theCdkErrors));
        for (IAtomContainer theMolecule : molSet.molecules()) {
            try{
            AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(theMolecule);           
            CDKHydrogenAdder adder = CDKHydrogenAdder.getInstance(theMolecule.getBuilder());
            adder.addImplicitHydrogens(theMolecule);
            } catch (CDKException e){
                theFileWriter.write(e.getMessage());
                molSet.removeAtomContainer(theMolecule);
                e.printStackTrace();               
            }
View Full Code Here

        File theCdkErrors = new File("cdkErrors.txt");
        BufferedWriter theFileWriter = new BufferedWriter(new FileWriter(theCdkErrors));
        for (IAtomContainer theMolecule : molSet.molecules()) {
            try{
            AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(theMolecule);           
            CDKHydrogenAdder adder = CDKHydrogenAdder.getInstance(theMolecule.getBuilder());
            adder.addImplicitHydrogens(theMolecule);
            } catch (CDKException e){
                theFileWriter.write(e.getMessage());
                molSet.removeAtomContainer(theMolecule);
                e.printStackTrace();               
            }
View Full Code Here

    private void __addHydrogens() {
        for (IAtomContainer theMolecule : this.setMoleculeSet().molecules()) {
            try {
                AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(theMolecule);
                CDKHydrogenAdder adder = CDKHydrogenAdder.getInstance(theMolecule.getBuilder());
                adder.addImplicitHydrogens(theMolecule);
            } catch (CDKException e) {
                e.printStackTrace();
                this.setMoleculeSet().removeAtomContainer(theMolecule);
                this.__addFailedMoleculeSet((Molecule) theMolecule);
            }
View Full Code Here

TOP

Related Classes of org.openscience.cdk.tools.CDKHydrogenAdder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.