当前位置: 首页>>代码示例>>Java>>正文


Java MolBond.getFlags方法代码示例

本文整理汇总了Java中chemaxon.struc.MolBond.getFlags方法的典型用法代码示例。如果您正苦于以下问题:Java MolBond.getFlags方法的具体用法?Java MolBond.getFlags怎么用?Java MolBond.getFlags使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在chemaxon.struc.MolBond的用法示例。


在下文中一共展示了MolBond.getFlags方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: resetEZ

import chemaxon.struc.MolBond; //导入方法依赖的package包/类
public static void resetEZ (Molecule mol) {
MolBond[] bonds = mol.getBondArray();
for (int i = 0; i < bonds.length; ++i) {
    MolBond b = bonds[i];
    int type = b.getType();
    if (type == 2) {
	b.setFlags(0, MolBond.CTUMASK);
    }
    else if (type == 1) {
	int flags = b.getFlags() & MolBond.STEREO1_MASK;
	if (flags  == (MolBond.UP | MolBond.DOWN)) {
	    // WAVY flag... 
	    b.setFlags(0, MolBond.STEREO1_MASK);
	}
    }
}
   }
 
开发者ID:ncats,项目名称:lychi,代码行数:18,代码来源:ChemUtil.java

示例2: isSingleStereo

import chemaxon.struc.MolBond; //导入方法依赖的package包/类
/**
 * Check if the bond that R atom is part of is single stereo bond or not
 *
 * @param rAtom the R atom to be checked
 * @return true or false
 * @throws StructureException
 */
protected static boolean isSingleStereo(MolAtom rAtom) throws StructureException {
    int bondCount = rAtom.getBondCount();
    if (bondCount != 1) {
        throw new StructureException("RGroup is allowed to have single connection to other atom");
    }

    MolBond bond = rAtom.getBond(0);
    int bondType = bond.getFlags() & MolBond.STEREO1_MASK;

    return bondType == MolBond.UP || bondType == MolBond.DOWN || bondType == MolBond.WAVY;
}
 
开发者ID:PistoiaHELM,项目名称:HELMNotationToolkit,代码行数:19,代码来源:StructureParser.java

示例3: adjustBondAnnotations

import chemaxon.struc.MolBond; //导入方法依赖的package包/类
protected void adjustBondAnnotations () {

	for (int i = 0; i < bonds.length; ++i) {
	    MolBond bnd = bonds[i];
	    int flags = bflags[i];

	    int type = bnd.getFlags() & MolBond.TYPE_MASK;
	    int order = flags & MolBond.TYPE_MASK;
	    int stereo = flags & MolBond.STEREO_MASK;
	    int topo = flags & MolBond.TOPOLOGY_MASK;
	    int chiral = flags & MolBond.REACTING_CENTER_MASK;
	    if (order == type) {
		// restore the flags if the bond type is the same
		bnd.setFlags(stereo, MolBond.STEREO_MASK);
		bnd.setFlags(topo, MolBond.TOPOLOGY_MASK);
		bnd.setFlags(chiral, MolBond.REACTING_CENTER_MASK);
	    }
	    else if (type == 1) {
		/* 
		 * here we reset all stereo flags of a mobile hydrogen
		 */
		if (order != type) {
		    // make sure previously generated tautomers turn off
		    //  the stereo flag for this bond
		    for (Molecule tau : tautomers) {
			tau.getBond(i).setFlags(0, MolBond.STEREO_MASK);
			tau.getBond(i).setFlags(0, MolBond.TOPOLOGY_MASK);
			tau.getBond(i).setFlags
			    (0, MolBond.REACTING_CENTER_MASK);
		    }
		    bflags[i] &= ~MolBond.STEREO_MASK;
		}
		bnd.setFlags(0, MolBond.STEREO_MASK);
		bnd.setFlags(0, MolBond.TOPOLOGY_MASK);
		bnd.setFlags(0, MolBond.REACTING_CENTER_MASK);
	    }

	    if (debug) {
		if (stereo != 0 && order != type) {
		    logger.info
			("** warning: "
			 +"stereo flag (" + stereo 
			 +") is ignored due to bond type changing from " 
			 + order + " to " + bnd.getType() 
			 + " at bond " +(i+1)+":"
			 + (mol.indexOf(bnd.getAtom1())+1) 
			 + "-" + (mol.indexOf(bnd.getAtom2())+1));
		}
		if (topo != 0) {
		    logger.info
			("** warning: "
			 +"topology flag (" + topo 
			 +") is ignored due to bond type changing from " 
			 + order + " to " + bnd.getType() 
			 + " at bond " + (i+1)+":"
			 + (mol.indexOf(bnd.getAtom1())+1) 
			 + "-" + (mol.indexOf(bnd.getAtom2())+1));
		}
		if (chiral != 0) {
		    logger.info
			("** warning: "
			 +"chiral flag (" + chiral
			 +") is ignored due to bond type changing from " 
			 + order + " to " + bnd.getType() 
			 + " at bond " + (i+1)+":"
			 + (mol.indexOf(bnd.getAtom1())+1) 
			 + "-" + (mol.indexOf(bnd.getAtom2())+1));
		}
	    }
	}
    }
 
开发者ID:ncats,项目名称:lychi,代码行数:72,代码来源:SayleDelanyTautomerGenerator.java

示例4: countBondParity

import chemaxon.struc.MolBond; //导入方法依赖的package包/类
static int countBondParity (MolAtom atom, int dir) {
    int count = 0;

    Molecule mol = (Molecule)atom.getParent();
    if (DEBUG) {
        logger.info("** Atom "+(mol.indexOf(atom)+1));
    }
    for (int n = 0; n < atom.getBondCount(); ++n) {
        MolBond nb = atom.getBond(n);
        int parity = nb.getFlags() & MolBond.STEREO1_MASK;
        if (parity == MolBond.UP) {
            if (DEBUG) {
                System.err.println(" UP: "+(mol.indexOf(nb.getAtom1())+1)
                                   +"-"+(mol.indexOf(nb.getAtom2())+1));
            }
            if (dir < 0) {
                if (nb.getAtom1() == atom) {
                    ++count;
                }
            }
            else if (dir > 0) {
                if (nb.getAtom2() == atom) {
                    ++count;
                }
            }
            else {
                ++count;
            }
        }
        else if (parity == MolBond.DOWN) {
            if (DEBUG) {
                System.err.println(" DOWN: "+(mol.indexOf(nb.getAtom1())+1)
                                   +"-"+(mol.indexOf(nb.getAtom2())+1));
            }
            if (dir < 0) {
                if (nb.getAtom1() == atom) {
                    ++count;
                }
            }
            else if (dir > 0) {
                if (nb.getAtom2() == atom) {
                    ++count;
                }
            }
            else {
                ++count;
            }
        }
    }
    return count;
}
 
开发者ID:ncats,项目名称:lychi,代码行数:52,代码来源:LyChIStandardizer.java


注:本文中的chemaxon.struc.MolBond.getFlags方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。