Exemplo n.º 1
0
        /// <summary> Method that saturates an atom in a molecule by adding explicit hydrogens.
        /// In order to get coordinates for these Hydrogens, you need to
        /// remember the average bondlength of you molecule (coordinates for
        /// all atoms should be available) by using
        /// double bondLength = GeometryTools.getBondLengthAverage(atomContainer);
        /// and then use this method here and then use
        /// org.openscience.cdk.HydrogenPlacer(atomContainer, bondLength);
        ///
        /// </summary>
        /// <param name="atom">     Atom to saturate
        /// </param>
        /// <param name="container">AtomContainer containing the atom
        /// </param>
        /// <param name="totalContainer">In case you have a container containing multiple structures, this is the total container, whereas container is a partial structure
        ///
        /// </param>
        /// <cdk.keyword>           hydrogen, adding </cdk.keyword>
        /// <cdk.keyword>           explicit hydrogen </cdk.keyword>
        public virtual IAtomContainer addExplicitHydrogensToSatisfyValency(IAtomContainer container, IAtom atom, IAtomContainer totalContainer)
        {
            // set number of implicit hydrogens to zero
            // add explicit hydrogens
            //logger.debug("Start of addExplicitHydrogensToSatisfyValency(AtomContainer container, Atom atom)");
            int missingHydrogens = valencyChecker.calculateNumberOfImplicitHydrogens(atom, container);
            //logger.debug("According to valencyChecker, " + missingHydrogens + " are missing");
            IAtomContainer changedAtomsAndBonds = addExplicitHydrogensToSatisfyValency(container, atom, missingHydrogens, totalContainer);

            //logger.debug("End of addExplicitHydrogensToSatisfyValency(AtomContainer container, Atom atom)");
            return(changedAtomsAndBonds);
        }