Question: Rename file in CWL ExpressionTool?
0
gravatar for alanh
7 months ago by
alanh80
alanh80 wrote:

Expanding on best practice for renaming file in CWL workflow

Is there any way to do this after the fact in an ExpressionTool?

I'm running a somatic workflow and using Strelka to call germline variants. Inside the CWL, I'm easily able to refer to the outputs as "tumor_germline/variants_vcf" and "normal_germline/variants_vcf" (e.g. to run a concordance SNP check to confirm that we have a match from the same subjects), but the underlying filenames for both of these files are "../results/variants.vcf.gz".

When I do an ExpressionTool to collect the results at the end of the workflow into a subject-directory, it names my files "variants.vcf.gz" and "variants.vcf_2.gz" and, concerningly, it names the second vcf's associated .tbi file "variants.vcf.gz_2.tbi" which breaks things.

I'd really like to name them "tumor.variants.vcf.gz" and "normal.variants.vcf.gz" and I want to do that in my collection expression tool. I'm not really worried about extraneous files, as these tend to be in the "just a few megabytes" range, and I'm cleaning out non-final-output intermediate files at workflow completion.

cwl file management • 277 views
ADD COMMENTlink modified 7 months ago by Michael R. Crusoe1.8k • written 7 months ago by alanh80
0
gravatar for Michael R. Crusoe
7 months ago by
Common Workflow Language project
Michael R. Crusoe1.8k wrote:

Hello alanh,

Yes, you can rename files using an ExpressionTool in CWL.

Change the basename property of the File objects.

Here is a very complicated example: https://github.com/EBI-Metagenomics/ebi-metagenomics-cwl/blob/cac44f2cf14110fde9951161c663c4525772f616/workflows/convert-to-v3-layout.cwl

ADD COMMENTlink written 7 months ago by Michael R. Crusoe1.8k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 872 users visited in the last hour