Inference of natural selection from ancient DNA