Get bai file generated by galaxy in tool xml?


I made xml wrappers for some gatk4 tools. They receive and/or generate bam files and also corresponding bai files. So i made separate inputs/outputs via which they can pass that bai files.

But today i tried to download some bam from galaxy web interface (21.05), and it showed me menu in which i can also download bai file, and this bai is not the bai generated by my tools cos it weighs about 1.5 times less. I found it by size, and it was there:


, whereas the bam file was there:


Is there a way to use this bai in tool xmls so i could pass only one noodle for each bam file?

Thanks in advance.

The right answer is:

ln -s '$bam.metadata.bam_index' 'input.bam.bai'