The byAS script scans a SAM file and stores alignment scores from each species in a separate dictionary, in which the key is the unique record ID. Reads that match both genomes with equal scores (~0.51% of reads) are biased to choose the first-appearing read in the bam file. The two species-specific dictionaries are then used to iterate through the source, paired FASTQ files, exporting records into two sets of species-specific FASTQ files. The two sets of paired FASTQ files are re-aligned with the appropriate species of genome index using HISAT2. Selecting only high-scoring read pairs slightly reduced the final alignment rate (Fig. 1A, byAS). However, the overall error rate (Fig. 1B) is substantially reduced compared with a direct alignment with individual genomes (HISAT2_sep), and the accuracy was equal to or better than other methods (Fig. 1C). The strategy of classifying reads based on optimal match to a given genome clearly improved accurate alignment.