When comparing two sequences by means of a dot plot, the seqinr package provides the dotPlot() function, that compares two sequences by marking with a black dot whenever there is a match between the two sequences.
With the dotPlot() function, a sliding window of a desired size can be used to compare regions of the sequences (wsize argument) thus reducing the 'noise' that a single nucleotide or aminoacid match produces. The nmatch argument is the threshold of the number of matches between sequences within a window to consider a match between windows of the two compared sequences. I understand a match as identical nucleotides or aminoacids in both sequences. However, I don't understand whether the matches have to be consecutive within the window to be considered above a certain nmatch threshold, thus a valid window match.
As I understand it in the seqinr dotPlot() documentation, it does not require the matches within a window to be consecutive in order to sum up to the set threshold, however, I cannot find a clear and explicit confirmation that this is the way the function works.
Example
Considering these two sequences:
seq1: MSKDLVHPSL
seq2: MSKIFVNPSA
By applying the dopPlot() function with window size set to 4 and match threshold set to 2:
dotPlot(seq1,seq2,wsize=4,nmatch=2)
When considering the following window (starting at position 3):
KDLV
KIFV
Will this window be considered a match? There are 2 matches (equal or above threshold) but these are not consecutive (K-K at position 3 and V-V at position 6) as the window contains mismatches between them (DL - IF).