Isabel Haubro-Suppanz
07/15/2026, 9:57 AMBIOBAMBAM_BAMMERGE module and the ext.args directive.
I would like to use the module to merge some bam files and ideally get an index for the merged file at the same time. I should be able to specify this using the ext.args directive, so I looked at the bammerge software and its arguments and this the help string:
This is biobambam2 version 2.0.185.
biobambam2 is distributed under version 3 of the GNU General Public License.
Key=Value pairs:
I=<[filename]> : input file, can be set multiple times
SO=<[coordinate]>] : sort order (coordinate or queryname)
level=<[6]> : compression settings for output bam file (1=fast,2=2,3=3,4=4,5=5,6=6,7=7,8=8,9=best,10=10,11=11,12=12)
verbose=<[1]> : print progress report
md5=<[0]> : create md5 check sum (default: 0)
md5filename=<filename> : file name for md5 check sum (no checksum is computed if md5filename is unset)
index=<[0]> : create BAM index (default: 0)
indexfilename=<filename> : file name for BAM index file (no BAM index is produced if indexfilename is unset)
tmpfile=<filename> : prefix for temporary files, default: create files in current directory
IL=<filename> : name of file containing input file names
So, if I understand correctly, I would need to write something like the following in my modules.config file for this module:
withName: 'BIOBAMBAM_BAMMERGE' {
ext.args = { 'index=1 indexfilename=[filename]'}
}
Is that how the ext.args directive works? Is there any good way to set a sensible value for the filename based on what the bam file is called?Simon Pearce
07/15/2026, 11:59 AMwithName: 'BIOBAMBAM_BAMMERGE' {
ext.args = { "index=1 indexfilename=${meta.id}.bam.bai"}
}Simon Pearce
07/15/2026, 11:59 AMSimon Pearce
07/15/2026, 12:00 PMIsabel Haubro-Suppanz
07/15/2026, 12:13 PMIsabel Haubro-Suppanz
07/15/2026, 12:27 PM