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

[FEATURE] Allow defining a tag based on the state going through the channel. #693

Open
2 tasks done
rcannood opened this issue Apr 27, 2024 · 0 comments
Open
2 tasks done
Labels
enhancement New feature or request

Comments

@rcannood
Copy link
Member

Feature summary

Allow defining a tag based on the state going through the channel.

Feature description

Right now, the trace.txt uses the tag which is simply set to $id to figure out which process is linked to which component. In OpenProblems, we use it to link the output of the Nextflow trace (containing resource usage throughout the run) to the different datasets going through the pipeline.


It would be useful if we could construct the tag based on information in the state, and if the tag was machine interpretable.

Example: {"dataset_id": ..., "normalization_id": ..., ...}.

However, this is currently not possible because the tag can only be defined using information available inside the underlying nextflow process; that is:

"""nextflow.enable.dsl=2
  |
  |process $procKey {$drctvStrs
  |input:
  |  tuple val(id)$inputPaths, val(args), path(resourcesDir, stageAs: ".viash_meta_resources")
  |output:
  |  tuple val("\$id")$outputPaths, optional: true

For a component with input files --input_mod1 and --input_mod2, this would look something like this:

input: tuple val(id), path(viash_par_input_mod1), path(viash_par_mod2), val(args), path(resourcesDir)

Fundamentally, it would probably be a good idea to implement this at a Viash level, so we can do something like:

| component.run(
  auto: [
    tag: { id, state ->
      toJsonBlob([dataset_id: state.dataset_id])
    }
  ]
)

Why is this feature beneficial?

Allows linking the trace.txt more easily to whatever it needs to be linked to.

Alternatives considered

As a workaround, we could add a --tag argument in components which we could then use to set the tag to tag: "${args.tag ?: id}". See openproblems-bio/openproblems-v2#446.

Possible solution

No response

Confirmation

  • I have searched the existing issues to make sure this is not a duplicate request.
  • I have provided clear and concise information about the feature.
@rcannood rcannood added the enhancement New feature or request label Apr 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant