Question

In: Computer Science

Complete a) flowchart solution and b) working Python solution. It will need to compare gene sequences,...

Complete a) flowchart solution and b) working Python solution. It will need to compare gene sequences, looking for differences (mutations), keeping track of how many are different and will include clear two-part output: indicating if the ‘baby’ has the mutation for diabetes or not, and the identity between the siblings’ sequences.

BABY:

ATGGCCCTGTGGATGCGCCTCCTGCCCCTGCTGGCGCTGCTGGCCCTCTGGGGACCTGACCCAGCCGCAGCCTTTGTGAACCAACACCTGTGCGGCTCACACCTGGTGGAAGCTCTCTACCTAGTGTGCGGGGAACGAGGCTTCTTCTACACACCCAAGACCTGCCGGGAGGCAGAGGACCTGCAGGTGGGGCAGGTGGAGCTGGGCGGGGGCCCTGGTGCAGGCAGCCTGCAGCCCTTGGCCCTGGAGGGGTCCCTGCAGAAGCGTGGCATTGTGGAACAATGCTGTACCAGCATCTGCTCCCTCTACCAGCTGGAGAACTACTGCAACTAG

BROTHER:

ATGGCCCTGTGGATGCGCCTCCTGCCCCTGCTGGCGCTGCTGGCCCTCTGGGGACCTGACCCAGCCGCAGCCTTTGTGAACCAACACCTGTGCGGCTCACACCTGGTGGAAGCTCTCTACCTAGTGTGCGGGGAACGAGGCTTCTTCTACACACCCAAGACCCGCCGGGAGGCAGAGGACCTGCAGGTGGGGCAGGTGGAGCTGGGCGGGGGCCCTGGTGCAGGCAGCCTGCAGCCCTTGGCCCTGGAGGGGTCCCTGCAGAAGCGTGGCATTGTGGAACAATGCTGTACCAGCATCTGCTCCCTCTACCAGCTGGAGAACTACTGCAACTAG

Does the ‘baby’ carry the mutation associated with diabetes?
Which (what number) nucleotide has mutated?
What is the ‘identity” of the siblings’ sequences? In other words, find the percentage, to one decimal place, describing how similar those two are.

--------------------------------------------------

So far I have this:

def find_mutation_location(nuc1, nuc2):
n = len(nuc1)
for i in range(0,n,3):
if nuc1[i:i+3] != nuc2[i:i+3]:
return (i+1)//3
  
n1 = "ATGGCCCTGTGGATGCGCCTCCTGCCCCTGCTGGCGCTGCTGGCCCTCTGGGGACCTGACCCAGCCGCAGCCTTTGTGAACCAACACCTGTGCGGCTCACACCTGGTGGAAGCTCTCTACCTAGTGTGCGGGGAACGAGGCTTCTTCTACACACCCAAGACCTGCCGGGAGGCAGAGGACCTGCAGGTGGGGCAGGTGGAGCTGGGCGGGGGCCCTGGTGCAGGCAGCCTGCAGCCCTTGGCCCTGGAGGGGTCCCTGCAGAAGCGTGGCATTGTGGAACAATGCTGTACCAGCATCTGCTCCCTCTACCAGCTGGAGAACTACTGCAACTAG"
n2 = "ATGGCCCTGTGGATGCGCCTCCTGCCCCTGCTGGCGCTGCTGGCCCTCTGGGGACCTGACCCAGCCGCAGCCTTTGTGAACCAACACCTGTGCGGCTCACACCTGGTGGAAGCTCTCTACCTAGTGTGCGGGGAACGAGGCTTCTTCTACACACCCAAGACCCGCCGGGAGGCAGAGGACCTGCAGGTGGGGCAGGTGGAGCTGGGCGGGGGCCCTGGTGCAGGCAGCCTGCAGCCCTTGGCCCTGGAGGGGTCCCTGCAGAAGCGTGGCATTGTGGAACAATGCTGTACCAGCATCTGCTCCCTCTACCAGCTGGAGAACTACTGCAACTAG"
print(find_mutation_location(n1,n2))

def calculate_similarity(nuc1, nuc2):
n = len(nuc1) // 3
different = 0
for i in range(0,n,3):
if nuc1[i:i+3] != nuc2[i:i+3]:
different += 1
print(calculate_similarity(n1,n2))

I seem to have been able to locate the mutation at nucleotide number 54, but am having issues with calculating the similarity to a percentage/1 decimal point. Please advise, and also provide working flow-chart solution if possible. Thanks!

Solutions

Expert Solution

Many changes are done in code.

CODE:

def find_mutation_location(nuc1, nuc2):

n = len(nuc1)

pos=[] # position list to store all mutation

for i in range(0,n,3):

if nuc1[i:i+3] != nuc2[i:i+3]:

pos.append((i+1)//3) # adding the position in the list

return pos # returning list

n1 = "ATGGCCCTGTGGATGCGCCTCCTGCCCCTGCTGGCGCTGCTGGCCCTCTGGGGACCTGACCCAGCCGCAGCCTTTGTGAACCAACACCTGTGCGGCTCACACCTGGTGGAAGCTCTCTACCTAGTGTGCGGGGAACGAGGCTTCTTCTACACACCCAAGACCTGCCGGGAGGCAGAGGACCTGCAGGTGGGGCAGGTGGAGCTGGGCGGGGGCCCTGGTGCAGGCAGCCTGCAGCCCTTGGCCCTGGAGGGGTCCCTGCAGAAGCGTGGCATTGTGGAACAATGCTGTACCAGCATCTGCTCCCTCTACCAGCTGGAGAACTACTGCAACTAG"

n2 = "ATGGCCCTGTGGATGCGCCTCCTGCCCCTGCTGGCGCTGCTGGCCCTCTGGGGACCTGACCCAGCCGCAGCCTTTGTGAACCAACACCTGTGCGGCTCACACCTGGTGGAAGCTCTCTACCTAGTGTGCGGGGAACGAGGCTTCTTCTACACACCCAAGACCCGCCGGGAGGCAGAGGACCTGCAGGTGGGGCAGGTGGAGCTGGGCGGGGGCCCTGGTGCAGGCAGCCTGCAGCCCTTGGCCCTGGAGGGGTCCCTGCAGAAGCGTGGCATTGTGGAACAATGCTGTACCAGCATCTGCTCCCTCTACCAGCTGGAGAACTACTGCAACTAG"

print(*(find_mutation_location(n1,n2))) # * is use to print items in list in a string

def calculate_similarity(nuc1, nuc2):

n = len(nuc1) # calculating DNA length

total =0 # total gene set

similar =0 # similar gene set

for i in range(0,n,3):

total = total +1 # adding 1 in total every time loop is executed

if nuc1[i:i+3] == nuc2[i:i+3]: # if similar gene set

similar = similar +1 # add 1 to number of similar gene set

return similar/total*100 # returning percentage

print("{:.1f}%".format(calculate_similarity(n1,n2))) # .format is use to print percentage upto 1 decimal place

Go through screentshot for indentation.

OUTPUT:

FLOWCHART:


Related Solutions

I need a python program and a flowchart please!! Problem #1:    How much should I...
I need a python program and a flowchart please!! Problem #1:    How much should I study outside of class?                         Issue: Your fellow students need help. This is their first year in college and they need to determine how many hours they need to study to get good grades. Study Hours Per Week Per Class                    Grade 15                                                           A 12                                                           B 9                                                             C 6                                                             D 0                                                             F Project Specifications: The user enters their full name and the number of...
Need a python code for LU factorization( for partial pivoting and complete pivoting) of a random...
Need a python code for LU factorization( for partial pivoting and complete pivoting) of a random matrix size 5x5.
Use the Python programming language to complete below (I need the New Answer for this, and...
Use the Python programming language to complete below (I need the New Answer for this, and please provide the screenshot of the source code. Thank you!): A website requests an user to input his account password. Write a program to examize the validity of the password. The valid password must consists of: At least 1 letter in [a-z] At least 1 number in [0-9] At least a letter in [A-Z] (capital) At least one special letter in [$#@] At least...
Use the Python programming language to complete below (I need the New Answer for this, and...
Use the Python programming language to complete below (I need the New Answer for this, and please provide the screenshot of the source code. Thank you!): Write a function to seek for all even numbers and odd numbers in the middle of two number A and B. Print even and odd numbers in 1 and 2020 (including both these two numbers)
Need to know a and b A. compare in detail, the components of cardiac muscle with...
Need to know a and b A. compare in detail, the components of cardiac muscle with that of smooth muscle. B. why should many of these types of muscles be involuntary?
need to know a, b, and c A. compare the structures and physiology of the sense...
need to know a, b, and c A. compare the structures and physiology of the sense of hearing and balance with thise of the sense of vision. maks sure to describe ALL the vital structures of each system. B. explain in detail the physiological process of hearing and balance. C explain the process of vision.
In Python, gonna need this ASAP: Complete the draw_pattern(a_canvas, colours_dictionary, pattern_list, size, left, top) function. This...
In Python, gonna need this ASAP: Complete the draw_pattern(a_canvas, colours_dictionary, pattern_list, size, left, top) function. This function is passed SIX parameters: the Canvas object, a colours dictionary, a list of String elements, and followed by three integer parameters. The function draws a grid of coloured rectangles inside the canvas area. The left-top position of the grid of coloured rectangles is given by the last two parameter values and the size of each rectangle is given by the size parameter. Once...
Need to know answers for both a and b A. compare and contrast endochondral ossification with...
Need to know answers for both a and b A. compare and contrast endochondral ossification with intramembranous ossification? B. what roles do osteoblasts, osteoclasts and osteocytes play in endochondral bone formation and in bone remodeling and bone fracture? (describe bone remodeling and bone fractures)
I need direct answer just to compare with my solution Thanks ================================ A partial listing of...
I need direct answer just to compare with my solution Thanks ================================ A partial listing of costs incurred during March at Febbo Corporation appears below: Factory supplies $ 9,000 Administrative wages and salaries $ 85,000 Direct materials $ 126,000 Sales staff salaries $ 30,000 Factory depreciation $ 33,000 Corporate headquarters building rent $ 43,000 Indirect labor $ 26,000 Marketing $ 65,000 Direct labor $ 99,000 The total of the period costs listed above for March is: ===================================== A partial listing...
need to know a,b,c,d A. describe and compare the major structural features of the male and...
need to know a,b,c,d A. describe and compare the major structural features of the male and female reproductive systems. B. why should mem produce between 100 and 300 million sperm a fay when women produce just one haploid egg a month? Hypothesize as to the reason for the differences in the mode of reproduction between men and women. C. compare the function of GnRH, LH, FSH in males and females. are they similar functions? if so, explain why. D. considerinf...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT