Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Implement only the global_alignment function useing the scoring method of +1 for match and -1 for mismatch and indel. print the global alignment with one

Implement only the global_alignment function useing the scoring method of +1 for match and -1 for mismatch and indel. print the global alignment with one line per string with '-' characters for indels.

import numpy as np import pandas as pd import scipy from plotnine import * def global_alignment(sequence1, sequence2): print("your code here")

def random_sequence(n): return("".join(np.random.choice(["A","C","G","T"], n)))

def mutate(s, snp_rate, indel_rate): x = [c for c in s] i = 0 while i < len(x): if np.random.random() < snp_rate: x[i] = random_sequence(1) if np.random.random() < indel_rate: length = np.random.geometric(0.5) if np.random.random() < 0.5: # insertion x[i] = x[i] + random_sequence(length) else: for j in range(i,i+length): if j < len(x): x[j] = "" i += 1 i += 1 return("".join(x))

s1 = random_sequence(100) s2 = mutate(s1, 0.1, 0.1)

# running your alignment code global_alignment(s1, s2)

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_2

Step: 3

blur-text-image_3

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 Basics Computer EngineeringInformation Warehouse Basics From Science

Authors: Odiljon Jakbarov ,Anvarkhan Majidov

1st Edition

620675183X, 978-6206751830

More Books

Students also viewed these Databases questions

Question

2. What is the business value of security and control?

Answered: 1 week ago