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


Java CDKException.printStackTrace方法代码示例

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


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

示例1: calculate

import org.openscience.cdk.exception.CDKException; //导入方法依赖的package包/类
public void calculate() {
	this.value = 0.0;
	SMARTSQueryTool[] smartsQuerytools = (SMARTSQueryTool[])this.settings.get(VariableNames.SMARTS_SUBSTRUCTURE_INCLUSION_SCORE_LIST_NAME);
	if(smartsQuerytools == null) return;

		for(int i = 0; i < smartsQuerytools.length; i++) {
		try {
			if(smartsQuerytools[i].matches(candidate.getPrecursorMolecule().getStructureAsIAtomContainer())) {
				this.value++;
			}
		} catch (CDKException e) {
			e.printStackTrace();
		}
	}
		this.calculationFinished = true;
}
 
开发者ID:c-ruttkies,项目名称:MetFragRelaunched,代码行数:17,代码来源:SmartsSubstructureInclusionScore.java

示例2: calculate

import org.openscience.cdk.exception.CDKException; //导入方法依赖的package包/类
public void calculate() {
	this.value = 0.0;
	SMARTSQueryTool[] smartsQuerytools = (SMARTSQueryTool[])this.settings.get(VariableNames.SMARTS_SUBSTRUCTURE_EXCLUSION_SCORE_LIST_NAME);
	if(smartsQuerytools == null) return;

		for(int i = 0; i < smartsQuerytools.length; i++) {
		try {
			if(smartsQuerytools[i].matches(candidate.getPrecursorMolecule().getStructureAsIAtomContainer())) {
				this.value++;
			}
		} catch (CDKException e) {
			e.printStackTrace();
		}
	}
		this.calculationFinished = true;
}
 
开发者ID:c-ruttkies,项目名称:MetFragRelaunched,代码行数:17,代码来源:SmartsSubstructureExclusionScore.java

示例3: getAromaticAtoms

import org.openscience.cdk.exception.CDKException; //导入方法依赖的package包/类
/**
 * 
 * @param molecule
 * @return
 */
public static BitArray getAromaticAtoms(IAtomContainer molecule) {
	Aromaticity arom = new Aromaticity(ElectronDonation.cdk(),
	Cycles.cdkAromaticSet());
	BitArray aromaticAtoms = new BitArray(molecule.getAtomCount());
	try {
		AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(molecule);
		arom.apply(molecule);
		Set<IBond> aromaticBonds = arom.findBonds(molecule);
		Iterator<IBond> it = aromaticBonds.iterator();
		while(it.hasNext()) {
			IBond bond = it.next();
			for(int k = 0; k < bond.getAtomCount(); k++)
				aromaticAtoms.set(molecule.getAtomNumber(bond.getAtom(k)));
		}
	} catch (CDKException e) {
		e.printStackTrace();
	}
	return aromaticAtoms;
}
 
开发者ID:c-ruttkies,项目名称:MetFragRelaunched,代码行数:25,代码来源:InChIDeuteriumGeneration.java

示例4: getAtomContainerFromSMILES

import org.openscience.cdk.exception.CDKException; //导入方法依赖的package包/类
public static IAtomContainer getAtomContainerFromSMILES(String smiles) throws Exception {
	IAtomContainer molecule = sp.parseSmiles(smiles);
	for(int i = 0; i < molecule.getAtomCount(); i++) {
		if(molecule.getAtom(i).getSymbol().equals("H")) continue;
		else {
			java.util.List<IAtom> atoms = molecule.getConnectedAtomsList(molecule.getAtom(i));
			short numDs = 0;
			for(IAtom atom : atoms)
				if(atom.getSymbol().equals("H") && (atom.getMassNumber() != null && atom.getMassNumber() == 2))
					numDs++;
			molecule.getAtom(i).setProperty(VariableNames.DEUTERIUM_COUNT_NAME, numDs);
		}
	}
	try {
		AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(molecule);
		Aromaticity arom = new Aromaticity(ElectronDonation.cdk(), Cycles.cdkAromaticSet());
		arom.apply(molecule);
	} catch (CDKException e) {
		e.printStackTrace();
	}
	return molecule;
}
 
开发者ID:c-ruttkies,项目名称:MetFragRelaunched,代码行数:23,代码来源:MoleculeFunctions.java

示例5: getAtomContainerFromInChI

import org.openscience.cdk.exception.CDKException; //导入方法依赖的package包/类
/**
 * 
 * @param inchi
 * @return
 * @throws Exception 
 */
public static IAtomContainer getAtomContainerFromInChI(String inchi) throws Exception {
	de.ipbhalle.metfraglib.inchi.InChIToStructure its = inchiFactory.getInChIToStructure(inchi, DefaultChemObjectBuilder.getInstance());
	if(its == null) {
		throw new Exception("InChI problem: " + inchi);
	}
	INCHI_RET ret = its.getReturnStatus();
	if (ret == INCHI_RET.WARNING) {
	//	logger.warn("InChI warning: " + its.getMessage());
	} else if (ret != INCHI_RET.OKAY) {
		throw new Exception("InChI problem: " + inchi);
	}
	IAtomContainer molecule = its.getAtomContainer();
	try {
		AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(molecule);
		Aromaticity arom = new Aromaticity(ElectronDonation.cdk(), Cycles.cdkAromaticSet());
		arom.apply(molecule);
	} catch (CDKException e) {
		e.printStackTrace();
	}
	return molecule;
}
 
开发者ID:c-ruttkies,项目名称:MetFragRelaunched,代码行数:28,代码来源:MoleculeFunctions.java

示例6: checkBit22

import org.openscience.cdk.exception.CDKException; //导入方法依赖的package包/类
private boolean checkBit22(IAtomContainer ac){
	boolean setBit22 = false;
	AllRingsFinder ringFinder = new AllRingsFinder();
	try {
		//find all rings
		IRingSet rings = ringFinder.findAllRings(ac);
		//check if there are rings with three atoms
		for (int i = 0; i < rings.getAtomContainerCount(); i++) {
			IAtomContainer currentRing = rings.getAtomContainer(i);
			int numberOfRingAtoms = currentRing.getAtomCount();
			if(numberOfRingAtoms == 3){
				setBit22 = true;
				break;
			}
		}
		
	} catch (CDKException e) {
		e.printStackTrace();
	}
	return setBit22;
}
 
开发者ID:fortiema,项目名称:jCompoundMapper,代码行数:22,代码来源:MACCS166.java

示例7: checkBit121

import org.openscience.cdk.exception.CDKException; //导入方法依赖的package包/类
private boolean checkBit121(IAtomContainer ac){
	boolean setBit121 = false;
	ArrayList<IAtom> heterocyclicAtoms = new ArrayList<IAtom>();
	AllRingsFinder ringFinder = new AllRingsFinder();
	try {
		//find all rings
		IRingSet rings = ringFinder.findAllRings(ac);
		//search after one N atom at the rings
		for (int i = 0; i < rings.getAtomContainerCount(); i++) {
			//if one N atom was found, stop
			if(setBit121) break;
			IAtomContainer currentRing = rings.getAtomContainer(i);
			//search after one N atom
			for(int j = 0; j < currentRing.getAtomCount(); j++){
				IAtom currentAtom = currentRing.getAtom(j);
				if(currentAtom.getSymbol().equals("N")){
					setBit121 = true;
					break;
				}
			}
		}
	}  catch (CDKException e) {
		e.printStackTrace();
	}
	return setBit121;
}
 
开发者ID:fortiema,项目名称:jCompoundMapper,代码行数:27,代码来源:MACCS166.java

示例8: checkBit137

import org.openscience.cdk.exception.CDKException; //导入方法依赖的package包/类
private boolean checkBit137(IAtomContainer ac){
	boolean setBit137 = false;
	AllRingsFinder ringFinder = new AllRingsFinder();
	try {
		//find all rings
		IRingSet rings = ringFinder.findAllRings(ac);
		for (int i = 0; i < rings.getAtomContainerCount(); i++) {
			if(setBit137) break;
			IAtomContainer currentRing = rings.getAtomContainer(i);
			//check if at least one atom of the current ring isn't a C atom.
			for(int j = 0; j < currentRing.getAtomCount(); j++){
				IAtom currentAtom = currentRing.getAtom(j);
				if(!(currentAtom.getSymbol().equals("C"))){
					setBit137 = true;
					break;
				}
			}
		}
	}  catch (CDKException e) {
		e.printStackTrace();
	}
	return setBit137;
}
 
开发者ID:fortiema,项目名称:jCompoundMapper,代码行数:24,代码来源:MACCS166.java

示例9: checkBit101

import org.openscience.cdk.exception.CDKException; //导入方法依赖的package包/类
private boolean checkBit101(IAtomContainer ac){
	boolean setBit101 = false;
	AllRingsFinder ringFinder = new AllRingsFinder();
	try {
		//find all rings
		IRingSet rings = ringFinder.findAllRings(ac);
		//search if one ring exists with eight or more atoms
		for (int i = 0; i < rings.getAtomContainerCount(); i++){
			IAtomContainer currentRing = rings.getAtomContainer(i);
			int ringSize = currentRing.getAtomCount();
			if(ringSize >= 8){
				setBit101 = true;
				break;
			}
		}
	} catch (CDKException e) {
		e.printStackTrace();
	}
	return setBit101;
}
 
开发者ID:fortiema,项目名称:jCompoundMapper,代码行数:21,代码来源:MACCS166.java

示例10: getPrevArity

import org.openscience.cdk.exception.CDKException; //导入方法依赖的package包/类
public int getPrevArity() {
	IAtom a = null;
	if (this.atoms == null)
		this.getMolecule();
	
	if (this.position1 == -1 && this.position2 == -1)
		return 1;
	else if (this.position1 != -1) {
		a = this.atoms.get(this.position1);
	} else {
		a = this.atoms.get(this.position2);
	}
	
	IMolecule mol = this.getMolecule();
	int valency = 1;
	try {
		valency = sc.calculateNumberOfImplicitHydrogens(a);
	} catch (CDKException e) {
		e.printStackTrace();
	}
	int hydrogens = a.getImplicitHydrogenCount();
	int connected = mol.getConnectedAtomsCount(a);
	int arity = valency - connected - hydrogens + 1;
	return arity < 1 ? 1 : arity;
}
 
开发者ID:yoann-dufresne,项目名称:Smiles2Monomers,代码行数:26,代码来源:Chain.java

示例11: putMolInSourceFile

import org.openscience.cdk.exception.CDKException; //导入方法依赖的package包/类
private void putMolInSourceFile(StructID id, IAtomContainer mol){
    String idStr = id.toString();
    String folders = sourceFolder + File.separator + idStr.charAt(0) + 
                                        File.separator + idStr.charAt(1) + 
                                        File.separator + idStr.charAt(2);
     
    String filename = folders + File.separator + idStr +".sdf";
    try {
        File f = new File(folders);
        f.mkdirs();
        FileWriter fw = new FileWriter(filename, true);
        SDFWriter writer = new SDFWriter(fw);
        writer.write(mol);
        writer.close();
        fw.close();
    } catch (IOException ioe) {
        ioe.printStackTrace();
    } catch (CDKException ce) {
        ce.printStackTrace();
    }
}
 
开发者ID:ndaniels,项目名称:Ammolite,代码行数:22,代码来源:CachingStructCompressor.java

示例12: createCOOH

import org.openscience.cdk.exception.CDKException; //导入方法依赖的package包/类
public IMolecule createCOOH()
    {
        IChemObjectBuilder builder = NoNotificationChemObjectBuilder.getInstance();
        IMolecule molecule = builder.newMolecule();
        molecule.addAtom(builder.newAtom("C"));
        molecule.addAtom(builder.newAtom("O"));
        molecule.addBond(0, 1, IBond.Order.DOUBLE);
        molecule.addAtom(builder.newAtom("O"));
        molecule.addBond(0, 2, IBond.Order.SINGLE);

        try {

            AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(molecule);
            LonePairElectronChecker lpcheck = new LonePairElectronChecker();
            lpcheck.saturate(molecule);

        }
        catch (CDKException e)
        {
            e.printStackTrace();
        }
//        Image image = MoleculeRenderer2D.renderMolecule(molecule, width, height);
//        new PanelWithBlindImageChart((BufferedImage) image, "0=C-OH").displayInTab();
        return molecule;
    }
 
开发者ID:dhmay,项目名称:msInspect,代码行数:26,代码来源:MetaboliteDBMatcherCLM.java

示例13: createCOOH

import org.openscience.cdk.exception.CDKException; //导入方法依赖的package包/类
public IMolecule createCOOH()
{
    IChemObjectBuilder builder = NoNotificationChemObjectBuilder.getInstance();
    IMolecule molecule = builder.newMolecule();
    molecule.addAtom(builder.newAtom("C"));
    molecule.addAtom(builder.newAtom("O"));
    molecule.addBond(0, 1, IBond.Order.DOUBLE);
    molecule.addAtom(builder.newAtom("O"));
    molecule.addBond(0, 2, IBond.Order.SINGLE);

    try {

        AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(molecule);
        LonePairElectronChecker lpcheck = new LonePairElectronChecker();
        lpcheck.saturate(molecule);

    }
    catch (CDKException e)
    {
        e.printStackTrace();
    }
    return molecule;
}
 
开发者ID:dhmay,项目名称:msInspect,代码行数:24,代码来源:AddReactionProductsCLM.java

示例14: getSmiles

import org.openscience.cdk.exception.CDKException; //导入方法依赖的package包/类
public String getSmiles() {
	IAtomContainer molecule = this.getStructureAsIAtomContainer();
	SmilesGenerator sg = new SmilesGenerator();
	String smiles = null;
	try {
		smiles = sg.create(molecule);
	} catch (CDKException e) {
		e.printStackTrace();
	}
	return smiles;
}
 
开发者ID:c-ruttkies,项目名称:MetFragRelaunched,代码行数:12,代码来源:DefaultBitArrayFragment.java

示例15: getAromaticSmiles

import org.openscience.cdk.exception.CDKException; //导入方法依赖的package包/类
public String getAromaticSmiles() {
	IAtomContainer molecule = this.getStructureAsAromaticIAtomContainer();
	SmilesGenerator sg = SmilesGenerator.generic().aromatic();
	String smiles = null;
	try {
		smiles = sg.create(molecule);
	} catch (CDKException e) {
		e.printStackTrace();
	}
	return smiles;
}
 
开发者ID:c-ruttkies,项目名称:MetFragRelaunched,代码行数:12,代码来源:DefaultBitArrayFragment.java


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