The shift increment cannot exceed the window size. Numbering in the Position column is for the forward strand even if the reverse strand is chosen. We could easily modify Window to find patterns using a pattern definition syntax like that used for FindPatterns . Each observation of a pattern is stored in a logical array. After the observation array is assembled, the incidence of each pattern can be found simply by putting down the window as a mask over the array and counting the observations under the window.
Window calculates the number of observations per window in the following manner.
The product of the fractions for each symbol in the pattern times the length of the window is the expected number of observations for the pattern in the window. Four of the measurements report the difference between the actual number of observations and the expected number. The percentage measures are simply the number of observations divided by the size of the window and multiplied by 100. Fraction measures are the number of observations divided by the window size. For nucleic acid sequences, the ambiguity codes in Appendix III are searched for subset matches.