r3 - 04 Mar 2008 - 15:52:30 - AlanWilliamsYou are here: myGrid wiki >  Mygrid Web  > TavernaWorkbench > TavernaFaq > FaqDeepLists

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.

Edit | WYSIWYG | Attach | Printable | Raw View | Backlinks: Web, All Webs | History: r3 < r2 < r1 | More topic actions
 
Powered by myGrid wiki
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding myGrid wiki? Send feedback