Transition between Stochastic Evolution and Deterministic Evolution in the Presence of Selection: General Theory and Application to Virology