English

Optimal Computation of Avoided Words

Data Structures and Algorithms 2016-05-02 v1

Abstract

The deviation of the observed frequency of a word ww from its expected frequency in a given sequence xx is used to determine whether or not the word is avoided. This concept is particularly useful in DNA linguistic analysis. The value of the standard deviation of ww, denoted by std(w)std(w), effectively characterises the extent of a word by its edge contrast in the context in which it occurs. A word ww of length k>2k>2 is a ρ\rho-avoided word in xx if std(w)ρstd(w) \leq \rho, for a given threshold ρ<0\rho < 0. Notice that such a word may be completely absent from xx. Hence computing all such words na\"{\i}vely can be a very time-consuming procedure, in particular for large kk. In this article, we propose an O(n)O(n)-time and O(n)O(n)-space algorithm to compute all ρ\rho-avoided words of length kk in a given sequence xx of length nn over a fixed-sized alphabet. We also present a time-optimal O(σn)O(\sigma n)-time and O(σn)O(\sigma n)-space algorithm to compute all ρ\rho-avoided words (of any length) in a sequence of length nn over an alphabet of size σ\sigma. Furthermore, we provide a tight asymptotic upper bound for the number of ρ\rho-avoided words and the expected length of the longest one. We make available an open-source implementation of our algorithm. Experimental results, using both real and synthetic data, show the efficiency of our implementation.

Keywords

Cite

@article{arxiv.1604.08760,
  title  = {Optimal Computation of Avoided Words},
  author = {Yannis Almirantis and Panagiotis Charalampopoulos and Jia Gao and Costas S. Iliopoulos and Manal Mohamed and Solon P. Pissis and Dimitris Polychronopoulos},
  journal= {arXiv preprint arXiv:1604.08760},
  year   = {2016}
}
R2 v1 2026-06-22T13:44:24.599Z