1. A method of detecting aneuploidy or sex in a fetus, the method comprising: (a) extracting DNA from the blood of an individual carrying the fetus; (b) mapping segments of the extracted DNA to a reference genome comprising a nucleic acid sequence of interest; (c) partitioning substrings of the reference genome into a plurality of partition levels based on a source of variability that biases nucleic acid sequence abundance measurements, wherein the source of variability is GC content, methylation state, PCR or sequencing performance, sequence length, and/or duplex melting temperature of the substrings; (d) calculating an expected number of segments mapped to the nucleic acid sequence of interest using (i) the number of substrings in the nucleic acid sequence of interest in each partition level, and (ii) the number of substrings in the reference genome in each partition level; and (e) comparing an actual number of segments mapped to the nucleic acid sequence of interest against the expected number of segments mapped to the nucleic acid sequence of interest; and (f) detecting a deviation of the actual number of segments from the expected number of segments; and (g) diagnosing an aneuploidy in the fetus, or determining the sex of the fetus based at least in part on the deviation detected in (f).