Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a Cook Book example on how to use the Pair type and how to scatter them #11

Open
ekiernan opened this issue Dec 19, 2022 · 2 comments

Comments

@ekiernan
Copy link
Collaborator

Write a Cook Book how-to that shows a real workflow example that uses the pair type.

@kayleemathews
Copy link
Collaborator

Example workflow from Daniel Park on openwdl slack

The workflow:

  • starts with a simple scatter on an Array of accessions
  • performs (in a custom task, since WDL has no native way to do this) a group-by operation on that Array to bunch them up by accession number (since each accession might otherwise have multiple other things associated with it)
  • then does a scatter on a zip of the group-by outputs (so now you've got your Pairs)
  • inside the scatter it's doing value lookups on Maps
  • demonstrates a common pattern I have where a WDL scatter produces an Array[String] per item, which then becomes an Array[Array[String]] which is written out as a single TSV file. adding a header to such a TSV file is a little clunky so it's handled with a concatenation task.

@kayleemathews
Copy link
Collaborator

There also might be an example in the Cromwell repo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants