亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? saturationchecker.java

?? 化學圖形處理軟件
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
/*  $RCSfile$ *  $Author: egonw $ *  $Date: 2007-03-14 18:33:52 +0100 (Wed, 14 Mar 2007) $ *  $Revision: 8121 $ * *  Copyright (C) 2001-2007  The Chemistry Development Kit (CDK) project * *  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. *  All we ask is that proper credit is given for our work, which includes *  - but is not limited to - adding the above copyright notice to the beginning *  of your source code files, and to any copyright notice that you may distribute *  with programs based on this work. * *  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.tools;import java.io.IOException;import java.util.Iterator;import java.util.List;import org.openscience.cdk.CDKConstants;import org.openscience.cdk.config.AtomTypeFactory;import org.openscience.cdk.exception.CDKException;import org.openscience.cdk.interfaces.IAtom;import org.openscience.cdk.interfaces.IAtomContainer;import org.openscience.cdk.interfaces.IAtomType;import org.openscience.cdk.interfaces.IBond;import org.openscience.cdk.interfaces.IChemObjectBuilder;import org.openscience.cdk.interfaces.IPseudoAtom;import org.openscience.cdk.interfaces.IRingSet;import org.openscience.cdk.ringsearch.RingPartitioner;import org.openscience.cdk.ringsearch.SSSRFinder;import org.openscience.cdk.tools.manipulator.BondManipulator;import org.openscience.cdk.tools.manipulator.RingSetManipulator;/** * Provides methods for checking whether an atoms valences are saturated with * respect to a particular atom type. * * <p>Important: this class does not deal with hybridization states, which makes * it fail, for example, for situations where bonds are marked as aromatic (either * 1.5 or single an AROMATIC). * * @author     steinbeck * @author  Egon Willighagen * @cdk.created    2001-09-04 * * @cdk.keyword    saturation * @cdk.keyword    atom, valency *  * @cdk.module     valencycheck */public class SaturationChecker implements IValencyChecker, IDeduceBondOrderTool {	AtomTypeFactory structgenATF;	private LoggingTool logger;	public SaturationChecker() throws IOException, ClassNotFoundException	{		logger = new LoggingTool(this);	}    /**     * @param builder the ChemObjectBuilder implementation used to construct the AtomType's.     */    protected AtomTypeFactory getAtomTypeFactory(IChemObjectBuilder builder) throws CDKException {        if (structgenATF == null) {            try {                structgenATF = AtomTypeFactory.getInstance(                    "org/openscience/cdk/config/data/structgen_atomtypes.xml",                     builder                );            } catch (Exception exception) {                logger.debug(exception);                throw new CDKException("Could not instantiate AtomTypeFactory!", exception);            }        }        return structgenATF;    }	public boolean hasPerfectConfiguration(IAtom atom, IAtomContainer ac) throws CDKException	{		double bondOrderSum = ac.getBondOrderSum(atom);		double maxBondOrder = ac.getMaximumBondOrder(atom);		IAtomType[] atomTypes = getAtomTypeFactory(atom.getBuilder()).getAtomTypes(atom.getSymbol());    if(atomTypes.length==0)      return true;		logger.debug("*** Checking for perfect configuration ***");		try		{			logger.debug("Checking configuration of atom " + ac.getAtomNumber(atom));			logger.debug("Atom has bondOrderSum = " + bondOrderSum);			logger.debug("Atom has max = " + bondOrderSum);		} catch (Exception exc)		{		}		for (int f = 0; f < atomTypes.length; f++)		{			if (bondOrderSum == atomTypes[f].getBondOrderSum() &&                 maxBondOrder == atomTypes[f].getMaxBondOrder())			{				try				{					logger.debug("Atom " + ac.getAtomNumber(atom) + " has perfect configuration");				} catch (Exception exc)				{				}				return true;			}		}		try		{			logger.debug("*** Atom " + ac.getAtomNumber(atom) + " has imperfect configuration ***");		} catch (Exception exc)		{		}		return false;	}    /**     * Determines of all atoms on the AtomContainer are saturated.     */	public boolean isSaturated(IAtomContainer container) throws CDKException {        return allSaturated(container);    }	public boolean allSaturated(IAtomContainer ac) throws CDKException	{        logger.debug("Are all atoms saturated?");        for (int f = 0; f < ac.getAtomCount(); f++) {            if (!isSaturated(ac.getAtom(f), ac)) {                return false;            }        }        return true;    }    /**     * Returns wether a bond is unsaturated. A bond is unsaturated if      * <b>both</b> Atoms in the bond are unsaturated.     */    public boolean isUnsaturated(IBond bond, IAtomContainer atomContainer) throws CDKException {    	IAtom[] atoms = BondManipulator.getAtomArray(bond);        boolean isUnsaturated = true;        for (int i=0; i<atoms.length; i++) {            isUnsaturated = isUnsaturated && !isSaturated(atoms[i], atomContainer);        }        return isUnsaturated;    }        /**     * Returns wether a bond is saturated. A bond is saturated if      * <b>both</b> Atoms in the bond are saturated.     */    public boolean isSaturated(IBond bond, IAtomContainer atomContainer) throws CDKException {    	IAtom[] atoms = BondManipulator.getAtomArray(bond);        boolean isSaturated = true;        for (int i=0; i<atoms.length; i++) {            isSaturated = isSaturated && isSaturated(atoms[i], atomContainer);        }        return isSaturated;    }        /**     * Checks wether an Atom is saturated by comparing it with known AtomTypes.     */	public boolean isSaturated(IAtom atom, IAtomContainer ac) throws CDKException {		IAtomType[] atomTypes = getAtomTypeFactory(atom.getBuilder()).getAtomTypes(atom.getSymbol());        if(atomTypes.length==0)          return true;        double bondOrderSum = ac.getBondOrderSum(atom);        double maxBondOrder = ac.getMaximumBondOrder(atom);        int hcount = atom.getHydrogenCount();        int charge = atom.getFormalCharge();        try {            logger.debug("*** Checking saturation of atom ", atom.getSymbol(), "" + ac.getAtomNumber(atom) + " ***");            logger.debug("bondOrderSum: " + bondOrderSum);            logger.debug("maxBondOrder: " + maxBondOrder);            logger.debug("hcount: " + hcount);        } catch (Exception exc) {            logger.debug(exc);        }        for (int f = 0; f < atomTypes.length; f++) {            if (bondOrderSum - charge + hcount == atomTypes[f].getBondOrderSum() &&                 maxBondOrder <= atomTypes[f].getMaxBondOrder()) {                    logger.debug("*** Good ! ***");                    return true;                }        }        logger.debug("*** Bad ! ***");        return false;    }	/**	 * Checks if the current atom has exceeded its bond order sum value.	 *	 * @param  atom The Atom to check	 * @param  ac   The atomcontainer context	 * @return      oversaturated or not	 */	public boolean isOverSaturated(IAtom atom, IAtomContainer ac) throws CDKException	{		IAtomType[] atomTypes = getAtomTypeFactory(atom.getBuilder()).getAtomTypes(atom.getSymbol());    if(atomTypes.length==0)      return false;		double bondOrderSum = ac.getBondOrderSum(atom);		double maxBondOrder = ac.getMaximumBondOrder(atom);		int hcount = atom.getHydrogenCount();		int charge = atom.getFormalCharge();		try		{			logger.debug("*** Checking saturation of atom " + ac.getAtomNumber(atom) + " ***");			logger.debug("bondOrderSum: " + bondOrderSum);			logger.debug("maxBondOrder: " + maxBondOrder);			logger.debug("hcount: " + hcount);		} catch (Exception exc)		{		}		for (int f = 0; f < atomTypes.length; f++)		{			if (bondOrderSum - charge + hcount > atomTypes[f].getBondOrderSum())			{				logger.debug("*** Good ! ***");				return true;			}		}		logger.debug("*** Bad ! ***");		return false;	}    	/**	 * Returns the currently maximum formable bond order for this atom.	 *	 * @param  atom  The atom to be checked	 * @param  ac    The AtomContainer that provides the context	 * @return       the currently maximum formable bond order for this atom	 */	public double getCurrentMaxBondOrder(IAtom atom, IAtomContainer ac) throws CDKException	{		IAtomType[] atomTypes = getAtomTypeFactory(atom.getBuilder()).getAtomTypes(atom.getSymbol());    if(atomTypes.length==0)      return 0;		double bondOrderSum = ac.getBondOrderSum(atom);		int hcount = atom.getHydrogenCount();		double max = 0;		double current = 0;		for (int f = 0; f < atomTypes.length; f++)		{			current = hcount + bondOrderSum;			if (atomTypes[f].getBondOrderSum() - current > max)			{				max = atomTypes[f].getBondOrderSum() - current;			}		}		return max;	}    /**     * Resets the bond orders of all atoms to 1.0.     */    public void unsaturate(IAtomContainer atomContainer) {    	Iterator bonds = atomContainer.bonds();    	while (bonds.hasNext()) {    		((IBond)bonds.next()).setOrder(CDKConstants.BONDORDER_SINGLE);    	}    }        /**     * Resets the bond order of the Bond to 1.0.     */    public void unsaturateBonds(IAtomContainer container) {    	Iterator bonds = container.bonds();        while (bonds.hasNext()) ((IBond)bonds.next()).setOrder(1.0);    }	/**	 * Saturates a molecule by setting appropriate bond orders.	 * This method is known to fail, especially on pyrolle-like compounts.	 * Consider using import org.openscience.cdk.smiles.DeduceBondSystemTool, which should work better	 *	 * @cdk.keyword bond order, calculation     * @cdk.created 2003-10-03	 */    public void newSaturate(IAtomContainer atomContainer) throws CDKException {        logger.info("Saturating atomContainer by adjusting bond orders...");        boolean allSaturated = allSaturated(atomContainer);        if (!allSaturated) {        	IBond[] bonds = new IBond[atomContainer.getBondCount()];        	for (int i=0; i<bonds.length; i++) bonds[i] = atomContainer.getBond(i);            boolean succeeded = newSaturate(bonds, atomContainer);            for(int i=0;i<bonds.length;i++){              if(bonds[i].getOrder()==2 && bonds[i].getFlag(CDKConstants.ISAROMATIC) && (bonds[i].getAtom(0).getSymbol().equals("N") && bonds[i].getAtom(1).getSymbol().equals("N"))){                int atomtohandle=0;                if(bonds[i].getAtom(0).getSymbol().equals("N"))                  atomtohandle=1;                java.util.List bondstohandle=atomContainer.getConnectedBondsList(bonds[i].getAtom(atomtohandle));                for(int k=0;k<bondstohandle.size();k++){                	IBond bond = (IBond)bondstohandle.get(k);                  if(bond.getOrder()==1 && bond.getFlag(CDKConstants.ISAROMATIC)){                    bond.setOrder(2);                    bonds[i].setOrder(1);                    break;                  }                }              }            }            if (!succeeded) {                throw new CDKException("Could not saturate this atomContainer!");            }        }    }    /**     * Saturates a set of Bonds in an AtomContainer.	 * This method is known to fail, especially on pyrolle-like compounts.	 * Consider using import org.openscience.cdk.smiles.DeduceBondSystemTool, which should work better     */    public boolean newSaturate(IBond[] bonds, IAtomContainer atomContainer) throws CDKException {        logger.debug("Saturating bond set of size: " + bonds.length);        boolean bondsAreFullySaturated = true;        if (bonds.length > 0) {        	IBond bond = bonds[0];            // determine bonds left            int leftBondCount = bonds.length-1;            IBond[] leftBonds = new IBond[leftBondCount];            System.arraycopy(bonds, 1, leftBonds, 0, leftBondCount);            // examine this bond            if (isUnsaturated(bond, atomContainer)) {                // either this bonds should be saturated or not                

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
99久久综合色| 91精品久久久久久久91蜜桃| 精品日本一线二线三线不卡| 亚洲大片免费看| 亚洲日本在线天堂| 亚洲韩国精品一区| 欧美一区三区二区| 国产激情91久久精品导航| 久久亚洲精华国产精华液| 国产成人在线视频播放| 亚洲欧美色图小说| 日韩精品一区在线| 成人午夜在线播放| 蜜臀久久久久久久| 国产精品福利影院| 日韩美一区二区三区| 色综合天天天天做夜夜夜夜做| 亚洲丝袜制服诱惑| 久久久久久亚洲综合| 欧美四级电影在线观看| 国产乱淫av一区二区三区| 亚洲日本一区二区| 亚洲国产精品国自产拍av| 欧美日韩亚洲综合在线 欧美亚洲特黄一级 | 亚洲日本在线视频观看| 2023国产精品自拍| 日韩精品一区二区三区视频 | 国产精品麻豆久久久| 91麻豆精品国产91久久久久| 一本久久a久久精品亚洲| 久久精品99国产精品日本| 亚洲国产乱码最新视频 | 国产精品69久久久久水密桃| 日韩经典中文字幕一区| 亚洲香肠在线观看| 亚洲国产wwwccc36天堂| 亚洲乱码国产乱码精品精98午夜| 2欧美一区二区三区在线观看视频 337p粉嫩大胆噜噜噜噜噜91av | 欧美国产日韩a欧美在线观看| 日韩免费观看2025年上映的电影| 日韩一区二区三区在线| 日韩一级成人av| 国产色一区二区| 日韩一区中文字幕| 亚洲一区二区三区美女| 丝袜美腿亚洲一区| 国产精品白丝jk黑袜喷水| 国产激情视频一区二区在线观看| 成人免费av资源| 欧美偷拍一区二区| 久久婷婷色综合| 亚洲丝袜精品丝袜在线| 婷婷丁香久久五月婷婷| 久久国产精品露脸对白| 久久久久久免费| 亚洲国产激情av| 肉丝袜脚交视频一区二区| 久久精品久久久精品美女| 国产精品亚洲一区二区三区在线| 成人久久18免费网站麻豆| 精品视频免费看| 国产三级精品视频| 亚洲不卡在线观看| 色综合久久天天| 久久精品日韩一区二区三区| 亚洲成人三级小说| 一本久道中文字幕精品亚洲嫩| 久久亚洲影视婷婷| 奇米四色…亚洲| 91精品国产91久久综合桃花| 亚洲婷婷综合色高清在线| 激情伊人五月天久久综合| 91精品在线观看入口| 一区二区欧美精品| 欧美亚洲动漫制服丝袜| ●精品国产综合乱码久久久久| 国产在线一区二区综合免费视频| 欧美日韩激情一区| 视频一区二区中文字幕| 欧美日韩三级在线| 欧美aaa在线| 久久久久久久久伊人| 激情五月婷婷综合| 综合久久国产九一剧情麻豆| 成人午夜精品在线| 亚洲精品午夜久久久| 欧美在线制服丝袜| 蜜臀久久久久久久| 国产欧美日韩在线观看| 99天天综合性| 天堂在线亚洲视频| 亚洲国产激情av| 欧美年轻男男videosbes| 亚欧色一区w666天堂| 精品对白一区国产伦| 成人av在线一区二区| 日日夜夜免费精品| 国产视频一区二区在线| 欧美三级资源在线| 成人一级片在线观看| 日韩二区在线观看| 中文字幕在线不卡一区| 日韩欧美激情四射| 欧美亚洲国产一区二区三区va | 久久久久久久久一| 欧美伊人久久久久久久久影院| 国产精品伊人色| 免费成人在线观看视频| 亚洲一区二区三区在线| 国产香蕉久久精品综合网| 91精品国产91综合久久蜜臀| 91精彩视频在线观看| 不卡的av在线播放| 成人国产电影网| 国产成人综合亚洲91猫咪| 激情伊人五月天久久综合| 免费高清在线一区| 蜜臀久久99精品久久久画质超高清 | 玉足女爽爽91| 久久久久久电影| 久久久不卡网国产精品一区| 欧美日韩精品一区二区| 欧美欧美欧美欧美首页| 欧美精品在线观看播放| 欧美精品乱码久久久久久| 欧美亚洲一区二区在线观看| 色伊人久久综合中文字幕| 色呦呦日韩精品| 91精品在线麻豆| 国产欧美一区二区精品忘忧草| 久久精品亚洲乱码伦伦中文| 国产女主播在线一区二区| 综合在线观看色| 久久99国产精品久久99| 国产精品资源在线观看| 91小视频免费观看| 日韩视频在线一区二区| 欧美激情在线观看视频免费| 成人欧美一区二区三区在线播放| 亚洲国产成人av好男人在线观看| 男女激情视频一区| 99久精品国产| 国产欧美日韩另类一区| 午夜激情一区二区三区| 成人h版在线观看| 欧美二区三区的天堂| 欧美国产视频在线| 老司机精品视频导航| 日本高清不卡在线观看| 欧美国产精品久久| 国内精品在线播放| 日韩欧美一级二级三级久久久| 一区二区三区免费观看| 国产一区二区三区在线看麻豆| 欧美日韩精品欧美日韩精品| 亚洲视频一区二区在线| 久久99久久99| 91精品国产品国语在线不卡| 一区二区三区日韩| 色狠狠桃花综合| 亚洲午夜久久久| 欧美性欧美巨大黑白大战| 亚洲女同ⅹxx女同tv| 91在线免费播放| 亚洲18女电影在线观看| 777久久久精品| 琪琪久久久久日韩精品| 制服丝袜日韩国产| 狠狠色丁香久久婷婷综合丁香| 精品日本一线二线三线不卡| 麻豆精品视频在线| 国产精品三级av| 日本韩国一区二区三区视频| 亚洲成av人片在www色猫咪| 欧美理论片在线| 国产成人免费视频一区| 一区二区视频在线| 欧美xxx久久| 色综合久久中文字幕综合网 | 欧美大片在线观看| 国产91丝袜在线播放0| 亚洲精品乱码久久久久久久久 | 精品国产伦一区二区三区观看体验| 麻豆91在线看| 亚洲自拍偷拍图区| 久久久久久久久久久电影| 日本乱人伦一区| 国产不卡免费视频| 免费精品视频在线| 一区二区成人在线| 欧美国产一区二区在线观看| 欧美三级韩国三级日本一级| 亚洲综合色婷婷| 制服丝袜av成人在线看| 丁香激情综合五月| 国产专区欧美精品| 久久国产精品免费| 看片的网站亚洲| 久久精品国产精品亚洲精品| 亚洲精品第1页|