This paper considers the following sequence shuffling problem: Given a
biological sequence (either DNA or protein) a, generate a random inst
ance among all the permutations of s that exhibit the same frequencies
of k-lets (e.g. dinucleotides, doublets of amino acids, triplets, etc
.). Since certain biases in the usage of k-lets are fundamental to bio
logical sequences, effective generation of such sequences is essential
for the evaluation of the results of many sequence analysis tools. Th
is paper introduces two sequence shuffling algorithms: A simple swappi
ng-based algorithm is shown to generate a near-random instance and app
ears to work well, although its efficiency is unproven; a generation a
lgorithm based on Euler tours is proven to produce a precisely uniform
instance, and hence solve the sequence shuffling problem, in time not
much more than linear in the sequence length.