Learn R Programming

kmeRtone (version 1.0)

countMidPatternKmers: Count Relevant K-mers with Specified Middle Pattern from Sequence String(s)

Description

This function scans through each sequence in the provided vector, locating a specified middle pattern. For each occurrence of the middle pattern, the function extracts and counts the surrounding k-mers. The k-mers are identified based on the given k-mer size and centered around the middle pattern.

Usage

countMidPatternKmers(sequences, k, mid_pattern)

Value

A std::unordered_map with k-mers as keys and their counts as values.

Arguments

sequences

A vector of strings, each representing a sequence to be analyzed.

k

An integer specifying the size of the k-mers to be extracted and counted.

mid_pattern

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