Ok i looked up the Test class and did the following:
public static String createSMARTS(AtomContainer ac) {
String ret;
try {
QueryAtomContainer qac = QueryAtomContainer.create(ac,
Expr.Type.ALIPHATIC_ELEMENT,
Expr.Type.AROMATIC_ELEMENT,
Expr.Type.SINGLE_OR_AROMATIC,
Expr.Type.ALIPHATIC_ORDER,
Expr.Type.ISOTOPE,
Expr.Type.RING_BOND_COUNT
);
ret = Smarts.generate(qac);
} catch (Exception e) {
ret = "";
}
return ret;
}
This works for me.
Sorry to bother you,
Manuel Stesycki
IT
0208 / 306-2146
Physikbau, Büro 117
[email protected]<mailto:[email protected]>
Max-Planck-Institut für Kohlenforschung
Kaiser-Wilhelm-Platz 1
D-45470 Mülheim an der Ruhr
http://www.kofo.mpg.de/de
Am 07.11.2019 um 14:34 schrieb Stesycki, Manuel
<[email protected]<mailto:[email protected]>>:
Dear all,
i am trying to create SMARTS-Pattern for a structure.
The structure is an AtomContainer and read from an MDL file.
If i try to call Smarts.generate( AtomContainer )
i get this error message:
java.lang.ClassCastException: org.openscience.cdk.Bond cannot be cast to
org.openscience.cdk.isomorphism.matchers.QueryBond
Has anyone a clue, where my mistake is?
Many thanks,
Manuel Stesycki
IT
0208 / 306-2146
Physikbau, Büro 117
[email protected]<mailto:[email protected]>
Max-Planck-Institut für Kohlenforschung
Kaiser-Wilhelm-Platz 1
D-45470 Mülheim an der Ruhr
http://www.kofo.mpg.de/de
_______________________________________________
Cdk-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/cdk-user