# Merging/concatenating index files

I was wondering if any one has had success merging pre-generated reference index files for BWA, bowtie2 from multiple references?

For a concrete example I have hg19 and a bunch of viral and bacterial genomes that all have been index separately but I want to do a single alignment to all of them. Is there a way I could say combine hg19, virus_A, virus_D and bacteria_X into a single reference without having to regenerate the indexes? Since the problem could get combinatorial quickly and indexing anything with hg19 is time consuming I was wondering if there was a way around it.

• this will likely depend on the tool no? i doubt there is a generic why to merge indexes? for BLAST, there is blastdb_aliastool Apr 4, 2019 at 15:34
• Yeah, I would split this into separate questions for each tool. I don't actually know how the blast index works, but I would be very surprised if the same approach will work for all three tools. It might be the same for bowtie and bwa, but blast will likely be different. Apr 4, 2019 at 16:09
• Agreed I wasn't looking for a generic tools but the question does read that way. I was looking for a way for each of those tools. Thanks @Chris_Rands ill check out blastdb_aliastool Apr 4, 2019 at 19:59
• What would you be aligning? Short reads? Why would you want to align the same data against three so different genomes? Surely the time you would save by not re-indexing would be lost again while wasting time aligning to the wrong genome, right? Apr 5, 2019 at 8:34
• @terdon I imagine they have metagenomic data or similar where the sample composition is not known a priori (reads could be 90% human, 8% E. coli etc.) Apr 5, 2019 at 12:12