Is there a way to set a basename for an output Directory?
1
0
Entering edit mode
5.8 years ago
ionox0 ▴ 390

For example:

  clipping_dir:
    type: Directory
    outputBinding:
      glob: '*/'
      outputEval: |
        ${
          self.basename = inputs.fastq1.basename.replace('_R1_*', '');
          return self
        }

This results in the following output directory:

"clipping_dir": {
    "basename": "",
    "nameext": "",
    "nameroot": "",
    "location": "file:///home/johnsoni/TEST_RUNS_7/3463813341082909bfada3015f8e63ce/3463813341082909bfada3015f8e63ce",
    "class": "Directory"
},
cwl • 1.1k views
ADD COMMENT
0
Entering edit mode

Can you post an example directory?

ADD REPLY
0
Entering edit mode

Hello chrisball053 and welcome to biostars,

please note that Answers should ONLY be used to respond to the original question at the top of this page and provide (full) solutions.

Use the ADD COMMENT or ADD REPLY buttons above to respond to someone, ask for clarifications, request more details etc.

So I moved your post to a comment.

Keep on writing!

fin swimmer

ADD REPLY
1
Entering edit mode
5.8 years ago
ionox0 ▴ 390

I got this to work with the following example:

  clipping_dir:
    type: Directory
    outputBinding:
      glob: '*/'
      outputEval: |
        ${
          self[0].basename = inputs.fastq1.basename.split('_R1_')[0] + '_umi_clipping_results';
          return self[0]
        }

I assume that */ becomes an array, and that the first element must be accessed with [0]

However, I'm not sure if this follows the best practices for doing this in CWL

ADD COMMENT

Login before adding your answer.

Traffic: 1803 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6