Question: Write a function called closestMatch ( geneName , allScoresD ) . Given a gene name and a dictionary of alignment scores, closestMatch returns the protein

Write a function called closestMatch(geneName,allScoresD).
Given a gene name and a dictionary of alignment scores, closestMatch returns the protein from the other species which is most similar (has the highest alignment score).
To do this you will want to look for geneName in every key in allScoresD. The following syntax will be useful:
>>>allScoresD.keys()
This returns a list of keys (here a list of tuples, since our keys are tuples).You can then search through this list for entries that have geneName in them. For this part, the following will likely be useful:
>>>T =('spam','pims')
>>>'spam' in T
True
>>>'donkey' in T
False
Here are some examples of closestMatch with the sample data:
>>>allScoresD=allScores(sampleHumanGeneList,sampleChickenGeneList)
>>>closestMatch('c19',allScoresD)
'h4'
>>>closestMatch('h17',allScoresD)
'c8'

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!