Methods for Comparative Genome Analysis with Applications to Pan-Genomics and Genome Annotation