Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Python Language problem :: Need help with PART 2 Use Python Part 3: In this part you have to implement the similarity score and best

Python Language problem :: Need help with PART 2

image text in transcribedUse Python

Part 3: In this part you have to implement the similarity score and best match functions from Assignment 4. 1) similarity_score(...) This function should take two string parameters: seq1 and segz, and compute the similarity score by using the hamming distance. Recall: 1) the hamming distance is the number of mismatches between the characters at index i of two strings. 2) The similarity score is computed by using the following formula: lenOf seq hamming Distance lenOf seq 3) The function should only calculate the similarity score if the two strings are of the same length otherwise return a 0. sequencel = CCGCCGCCGA ||*||1*|| sequence2 = CCTECTCCTA Matches = 7, Mismatches = 3 Hamming distance = 3, Length = 10 similarity = (10 - 3) / 10 = 0.7 similarity_score("cCGCCGCCGA", "CCTCCTCCTA" ) ; >> 0.7 2) best_match(...) This function should take two string parameters, a genome and a sequence. The function will return the index i at which we find the best similarity score. To find te best match you will want to compare consecutive subsets of the genome against tl e sequence. Use similarity_score(...) to implement best_match(...)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database 101

Authors: Guy Kawasaki

1st Edition

0938151525, 978-0938151524

More Books

Students also viewed these Databases questions