# fn() calculatePeriodicity
Calculate word periodicity (indicator for overlaps)

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

## Parameters

`periodicity` | String of `int` values giving the periodicity (overlap indicator) of `word1` and `word2`.
`[` | int] word1 String, usually of Dna characters.
`[` | int] word2 String, usually of Dna characters.

## Detailed Description

Calculate word periodicity (indicator for overlaps) for two words.

### Examples

Calculate the periodicity of two words (At which positions can they overlap?)

    using namespace seqan;
    DnaString word1 = "ATATA";
    DnaString word2 = "TATAT";
    String<int> periodicity;
    calculatePeriodicity(periodicity, word1, word2);
    for(unsigned i = 0; i < length(periodicity); ++i)  // Print the periodicity
        std::cout << periodicity[i] << "\t";

    // periodocity[0] = 1:
    // i =     01234
    // word1 = ATATA
    // word2 = -TATAT

    // periodocity[1] = 3:
    // i =     01234
    // word1 = ATATA
    // word2 = ---TATAT

## Data Races

Thread safety unknown!

## See Also

- alignmentFreeComparison
- calculateCovariance
- calculateOverlapIndicator
- calculateVariance

#### Dox Sources

    /*!
     * @fn calculatePeriodicity
     *
     * @headerfile <seqan/alignment_free.h>
     *
     * @brief Calculate word periodicity (indicator for overlaps)
     *
     * @signature void calculatePeriodicity(periodicity, word1, word2);
     *
     * @param[out] periodicity String of <tt>int</tt> values giving the periodicity
     *                         (overlap indicator) of <tt>word1</tt> and
     *                         <tt>word2</tt>.
     * @param [ int] word1 String, usually of Dna characters.
     * @param [ int] word2 String, usually of Dna characters.
     *
     * Calculate word periodicity (indicator for overlaps) for two words.
     *
     * @section Examples
     *
     * Calculate the periodicity of two words (At which positions can they overlap?)
     *
     * @code{.cpp}
     * using namespace seqan;
     * DnaString word1 = "ATATA";
     * DnaString word2 = "TATAT";
     * String<int> periodicity;
     * calculatePeriodicity(periodicity, word1, word2);
     * for(unsigned i = 0; i < length(periodicity); ++i)  // Print the periodicity
     *     std::cout << periodicity[i] << "\t";
     *
     * // periodocity[0] = 1:
     * // i =     01234
     * // word1 = ATATA
     * // word2 = -TATAT
     *
     * // periodocity[1] = 3:
     * // i =     01234
     * // word1 = ATATA
     * // word2 = ---TATAT
     * @endcode
     *
     *
     * @see calculateVariance
     * @see calculateCovariance
     * @see calculateOverlapIndicator
     * @see alignmentFreeComparison
     */