Rename file in CWL ExpressionTool?
2
0
Entering edit mode
4.9 years ago
alanh ▴ 170

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 • 1.3k views
ADD COMMENT
0
Entering edit mode
4.9 years ago

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 COMMENT

Login before adding your answer.

Traffic: 2441 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