powered by
This function counts the frequency of a specific character or pattern in a given sequence.
count_seq_pattern(seq, pattern)
An integer representing the count of the pattern in the sequence.
A character vector representing the sequence to count the pattern in.
A character string representing the pattern to count in the sequence.
seq <- "ATGGTGCTCCGTGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCTACGTAG" count_seq_pattern(seq, "CG") # [1] 31
Run the code above in your browser using DataLab