User 8052c55234
09-07-2014 09:33:14
I am interested in Jarvis-Patrick clustering, and I met two difficulties:
1) First, I initially try to implement the command line
jarp -i "/home/X/Desktop/JavaProject/testJP" -c 0.1 -t 1.6 -f 0 -m 3 -z -y
it in a java code with:
JarvisPatrick jp=new JarvisPatrick();
try {
jp.setInput("/home/X/Desktop/JavaProject/testJP");
} catch (FileNotFoundException e1) {
e1.printStackTrace();
}
jp.setMinCommonRatio(0.1f); //-c
jp.setThreshold(1.6f); //-t
jp.setFpSize(0); // -f
jp.setDimensions(2); // -m
jp.setStatNeeded(true); // -z
try {
jp.run();
} catch (ClusteringException | IOException | SQLException| InvalidLicenseKeyException e) {
e.printStackTrace();
}
But it give me the following error:
Exception in thread "main" java.lang.NullPointerException
at chemaxon.clustering.JarvisPatrick.run(JarvisPatrick.java:348)
at Clustering.JarvisPatrickClustering.<init>(JarvisPatrickClustering.java:55)
at main.runJarvisPatrick.main(runJarvisPatrick.java:14)
It should be note that the command line work well.
Is there any specific option I do not gave?
-----
2) Second, I would like to be sure about the data to give as input file.
Initially, I gave a neighbors matrix (with 0 and 1), but based on a previous post, https://www.chemaxon.com/forum/viewpost2909.html
I do a matrix distances as follow:
251 0.000 0.890 0.913 0.915 0.954 0.923 0.891 0.900 0.962 0.888
252 0.890 0.000 0.891 0.838 0.935 0.929 0.805 0.896 0.944 0.845
253 0.913 0.891 0.000 0.908 0.905 0.907 0.883 0.909 0.921 0.871
254 0.915 0.838 0.908 0.000 0.916 0.942 0.879 0.862 0.907 0.892
255 0.954 0.935 0.905 0.916 0.000 0.805 0.891 0.917 0.798 0.955
256 0.923 0.929 0.907 0.942 0.805 0.000 0.844 0.919 0.906 0.925
257 0.891 0.805 0.883 0.879 0.891 0.844 0.000 0.911 0.914 0.877
258 0.900 0.896 0.909 0.862 0.917 0.919 0.911 0.000 0.908 0.902
259 0.962 0.944 0.921 0.907 0.798 0.906 0.914 0.908 0.000 0.931
260 0.888 0.845 0.871 0.892 0.955 0.925 0.877 0.902 0.931 0.000
jarp -i "/data/txt" -c 0.01 -t 0.9 -f 0 -m 10 -z -y
I obtain only singletons, even if by looking the matrix, a lot of compounds have a distance lower than the the threshold t of 0.9 and satisfy the common neighbors percentage.
Is there any complement information/problem in my understood in this point?
Any helps for one or both points are welcome