**Date Published:** March 22, 2018

**Publisher:** BioMed Central

**Author(s):** Samuele Girotto, Matteo Comin, Cinzia Pizzi.

http://doi.org/10.1186/s13015-018-0125-4

**Abstract**

**Patterns with wildcards in specified positions, namely spaced seeds, are increasingly used instead of k-mers in many bioinformatics applications that require indexing, querying and rapid similarity search, as they can provide better sensitivity. Many of these applications require to compute the hashing of each position in the input sequences with respect to the given spaced seed, or to multiple spaced seeds. While the hashing of k-mers can be rapidly computed by exploiting the large overlap between consecutive k-mers, spaced seeds hashing is usually computed from scratch for each position in the input sequence, thus resulting in slower processing.**

The method proposed in this paper, fast spaced-seed hashing (FSH), exploits the similarity of the hash values of spaced seeds computed at adjacent positions in the input sequence. In our experiments we compute the hash for each positions of metagenomics reads from several datasets, with respect to different spaced seeds. We also propose a generalized version of the algorithm for the simultaneous computation of multiple spaced seeds hashing. In the experiments, our algorithm can compute the hashing values of spaced seeds with a speedup, with respect to the traditional approach, between 1.6documentclass[12pt]{minimal}

usepackage{amsmath}

usepackage{wasysym}

usepackage{amsfonts}

usepackage{amssymb}

usepackage{amsbsy}

usepackage{mathrsfs}

usepackage{upgreek}

setlength{oddsidemargin}{-69pt}

begin{document}$$times$$end{document}× to 5.3documentclass[12pt]{minimal}

usepackage{amsmath}

usepackage{wasysym}

usepackage{amsfonts}

usepackage{amssymb}

usepackage{amsbsy}

usepackage{mathrsfs}

usepackage{upgreek}

setlength{oddsidemargin}{-69pt}

begin{document}$$times$$end{document}×, depending on the structure of the spaced seed.

Spaced seed hashing is a routine task for several bioinformatics application. FSH allows to perform this task efficiently and raise the question of whether other hashing can be exploited to further improve the speed up. This has the potential of major impact in the field, making spaced seed applications not only accurate, but also faster and more efficient.

**The software FSH is freely available for academic use at: https://bitbucket.org/samu661/fsh/overview.**

**Partial Text**

The most frequently used tools in bioinformatics are those searching for similarities, or local alignments, between biological sequences. k-mers, i.e. words of length k, are at the basis of many sequence comparison methods, among which the most widely used and notable example is BLAST [1].

A spaced-seed S (or just a seed) is a string over the alphabet documentclass[12pt]{minimal}

usepackage{amsmath}

usepackage{wasysym}

usepackage{amsfonts}

usepackage{amssymb}

usepackage{amsbsy}

usepackage{mathrsfs}

usepackage{upgreek}

setlength{oddsidemargin}{-69pt}

begin{document}$${1,0}$$end{document}{1,0} where the 1s correspond to matching positions. The weight of a seed corresponds to the number of 1s, while the overall length, or span, is the sum of the number of 0s and 1s.

In this section we will discuss the improvement in terms of time speedup of our approach (documentclass[12pt]{minimal}

usepackage{amsmath}

usepackage{wasysym}

usepackage{amsfonts}

usepackage{amssymb}

usepackage{amsbsy}

usepackage{mathrsfs}

usepackage{upgreek}

setlength{oddsidemargin}{-69pt}

begin{document}$$T_{FSH}$$end{document}TFSH) with respect to the time documentclass[12pt]{minimal}

usepackage{amsmath}

usepackage{wasysym}

usepackage{amsfonts}

usepackage{amssymb}

usepackage{amsbsy}

usepackage{mathrsfs}

usepackage{upgreek}

setlength{oddsidemargin}{-69pt}

begin{document}$$T_{Eq1}$$end{document}TEq1 needed for computing spaced seeds hashing repeatedly using Eq. 1: documentclass[12pt]{minimal}

usepackage{amsmath}

usepackage{wasysym}

usepackage{amsfonts}

usepackage{amssymb}

usepackage{amsbsy}

usepackage{mathrsfs}

usepackage{upgreek}

setlength{oddsidemargin}{-69pt}

begin{document}$$text{ speedup } = frac{T_{Eq1}}{T_{FSH}}$$end{document}speedup=TEq1TFSH.

In this paper we tackle the problem of designing faster algorithms for the computation of spaced seed hashing. We presented a new approach, FSH, for spaced seeds hashing that exploits the information from adjacent hashes, in order to minimize the operations that need to be performed to compute the next hash. In summary, FSH can speedup spaced seed hashing on various conditions. The experiments we performed, on short NGS reads, showed that FSH has a speedup of 1.6documentclass[12pt]{minimal}

usepackage{amsmath}

usepackage{wasysym}

usepackage{amsfonts}

usepackage{amssymb}

usepackage{amsbsy}

usepackage{mathrsfs}

usepackage{upgreek}

setlength{oddsidemargin}{-69pt}

begin{document}$$times$$end{document}×, with respect to the standard approach, for several kind of spaced seeds defined in the literature. Furthermore, the gain greatly improved in special cases, where seeds show a high autocorrelation, and for which a speed up of about 4documentclass[12pt]{minimal}

usepackage{amsmath}

usepackage{wasysym}

usepackage{amsfonts}

usepackage{amssymb}

usepackage{amsbsy}

usepackage{mathrsfs}

usepackage{upgreek}

setlength{oddsidemargin}{-69pt}

begin{document}$$times$$end{document}× to 5documentclass[12pt]{minimal}

usepackage{amsmath}

usepackage{wasysym}

usepackage{amsfonts}

usepackage{amssymb}

usepackage{amsbsy}

usepackage{mathrsfs}

usepackage{upgreek}

setlength{oddsidemargin}{-69pt}

begin{document}$$times$$end{document}× can be achieved. The benefit in terms of computation time increases as the length of the reads grows, like in modern sequencing technologies, or when long and complex spaced seeds are needed.

Source:

http://doi.org/10.1186/s13015-018-0125-4