The complex interplay between routine antibiotic use and zoonotic pathogen presence makes livestock farming environments unique nexuses for the potential emergence of zoonotic diseases and/or antibiotic resistant bacteria and their resistance genes. Livestock can further facilitate transmission and emergence by serving as intermediary or amplifying hosts in which pathogens and antibiotic resistant bacteria and their genes can evolve and spill over into humans. As such, we were interested in understanding differences in the dairy worker microbiota that may arise due to exposure to livestock farming environments to evaluate potential risks of these environments in facilitating global dissemination of zoonotic disease, antibiotic resistant bacteria and antibiotic resistance genes. We used culture independent methods that go beyond the traditional single pathogen approach to conduct comparisons between the gut microbiota and resistome of dairy workers and of community controls as well as to interrogate functional differences in commensal genomes recovered from both groups. To enable our study of functional differences, we first addressed methodological limitations with novel statistical methods for pangenomics. We developed happi, a statistical method for modeling gene presence that accounts for differential genome quality factors (e.g., mean coverage). We evaluated happi's performance using simulated and shotgun sequencing data and found that happi is accurate and robust even in scenarios when genome quality is correlated with the main covariate of interest. happi can furthermore be broadly applied to functional comparisons of genomes of other microorganisms beyond bacteria, and used in functional comparisons of metagenomes to adjust for differential quality (e.g., sequencing depths) of metagenomes. Using happi to facilitate our functional comparisons, we conducted a metagenomics and pangenomics investigation of the effects of occupational exposure to dairy farm environments on metagenome differences in taxonomy, diversity and gene presence (i.e., co-abundant gene groups (CAGs), antibiotic resistance genes (ARGs), and virulence factors) and on functional differences of gut commensal bacteria genomes in dairy workers and community controls. A major strength of our study was the multi-level interrogation of dairy worker and community control microbiomes. Our cross-sectional study examining differences in microbial genes and genomes from dairy workers and community controls observed several patterns for further investigation including greater abundance of tetracycline resistance genes and higher occurrence of cephamycin resistance genes in dairy workers' metagenomes; evidence of commensal organism association with plasmid-mediated tetracycline resistance genes found in both dairy workers and community controls; and lower average gene and genome diversity in dairy workers' metagenomes compared to community controls. These findings point towards possible avenues for future research to better understand the impact of exposure to zoonotic pathogens, antibiotic resistant organisms, and ARGs on the microbiome and resistome of livestock workers and others with close animal contact.