A method for sequencing nucleic acid molecules from a sample, comprising (a) applying adapters to DNA fragments in the sample to obtain DNA-adapter products, wherein each adapter comprises a nonrandom unique molecular index, wherein nonrandom unique molecular indices of the adapters have at least two different molecular lengths and form a set of variable-length, nonrandom unique molecular indices (vNRUMIs), and wherein each vNRUMI differs from every other vNRUMI in the set used in a process by at least a defined edit distance; (b) amplifying the DNA-adapter products to obtain a plurality of amplified polynucleotides; (c) sequencing the plurality of amplified polynucleotides, thereby obtaining a plurality of reads associated with the set of vNRUMIs; (d) identifying, among the plurality of reads, reads associated with a same vNRUMI, comprising: obtaining, for each read of the plurality of reads, alignment scores with respect to the set of vNRUMIs, each alignment score indicating similarity between a subsequence of a read and a vNRUMI, wherein the subsequence is in a region of the read in which nucleotides derived from the vNRUMI are likely located, selecting, for each read of the plurality of reads, at least one vNRUMI from the set of vNRUMIs based on the alignment scores, and associating each read of the plurality of reads with the at least one vNRUMI selected for the read; and (e) determining a sequence of a DNA fragment in the sample using the reads associated with the same vNRUMI. (a) applying adapters to DNA fragments in the sample to obtain DNA-adapter products, wherein each adapter comprises a nonrandom unique molecular index, wherein nonrandom unique molecular indices of the adapters have at least two different molecular lengths and form a set of variable-length, nonrandom unique molecular indices (vNRUMIs), and wherein each vNRUMI differs from every other vNRUMI in the set used in a process by at least a defined edit distance; wherein each adapter comprises a nonrandom unique molecular index, wherein nonrandom unique molecular indices of the adapters have at least two different molecular lengths and form a set of variable-length, nonrandom unique molecular indices (vNRUMIs), and wherein each vNRUMI differs from every other vNRUMI in the set used in a process by at least a defined edit distance; (b) amplifying the DNA-adapter products to obtain a plurality of amplified polynucleotides; (c) sequencing the plurality of amplified polynucleotides, thereby obtaining a plurality of reads associated with the set of vNRUMIs; (d) identifying, among the plurality of reads, reads associated with a same vNRUMI, comprising: obtaining, for each read of the plurality of reads, alignment scores with respect to the set of vNRUMIs, each alignment score indicating similarity between a subsequence of a read and a vNRUMI, wherein the subsequence is in a region of the read in which nucleotides derived from the vNRUMI are likely located, selecting, for each read of the plurality of reads, at least one vNRUMI from the set of vNRUMIs based on the alignment scores, and associating each read of the plurality of reads with the at least one vNRUMI selected for the read; and obtaining, for each read of the plurality of reads, alignment scores with respect to the set of vNRUMIs, each alignment score indicating similarity between a subsequence of a read and a vNRUMI, wherein the subsequence is in a region of the read in which nucleotides derived from the vNRUMI are likely located, selecting, for each read of the plurality of reads, at least one vNRUMI from the set of vNRUMIs based on the alignment scores, and associating each read of the plurality of reads with the at least one vNRUMI selected for the read; and (e) determining a sequence of a DNA fragment in the sample using the reads associated with the same vNRUMI.