Skip to end of metadata
Go to start of metadata

An empty list usually means that for a given input, no results were found. For instance, if you have a service that looks up genes producing a certain protein, and you feed it with a list of 8 different protein identifiers, you might get back a list of lists of proteins. There would then normally be one list corresponding to each of the inputs, in order. If any of the inputs did not match in the database, the inner list will be empty.

In a complex workflow, these empty lists will not disappear by themselves, because they represent “no results”. So if you pass the result of the previously mentioned service into another service again, if Taverna iterates over the inputs, the service will not actually be called when it encounters the empty list, but a corresponding empty list will be added to the output.

This picture is of course complicated by that some services actually read whole lists of inputs (for instance for sorting them or similar).

To get rid of the empty lists, you can apply a Beanshell like this:

 

 

Remember to specify the correct depth of the input list to the Beanshell service/processor for this to work, in this case the input “list” can be changed from depth 0 to a depth 2 list (matching the depth of the input) and should be able to transform:

{ { {} { Hello } } {} }

into

{ { { Hello } } }

Note that this Beanshell probably will not be able to handle removal of lists that become empty because they only contained empty lists.

Labels
  • None