I have 10 bacterial genomes and 78 virus genomes. I would like to identify if the virus is an insertion in one of the available bacterial genomes. To identify this, I am interested in calculating the similarity between all possible bacterial and virus genomes. What is the best possible way to do this, instead of looping over two sets of genomes ?