本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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();
}
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}