The first method we discuss takes high-throughput sequencing data and characterizes both copy number and allelic variation in the IGHV and TRBV loci. These two loci can vary extensively between individuals in copy number and contain genes that are highly similar, making their analysis technically challenging. Additionally, we have conducted the first study of a globally diverse sample of hundreds of individuals in these two loci from over a hundred populations. In our second problem setting, we describe an optimized and parallelized pipeline for primer design in the context of selective amplification. Unlike previous heuristic-based methods, our method uses machine learning methods to evaluate both individual primers and primer sets and uses branch-and-bound principles to pursue only the most promising sets. These optimizations allow for a huge decrease in runtime from the order of weeks to minutes. We also discuss results of our pipeline applied to the selective amplification of Mycobacterium tuberculosis in a sample of human blood.