Genetic heterogeneity is an important feature of many biological systems, but introduces technical challenges to their characterization. Even with the best modern instruments, only a small fraction of DNA molecules present in a sample can be read, and they are recovered in the form of short, hundred-base reads. In this paper, we introduce 3dPCR, a method to sort DNA molecules with sequence specificity. 3dPCR allows heterogeneous populations of DNA to be sorted to recover long targets for deep sequencing. It is valuable whenever a target sequence is rare in a mixed population, such as for characterizing mutations in heterogeneous cancer cell populations or identifying cells containing a specific genetic sequence or infected with a target virus.