Question: USE RUBY PROGRAMMING The most frequent k-mer problem seeks the set of substrings of length k (where integer k is an input) that occur most
USE RUBY PROGRAMMING
The most frequent k-mer problem seeks the set of substrings of length k (where integer k is an input) that occur most frequently. We add to the DNA class a most_frequent_kmers method that gets called with integer k and returns an array whose first element is the set of k-mers that occur most frequently in this DNA and whose second element is the number of times each one appears.
>> dna1 = DNA.new('ATTGATTCCG') => ATTGATTCCG
>> dna1.most_frequent_kmers(1) => [#
>> dna1.most_frequent_kmers(2) => [#
>> dna1.most_frequent_kmers(3) => [#
>> dna1.most_frequent_kmers(4) => [#
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
