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.