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


Java MolBond.getAtom2方法代码示例

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


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

示例1: isAmideBond

import chemaxon.struc.MolBond; //导入方法依赖的package包/类
private boolean isAmideBond(MolBond bond) {
    MolAtom atom1 = bond.getAtom1();
    MolAtom atom2 = bond.getAtom2();

    if (bond.getType() == 1) {
        boolean found = false;
        if (isCarbonylCarbonAtom(atom1) && isAminoNitrogenAtom(atom2)) {
            found = true;
        } else if  (isCarbonylCarbonAtom(atom2) && isAminoNitrogenAtom(atom1)) {
            found = true;
        }
        
        if (found && !isPreservedAmideBond(bond)) {
            return true;
        }
    }

    return false;
}
 
开发者ID:PistoiaHELM,项目名称:HELMNotationToolkit,代码行数:20,代码来源:PeptideStructureParser.java

示例2: removeRgroup

import chemaxon.struc.MolBond; //导入方法依赖的package包/类
/**
 * mol is changed after this step, make sure to clone it if need to preserve
 * state It is possible that there are more than one R groups that have the
 * same ID as rgroup
 * 
 * @param mol
 * @param rgroup
 * @return MolAtom which is the single connection MolAtom to rgroup
 * @throws org.helm.notation.StructureException
 */
public static MolAtom removeRgroup(Molecule mol, MolAtom rgroup)
		throws StructureException {
	MolAtom atom = null;

	if (rgroup.getBondCount() == 1) {
		MolBond bond = rgroup.getBond(0);
		if (bond.getAtom1().equals(rgroup)) {
			atom = bond.getAtom2();
		} else {
			atom = bond.getAtom1();
		}
		mol.removeNode(rgroup);
	} else {
		throw new StructureException("Only one bond is allowed from Rgroup");
	}

	return atom;
}
 
开发者ID:PistoiaHELM,项目名称:HELMNotationToolkit,代码行数:29,代码来源:StructureParser.java

示例3: initializeVisitFlags

import chemaxon.struc.MolBond; //导入方法依赖的package包/类
protected void initializeVisitFlags () {
for (int i = 0; i < atoms.length; ++i) {
    if ((types[i] & (TAU_ACC | TAU_DON)) != 0) {
	avisit[i] = 0;
    }
    else {
	avisit[i] = 1;
    }
}

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

    MolAtom src = bond.getAtom1();
    MolAtom dst = bond.getAtom2();
    if (((types[mol.indexOf(src)] & TAU_OTHER) == 0)
	&& ((types[mol.indexOf(dst)] & TAU_OTHER) == 0)) {
	bvisit[i] = 0;
    }
    else {
	bvisit[i] = 1;
    }
}
   }
 
开发者ID:ncats,项目名称:lychi,代码行数:25,代码来源:SayleDelanyTautomerGenerator.java

示例4: kekuleTautomer

import chemaxon.struc.MolBond; //导入方法依赖的package包/类
protected boolean kekuleTautomer (int depth) {
for (int i = 0; i < bonds.length; ++i) {
    if (bvisit[i] == 0) {
	MolBond bnd = bonds[i];
	MolAtom src = bnd.getAtom1();
	MolAtom dst = bnd.getAtom2();

	bvisit[i] = depth;
	setBondOrder (bnd, 2);

	if (propagateTautomer (src, depth+1) != 0 ||
	    propagateTautomer (dst, depth+1) != 0) {
	    setBondOrder (bnd, 1);
	    resetVisitFlags (depth + 1);
	    
	    if (propagateTautomer (src, depth + 1) != 0 ||
		propagateTautomer (dst, depth + 1) != 0)
		return false;
	}
	depth += 2;
    }
}
return true;
   }
 
开发者ID:ncats,项目名称:lychi,代码行数:25,代码来源:SayleDelanyTautomerGenerator.java

示例5: breakDisulfideBond

import chemaxon.struc.MolBond; //导入方法依赖的package包/类
private List<Molecule> breakDisulfideBond(Molecule mol, MolBond bond, int rGroupId) {
    List<Molecule> l = new ArrayList<Molecule>();

    MolAtom atom1 = bond.getAtom1();
    MolAtom atom2 = bond.getAtom2();

    MolAtom r1Atom = new MolAtom(MolAtom.RGROUP);
    r1Atom.setRgroup(rGroupId);
    r1Atom.setExtraLabel(SULFIDE_ATTACCHMENT_LABEL);
    MolAtom r2Atom = new MolAtom(MolAtom.RGROUP);
    r2Atom.setRgroup(rGroupId);
    r2Atom.setExtraLabel(SULFIDE_ATTACCHMENT_LABEL);

    MolBond bond1 = new MolBond(atom1, r1Atom);
    MolBond bond2 = new MolBond(atom2, r2Atom);

    mol.removeEdge(bond);
    mol.add(r1Atom);
    mol.add(bond1);
    mol.add(r2Atom);
    mol.add(bond2);

    Molecule[] fragments = mol.convertToFrags();

    if (fragments.length == 1) {
        l.add(fragments[0]);
    } else {
        l.add(fragments[0]);
        l.add(fragments[1]);
    }
    return l;
}
 
开发者ID:PistoiaHELM,项目名称:HELMNotationToolkit,代码行数:33,代码来源:PeptideStructureParser.java

示例6: isDisulfideBond

import chemaxon.struc.MolBond; //导入方法依赖的package包/类
private boolean isDisulfideBond(MolBond bond) {
    MolAtom atom1 = bond.getAtom1();
    MolAtom atom2 = bond.getAtom2();
    if (bond.getType() == 1) {
        if (isDisulfideSulfurAtom(atom1) && isDisulfideSulfurAtom(atom2)) {
            return true;
        }
    }
    return false;
}
 
开发者ID:PistoiaHELM,项目名称:HELMNotationToolkit,代码行数:11,代码来源:PeptideStructureParser.java

示例7: assignNOxideAtomTypes

import chemaxon.struc.MolBond; //导入方法依赖的package包/类
protected void assignNOxideAtomTypes () {
for (int i = 0; i < bonds.length; ++i) {
    MolBond bond = bonds[i];
    
    MolAtom src = bond.getAtom1();
    MolAtom dst = bond.getAtom2();

    int sidx = mol.indexOf(src);
    int didx = mol.indexOf(dst);
    
    int stype = types[sidx];
    int dtype = types[didx];
    
    if ((stype==TAU_NOXN) && (dtype==TAU_OSP2)) {
	setBondOrder (bond, 1);
	types[sidx] = TAU_HYB;
	src.setCharge(1);
	types[didx] = TAU_OTHER;
	dst.setCharge(-1);
    } 
    else if ((stype==TAU_OSP2) && (dtype==TAU_NOXN)) {
	setBondOrder (bond, 1);
	types[didx] = TAU_HYB;
	dst.setCharge(1);
	types[sidx] = TAU_OTHER;
	src.setCharge(-1);
    }
}
   }
 
开发者ID:ncats,项目名称:lychi,代码行数:30,代码来源:SayleDelanyTautomerGenerator.java

示例8: kekuleTautomerZone

import chemaxon.struc.MolBond; //导入方法依赖的package包/类
protected int kekuleTautomerZone (int depth, int zone) {
for (int i = 0; i < atoms.length; ++i) {
    if (avisit[i] == 0 && zones[i] == zone) {
	avisit[i] = depth;
	if ((types[i] & TAU_DON) != 0)
	    donateProton (i);
	if (propagateTautomer (atoms[i], depth+1) != 0)
	    return 0;
	depth += 2;
    }
}

for (int i = 0; i < bonds.length; ++i) {
    if (bvisit[i] == 0) {
	MolBond bnd = bonds[i];
	MolAtom src = bnd.getAtom1();
	MolAtom dst = bnd.getAtom2();
	
	if (zones[mol.indexOf(src)] == zone) {
	    bvisit[i] = depth;
	    setBondOrder (bnd, 2);
	    if (propagateTautomer (src, depth+1) != 0 ||
		propagateTautomer (dst, depth+1) != 0) {
		setBondOrder (bnd, 1);
		resetVisitFlags (depth+1);
		if (propagateTautomer (src, depth+1) != 0 ||
		    propagateTautomer (dst, depth+1) != 0)
		    return 0;
	    }
	    depth += 2;
	}
    }
}
return depth;
   }
 
开发者ID:ncats,项目名称:lychi,代码行数:36,代码来源:SayleDelanyTautomerGenerator.java

示例9: transform

import chemaxon.struc.MolBond; //导入方法依赖的package包/类
void transform (Molecule mol, int[] hit) {
    if (debug) {
        System.out.println("Hit: "+smirks);
        for(int j=0; j < hit.length; j++) {
            System.out.print(" " + (hit[j]+1)+":"
                             +source.getAtom(j).getAtomMap());
        }
        System.out.println();
    }

    if (target.getAtomCount() == 0) {
        // delete this subgraph
        for (int j = 0; j < hit.length; ++j) {
            mol.removeNode(hit[j]);
        }
    }
    else {
        MolAtom[] M = new MolAtom[mol.getAtomCount()];

        // update atom
        for (int j = 0; j < hit.length; ++j) {
            MolAtom src = target.getAtom(map[j]);
            MolAtom dst = mol.getAtom(hit[j]);
            //System.out.println("updating atom " + (hit[j]+1));
            copy (dst, src);
            M[hit[j]] = src;
        }
                
        // now update the bond
        for (MolBond b1 : mol.getBondArray()) {
            MolAtom a1 = b1.getAtom1();
            MolAtom a2 = b1.getAtom2();
            int i1 = mol.indexOf(a1);
            int i2 = mol.indexOf(a2);

            if (M[i1] != null && M[i2] != null) {
                for (int j = 0; j < M[i1].getBondCount(); ++j) {
                    MolBond b2 = M[i1].getBond(j);
                    if (b2.getOtherAtom(M[i1]) == M[i2]) {
                        int type = b2.getType();
                        switch (type) {
                        case MolBond.SINGLE_OR_AROMATIC:
                            b1.setType(1);
                            break;

                        case MolBond.DOUBLE_OR_AROMATIC:
                            b1.setType(2);
                            break;

                        case 1: case 2: case 3:
                            b1.setType(type);
                            break;
                        }

                        if (debug) {
                            System.out.println
                                ("updating bond " + (i1+1)
                                 + "-"+(i2+1) + " to " 
                                 + b1.getType());
                        }
                    }
                }
            }
        }

        M = null;
    }
}
 
开发者ID:ncats,项目名称:lychi,代码行数:69,代码来源:SMIRKS.java

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