CDK-R / cdkr

Integrating R and the CDK
https://cdk-r.github.io/cdkr/
42 stars 27 forks source link

view.molecule.2d: 'cellx' not found #45

Closed sneumann closed 6 years ago

sneumann commented 7 years ago

Hi,

if running the example from #14, I get 'cellx' not found:

> library(rcdk)
Loading required package: fingerprint
> m <- parse.smiles("[CH2+]")[[1]]
> get.total.charge(m)
[1] 1
> view.molecule.2d(m)
Error in .jnew("org/guha/rcdk/view/ViewMolecule2D", molecule, as.integer(cellx),  : 
  object 'cellx' not found
> sessionInfo()
R version 3.2.3 (2015-12-10)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 16.04.2 LTS

locale:
 [1] LC_CTYPE=en_US.UTF-8          LC_NUMERIC=C                 
 [3] LC_TIME=de_DE.UTF-8           LC_COLLATE=en_US.UTF-8       
 [5] LC_MONETARY=de_DE.UTF-8       LC_MESSAGES=en_US.UTF-8      
 [7] LC_PAPER=de_DE.UTF-8          LC_NAME=de_DE.UTF-8          
 [9] LC_ADDRESS=de_DE.UTF-8        LC_TELEPHONE=de_DE.UTF-8     
[11] LC_MEASUREMENT=de_DE.UTF-8    LC_IDENTIFICATION=de_DE.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] rcdk_3.4.1        fingerprint_3.5.4

loaded via a namespace (and not attached):
[1] parallel_3.2.3  rcdklibs_1.5.14 iterators_1.0.8 itertools_0.1-3
[5] rJava_0.9-8     png_0.1-7 
rajarshi commented 7 years ago

Hmm, I just ran it on the latest Github code and it worked with no error. Can you do a pull and see if it works?

shekfeh commented 7 years ago

I got the same problem; which I think it is connected to the version of java used for compilation. In the first trial I compiled everything using java7 installing rJava and rCDK. However I was getting: "Error in .jnew("org/guha/rcdk/view/ViewMolecule2D", molecule, as.integer(cellx), : java.lang.UnsupportedClassVersionError: org/guha/rcdk/view/ViewMolecule2D : Unsupported major.minor version 52.0"

when I changed to java8, I started to have problem compiling rJAVA, and the old rjava compiled with J7 was kept. while CDK was compiled with java8 with no errors. The error message for view.molecule.2d will be : "> view.molecule.2d(mols[[1]]) Error in .jnew("org/guha/rcdk/view/ViewMolecule2D", molecule, as.integer(width), : java.lang.NoSuchMethodError: ".

Most probably we need to look to the compatibilty between java8 and rJava

rajarshi commented 7 years ago

Are you using the latest code from Github?

shekfeh commented 7 years ago

Yes, I installed from github. However now I found your example in other thread which works fine:

m <- parse.smiles("Cl.Cl.c1ccccc1-c1ccccc1 |m:1:4.5.6.7.8.9,3:10.11.12.13.14.15|")[[1]] dep <- get.depictor(width=300, height=300, style='nob') copy.image.to.clipboard(m, dep) img <- view.image.2d(m, dep)

The example view.molecule.2d(mols[[1]]) is from old turorial pdf.

rajarshi commented 7 years ago

Good that it works for you now. I should update the tutorial at one point