Concatenating empty tables

I am having trouble concatenating tables, some of which are on occasion empty.  I have bodged a solution that involves creating a dummy molecule and using an empty table switch along with an End IF node, but I struggle to believe that this is the most elegant solution!  [see attached Capture1.png]

In the attached image, the output of the loop is a series of new molecules -- in this case a whole raft of piperazine analogs -- but if the molecule input does not create any outputs due to the input not having a piperazine, then subsequent Concatenate (Optional in) nodes fail  [see attached Capture2.png]

Does anyone have any suggestions as to how to improve??  As it stands, it does work, but somehow it seems wrong to have to do it this way!

Alastair

Hi Alastair, any chance we can get an example workflow?  It can be simplified and with fake data if needed.  If you post one, I can see if there is a better way to go about it. 

Regards,

Aaron

 

Hi Aaron, workflow attached with data.  The real problem occurs when the workflow returns no output (if the input has no piperazine ring) - then subsequent concatenate nodes will fail.

Nice, that was both a bug (fixed for the next release) and it had a very easy to workaround. If you uncheck the last box in the loop end node and delete your empty table switch + the extra branch, it looks like it works as hoped.   See attached.

 

thanks, works a treat now!

Hi,

I’m a relatively new user to KNIME, and this is my first post.  

I am trying to concatenate two tables and I have some issues. The way the workflow works is as followed:

The process starts by splitting a sentence in two column using pre-assigned keyword, to isolate Attacker (column A) and Defender (Column B).  When a specific group is tagged in one or the other category, the process assign a numerical value (e.g. Attacker get +1 and Defender get -1).

In short I get two tables along these lines (I know, the output is less than an idle format, however it cannot be changed):

Attacker Output table

Entry_ID

Sentence

Group 1

Group 1 value

Group2

Group 2 value

Group 3

Group 3 value

1

Group 1 attacks Group 2

Group1

+1

 

 

 

 

2

Group 1 attacks Group 3

Group 1

+1

 

 

 

 

3

Group 2 attacks group 1

 

 

Group 2

+1

 

 

 

 

 

 

 

 

 

 

 

Defender Output Table

Entry_ID

Sentence

Group 1

Group 1 value

Group2

Group 2 value

Group 3

Group 3 value

1

Group 1 attacks Group 2

 

 

Group 2

-1

 

 

2

Group 1 attacks Group 3

 

 

 

 

Group 3

-1

3

Group 2 attacks group 1

Group 1

-1

 

 

 

 

 

 

 

 

 

 

 

 

 

Now I want to bring these tables together so that they look like this (one row per entry_ID):

Entry_ID

Sentence

Group 1

Group 1 value

Group2

Group 2 value

Group 3

Group 3 value

1

Group 1 attacks Group 2

Group1

+1

Group 2

-1

 

 

2

Group 1 attacks Group 3

Group 1

+1

 

 

Group 3

-1

3

Group 2 attacks group 1

Group 1

-1

Group 2

+1

 

 

 

I’ve tried a few concatenate and GroupBy options but don’t seem to get it working (I also played with the missing value node to transform all empty cell into either 0 (if value cell) or “” for string cell)), all I get is the following output where entry are duplicated:

 

Entry_ID

Sentence

Group 1

Group 1 value

Group2

Group 2 value

Group 3

Group 3 value

1

Group 1 attacks Group 2

Group1

+1

 

 

 

 

2

Group 1 attacks Group 3

Group 1

+1

 

 

 

 

3

Group 2 attacks group 1

 

 

Group 2

+1

 

 

1

Group 1 attacks Group 2

 

 

Group 2

-1

 

 

2

Group 1 attacks Group 3

 

 

 

 

Group 3

-1

3

Group 2 attacks group 1

Group 1

-1

 

 

 

 

 

I would really appreciate your help on this.

 

Thanks

Julien