cdk / nodes4knime

KNIMES nodes using the CDK 1.5 library.
3 stars 5 forks source link

CAS input doesn't work in Structure Sketcher node #15

Open iwwwish opened 3 years ago

iwwwish commented 3 years ago

Hi,

I suppose the issue is with the URLs in the getMoleculeFromCAS(String cas) method in InsertTextPanel.java. As NCBI switched to HTTPS, this method now returns null. I could get the method working with the following changes:

Edit 1: String firstURL = "http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?db=pccompound&term=" + cas; (change to https)

Edit 2: Pattern pattern = Pattern.compile("http://pubchem.ncbi.nlm.nih.gov/summary/summary.cgi\\?cid=(\\d*)"); (change the regex string to https://pubchem.ncbi.nlm.nih.gov/compound/(\\d*))

Edit 3: String secondURL = "http://eutils.ncbi.nlm.nih.gov/entrez/eutils/esummary.fcgi?tool=jcppubchem&db=pccompound&id=" + cid; (change to https)

Edit 4: pattern = Pattern.compile("<Item Name=\"CanonicalSmile\" Type=\"String\">([^\\s]*?)</Item>"); (change CanonicalSmile to CanonicalSmiles)

Is it possible to release a new version of jchempaint-hotfix-3.4.jar? I would like to use the sketcher panel in the development of a new KNIME node.

Thank you, Vishal