Identifying Population Histories, Adaptive Genes, And Genetic Duplication From Population-Scale Next Generation Sequencing