Why are the results so deeply nested say when using BioMoby?
This is related to the
explanation for empty lists. Service that take a single value in and return a list of values will normally produce deeply nested lists when combined. Again, this is because in many cases each list in the output corresponds to each value of the input list. This is further complicated by services that takes many inputs.
If a service takes inputs
a, b, c, all of them single values (not lists), then if you call this service with three lists
A=[1,2,3],
B=[4,5],
C=[6,7], Taverna's implicit iteration will call the service equivalent to:
results = []
for a in A:
aResults = []
results.add(aResults)
for b in B:
bResults = []
aResults.add(bResults)
for c in C:
cResults = []
bResults.add(cResults)
cResults.add(service(a,b,c))
(The actual ordering of
a,b,c is not guaranteed without an iteration strategy defined, so it might just as well be c iterated first)
Now, the result list will be mirroring this structure, so there will be a list for all the A results, which will be lists of all the B results, which will again contain one result for each different C. Now, the service might return a list as well, so in this case you would get a 4-level deep list as a result.
If you are not really interested in keeping this structure, you can flatten the list. From
Local Java Widgets, select
List -> Flatten list (
Flatten list from l(l()) to l() in older Tavernas). If you have a recent Taverna version (1.5.1.6 or newer), you are able to right click on the processor once it's been added to the workflow, and select how many levels you want to flatten the lists.