The field $input.name will give you the visible name from the history.
But those are usually not very useful,since they usually are something like "Intersect on Data 23 and Data 24"
I have began to change all the labels for most of the tools to something more useful such that it is clear from the label what the original file was that you used. Specifically for FASTQ files and mapping etc.
So when I start with a fastq file called "165_1_ACGTAG.fastq" and I run BWA, I get "165_1_ACGTAG-bwa.sam".
Then when I changed that to BAM that, I get "165_1_ACGTAG-bwa.bam" and when I change the header, I get something like "165_1_ACGTAG-bwa-ReHead.bam" etc.
The trick I use for that is something like this:
label="#echo os.path.splitext ( str ( $paired.input1.name ) ) [ 0 ] #-PE-bwa.sam" for BWA for instance
Later, in a different tool I use:
label="#echo os.path.splitext ( str ( $inputFile.name ) ) [ 0 ] #-ReHead.bam"
That will extract the basename of the file (The stuff before a period) and attached "-ReHead.bam" to the original input file name ($inputFile.name).
This way it becomes much clearer what the file contains and what its history is.
It is using the Cheetah syntax (
Cheetah Users' Guide
) to extract and reformat the strings. Everything between the two hashmarks is treated as CHEETAH code.
It is not a trivial task to change all the labels and sometimes you have to fudge a little (in the case of multiple input files for instance...Then I just choose the first...Also it becomes more tricky when there are some conditional statements (such as in BWA)...>Then you sometimes have to duplicate the code to make it work...But it is possible...
I have attached a few of my .xml file for the most popular tools...Hope they help...
Thon