Basic coding-Stuck with Java script while working with KNIME
1
0
Entering edit mode
4 months ago
Sanjukta • 0

Hi there, I am working screening a ligand db on KMINE, and have to assign a column for the number of times each ligand cleared the following conditions for the 5 attributes in the columns of the input table:

Attributes                                                        Conditions
 1. SlogP                                                           <5
 2. TPSA                                                            <70
 3. Average Molecular Weight  (AMW)             <450
 4. No of rotatable bonds                                   <8
 5. Total Hydrogen donors and acceptors          <7

I am new to coding and I am suppose to use Java snippet according to the workflow I am following: I tried if-else-if statement, but as per the code, the conditions are getting bypassed every time it is true for one condition, hence the output column shows either 0 or 1.

enter image description here

I am following this beautiful website: https://www.geeksforgeeks.org/continue-statement-in-java/?ref=lbp which has the best simplified illustrations for a beginner. But all the flowcharts simply do not conform to my problem. I really need some help here. :)

java • 357 views
ADD COMMENT
2
Entering edit mode
4 months ago

I'm not sure I understand. unless I'm wrong you don't have to use else if , just use if statements

int count=0;
if($a$ < 12) count++;
if($b$ < 34) count++;
if($c$ > 57) count++;
if($d$ < 89) count++;
return count;
ADD COMMENT
0
Entering edit mode

Thanks it worked. :)

ADD REPLY

Login before adding your answer.

Traffic: 2290 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6