Learn R Programming

kmeRtone (version 1.0)

countMidPatternContext2: Locate a middle sequence pattern and count its sequence context.

Description

This function searches for a specified middle pattern within a given sequence. It then counts the occurrences of specific context patterns within a defined window size around the middle pattern. The function returns a map where keys are the counts of context patterns found and values are the frequencies of these counts.

Usage

countMidPatternContext2(sequence, mid_pattern, window, context_patterns)

Value

A std::unordered_map<int,int> where keys are the counts of context patterns found and values are the frequencies of these counts.

Arguments

sequence

A string representing the sequence to be analyzed.

mid_pattern

A string representing the middle pattern to search for within the sequence.

window

An integer specifying the size of the surrounding window around the middle pattern.

context_patterns

A vector of strings representing the context patterns to search for within the window.