Rajarshi,

the CDK-Jmol bridge code needs some maintainance...

I will update the code examples shortly...

Comments below...

> Hi, I have some code that returns a IMolecule object
> I am interfacing it to some Jmol code which expects a Molecule
> When running the code I get an error:
>
> java.lang.ClassCastException: org.openscience.cdk.Molecule
>
> (It's not more informative since this is running from within R)

Clear enough...

> I am using code like below:
>
> public class ViewMolecule3D {
>       JmolPanel jmolPanel;
>
>       Molecule  molecule = null;

Make this:

IMolecule molecule = null;

>       String filename = null;
>
>       final static String strScript = "";
>
>       public ViewMolecule3D(IMolecule molecule) {
>               this.molecule =(Molecule)molecule;
>       }
>
> is it correct to coerce an IMolecule to Molecule?

I assume you use the CdkJmolAdapter class at some point... you will need
to update that code too.

If you have the need to convert a IMolecule into a Molecule, you can take
this code (say your IMolecule instance is imol):

Molecule mol = DefaultChemObjectBuilder.getInstance().newMolecule(imol);

Egon




-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
Cdk-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/cdk-user

Reply via email to