Skip to content

What is the order of applying engines/JsonPointer ? #144

Closed

Description

@portah

I have next code:

class: CommandLineTool
      requirements:
        - import: node-engine.cwl
      inputs:
        - id: "#genome1"
          type: string

        - id: "#genome2"
          type: string

        - id: "#downloadtemplate"
          type: string
          default: "http://hgdownload.cse.ucsc.edu/goldenPath/{genome1}/liftOver/{genome1}To{genome2}.over.chain.gz"
          inputBinding:
            position: 2
            #prefix: "-o"
            valueFrom:
              engine: node-engine.cwl
              script: |
                {
                  var temp=$self.replace(/{genome1}/g,$job['genome1']).replace("{genome2}",$job['genome2']);
                  return temp;
                }

        - id: "outfilename"
          type: string
          default: "{genome1}To{genome2}.over.chain.gz"
          inputBinding:
            position: 1
            prefix: "-o"
            valueFrom:
              engine: node-engine.cwl
              script: |
                {
                  var temp=$self.replace("{genome1}",$job['genome1']).replace("{genome2}",$job['genome2']);
                  return temp;
                }

      outputs:
        - id: "#overchain"
          type: File
          outputBinding:
            glob:
              engine: cwl:JsonPointer
              script: /job/outfilename

"#overchain" is equal to "{genome1}To{genome2}.over.chain.gz" not a replaced one.

Activity

  1. mr-c commented on Oct 26, 2015

    @mr-c
    Member

    @portah Are you seeing a difference in behaviour of the various implementations?

  2. portah commented on Oct 26, 2015

    @portah
    MemberAuthor

    @mr-c Not yet, I will check it. This post is more like explanation how it works in cwltool. My thought is that it has to be clear in what order everything is applied. And probably has to be in the spec.

  3. tetron commented on Oct 26, 2015

    @tetron
    Member

    From the spec: "The order in which expressions are evaluated within a process or workflow is undefined."

    To clarify, expressions only get the input object; valueFrom only applies to command line building.

    You can use engineConfig to include code that is evaluated before the expression so if you have a common function you only have to write it once.

    However, this specific example would probably be better served by #137.

  4. mr-c commented on Feb 16, 2016

    @mr-c
    Member

    I think this isn't an issue anymore; @portah or others feel free to re-open if I'm wrong

  5. added a commit that references this issue on Mar 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions