From the source code comments ...
#!/usr/bin/env perl
# Identify horizontal transfer genes.
#
# Algorithm:
#
# 1. Find block of top hits within 0.95 of the maximum bit score.
# 2. For each hit in this block, find the highest phyla that is
# different from the query gene's genome. E.g., if domain is
# different, record the external domain of the transfer. Next,
# if the domain is same, but phylum is different, record the
# the phylum. And so forth downwards to the 'order' level.
# 3. We do not include cases where the query gene's genome phyla is
# the only one in the database, since "everything is external"
# due to this artifact of the database, and is not the biology.
# 4. Also report the reverse hit from the subject taxon/gene
# to the same phyla as query genome for the query gene with
# the horizontal transfer. This is a phyla reverse hit with
# no bit score restrictions.
#