A DNA strand is represented by a string of the characters A, C, G, and T, each of whichrepresents a nucleotide. The hamming distance between two DNA strands of the same length isequal to the number of positions in which they differ. Hamming distance is used inbioinformatics as a measure of the similarity of two strings. Write a DNA class that getsinitialized with a string of nucleotide characters. An instance of DNA responds to the to_s,length, and hamming_distance messages. Where a and b are DNA instances of the same length,the message send a.hamming_distance(b) returns the hamming distance between a and b:=> true>> dna1 = DNA.new('ATTGCC')=> ATTGCC>> dna1.length=> 6>> puts dna1ATTGCC>> dna2 = DNA.new('GTTGAC')=> GTTGAC>> dna1.hamming_distance(dna2)=> 2>> dna1.hamming_distance(dna1)=> 0>> dna1.hamming_distance(DNA.new('AT'))ArgumentError: dnas of different lengths from ass2.rb:17:in `hamming_distance' from (irb):8 from C:/Ruby22/bin/irb:11:in ''
Pay using PayPal (No PayPal account Required) or your credit card . All your purchases are securely protected by .
About this QuestionSTATUS
Sep 21, 2019EXPERT
We have top-notch tutors who can do your essay/homework for you at a reasonable cost and then you can simply use that essay as a template to build your own arguments.
You can also use these solutions:
- As a reference for in-depth understanding of the subject.
- As a source of ideas / reasoning for your own research (if properly referenced)
- For editing and paraphrasing (check your institution's definition of plagiarism and recommended paraphrase).
STUCK WITH YOUR PAPER?
Order New Solution. Quick Turnaround
Click on the button below in order to Order for a New, Original and High-Quality Essay Solutions. New orders are original solutions and precise to your writing instruction requirements. Place a New Order using the button below.
WE GUARANTEE, THAT YOUR PAPER WILL BE WRITTEN FROM SCRATCH AND WITHIN A DEADLINE.