Package org.openscience.cdk.interfaces

Examples of org.openscience.cdk.interfaces.IAtomType


        for (IAtomContainer container :
            ChemModelManipulator.getAllAtomContainers(chemModel)) {
           for (IAtom atom : container.atoms()) {
               if (!(atom instanceof IPseudoAtom)) {
                   try {
                       IAtomType type = matcher.findMatchingAtomType(
                           container, atom
                       );
                       if (type != null &&
                           type.getFormalNeighbourCount() != null) {
                           int connectedAtomCount = container.getConnectedAtomsCount(atom);
                           atom.setImplicitHydrogenCount(
                               type.getFormalNeighbourCount() - connectedAtomCount
                           );
                       }
                   } catch ( CDKException e ) {
                       e.printStackTrace();
                   }
View Full Code Here


    public void assertAtomTypesPerceived(IAtomContainer container) throws Exception {
      CDKAtomTypeMatcher matcher = CDKAtomTypeMatcher.getInstance(container.getBuilder());
      Iterator<IAtom> atoms = container.atoms().iterator();
      while (atoms.hasNext()) {
        IAtom atom = atoms.next();
        IAtomType type = matcher.findMatchingAtomType(container, atom);
        Assert.assertNotNull(
          "Could not perceive atom type for: " + atom,
          type
        );
      }
View Full Code Here

     * @param container to which implicit hydrogens are added.
     */
    protected void addImplicitHydrogens(IAtomContainer container) throws Exception {
      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

    for (IAtomContainer container : ChemModelManipulator
        .getAllAtomContainers(chemModel)) {
      for (IAtom atom : container.atoms()) {
        if (!(atom instanceof IPseudoAtom)) {
          try {
            IAtomType type = matcher.findMatchingAtomType(container, atom);
            if (type != null
                                && !type.getAtomTypeName().equals("X")
                && type.getFormalNeighbourCount() != null) {

                            int connectedAtomCount = container
                                    .getConnectedAtomsCount(atom);
                            atomHydrogenCountsMap.put(atom, new Integer[]{
                                    type.getFormalNeighbourCount()
                                            - connectedAtomCount,
                                    atom.getImplicitHydrogenCount()});
                            atom.setImplicitHydrogenCount(type.getFormalNeighbourCount()
                                                                  - connectedAtomCount);
                           
            } else {
                            atom.setImplicitHydrogenCount(0);
                        }
View Full Code Here

   */
  private void updateAtom(IAtomContainer container, IAtom atom) {
    if (this.getController2DModel().getAutoUpdateImplicitHydrogens()) {
      atom.setImplicitHydrogenCount(0);
      try {
        IAtomType type = matcher.findMatchingAtomType(container, atom);
        if (type != null && !type.getAtomTypeName().equals("X")) {
          Integer neighbourCount = type.getFormalNeighbourCount();
          if (neighbourCount != null) {
            atom.setImplicitHydrogenCount(neighbourCount
                - container.getConnectedAtomsCount(atom));
          }
          // for some reason, the neighbour count takes into account
View Full Code Here

TOP

Related Classes of org.openscience.cdk.interfaces.IAtomType

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.