Question Details

[solution] »

A DNA strand is represented by a string of the characters A, C, G, and T, each of whichrepresents


Description

Answer Download


The Question

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 ''

 


Solution details

Solution #00070064

[solution] »

A DNA strand is represented by a string of the characters A, C, G, and T, each of whichrepresents.zip

Uploaded by: Tutor

Answer rating:

This paper was answered on 21-Sep-2019

Pay using PayPal (No PayPal account Required) or your credit card . All your purchases are securely protected by .

About this Question

STATUS

Answered

QUALITY

Approved

DATE ANSWERED

Sep 21, 2019

EXPERT

Tutor

ANSWER RATING

BEST TUTORS

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).
This we believe is a better way of understanding a problem and makes use of the efficiency of time of the student.

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.

Order Now