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