# fn() calculateOverlapIndicator
Calculate word overlaps: `epsilon(word1, word2) = 1` where `word2[j] = word1[j+p] for all j = 1..(k-p)`.

Defined in | <seqan/alignment_free.h>
Signature | `void calculateOverlapIndicator(epsilon, word1, word2);`

## Parameters

`epsilon` | String of int giving the periodicity (overlap indicator) of word1 and word2.
`word1` | String (for example a DNA sequence).
`word2` | String (for example a DNA sequence).

## Detailed Description

Calculate the indicator for overlaps of two words. The formula is based on (Robin et al., 2005)

### References

Robin, S., Rodolphe, F., and Schbath, S. (2005). DNA, Words and Models. Cambridge University Press. See Jonathan Goeke et al (to appear) for details on the implementation.

### Examples

Calculate the overlap indicator (epsilon) for two words

    using namespace seqan;
    DnaString word1 = "ATATA";
    DnaString word2 = "TATAT";
    String<int> epsilon;
    calculateOverlapIndicator(epsilon, word1, word2);
    for(unsigned i = 0; i < length(epsilon); ++i)
        std::cout << epsilon[i] << "\t";
    // epsilon =         01010:
    // word1             ATATA
    // word2 overlap 1:  -TATAT
    // word2 overlap 2:  ---TATAT

## Data Races

If not stated otherwise, concurrent invocation is not guaranteed to be thread-safe.

## See Also

- alignmentFreeComparison
- calculateCovariance
- calculatePeriodicity
- calculateVariance

#### Dox Sources

    /*!
     * @fn calculateOverlapIndicator
     *
     * @headerfile <seqan/alignment_free.h>
     *
     * @brief Calculate word overlaps: <tt>epsilon(word1, word2) = 1</tt> where
     *        <tt>word2[j] = word1[j+p] for all j = 1..(k-p)</tt>.
     *
     * @signature void calculateOverlapIndicator(epsilon, word1, word2);
     *
     * @param[out] epsilon String of int giving the periodicity (overlap indicator)
     *                     of word1 and word2.
     * @param[in] word1 String (for example a DNA sequence).
     * @param[in] word2 String (for example a DNA sequence).
     *
     * Calculate the indicator for overlaps of two words. The formula is based on
     * (Robin et al., 2005)
     *
     * @section References
     *
     * Robin, S., Rodolphe, F., and Schbath, S. (2005). DNA, Words and Models.
     * Cambridge University Press. See Jonathan Goeke et al (to appear) for details
     * on the implementation.
     *
     * @section Examples
     *
     * Calculate the overlap indicator (epsilon) for two words
     *
     * @code{.cpp}
     * using namespace seqan;
     * DnaString word1 = "ATATA";
     * DnaString word2 = "TATAT";
     * String<int> epsilon;
     * calculateOverlapIndicator(epsilon, word1, word2);
     * for(unsigned i = 0; i < length(epsilon); ++i)
     *     std::cout << epsilon[i] << "\t";
     * // epsilon =         01010:
     * // word1             ATATA
     * // word2 overlap 1:  -TATAT
     * // word2 overlap 2:  ---TATAT
     * @endcode
     *
     *
     * @see calculateVariance
     * @see calculateCovariance
     * @see calculatePeriodicity
     * @see alignmentFreeComparison
     */