Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

-The DNA that exists in living cells is a code that describe basic structures that are built by cellular machines. It is known that a

-The DNA that exists in living cells is a code that describe basic structures that are built by cellular machines. It is known that a sequence of DNA consists of just four nucleic acids, namely: guanine (referred to as G), adenine (A), thymine (T), and cytosine (C). The human genome consists of a sequence of roughly three billion such nucleic acids. Several years ago, scientists were able to determine the sequence (AGGTCGATT etc.) of an entire human genome. To do that, part of the process was to match smaller sequences to larger sequences to see where they fit. Subsequent to that, scientists have looked for patterns and relationships between different parts of the sequence, and between historical sequences and present-day sequences of plants and animals. A core algorithm at the root of all of this is searching for a smaller sequence within a larger one, and finding all places that match, either approximately or exactly. One way that approximate matches are found is by allowing some elements of the search sequence to match any of the four possible nucleic acids. If an element of the sequence being searched for that has that property, it is called a wildcard (from the notion of wild cards in cardplaying games). You are to write a program that searches through an array that contains a sequence of characters. These characters are restricted to be the letters A, G, T, and C The last character in the sequence is set to be the code 0, which is thus easy to detect. That array should be declared and initialized exactly as follows in your program (a vector of only one row and many columns; search in the web how to use in Matlab the function strfind):

DNA = [A, G, C, G, G, G, A, C, C, G, T, C, ...

C, C, G, A, C, A, T, T, G, A, T, G, ...

A, A, G, G, G, T, C, A, T, A, G, A, ...

C, C, C, A, A, T, A, C, G, C, C, A, ...

C, C, A, C, C, C, C, A, A, G, T, T, ...

T, T, C, C, T, G, T, G, T, C, T, T, ...

C, C, A, T, T, G, A, G, T, A, G, A, ...

T, T, G, A, C, A, C, T, C, C, C, A, ...

G, A, T, G, 0];

Your program should repeatedly ask the user for two things:

1. the length of a search sequence, and

2. the search sequence itself.

The program should then search through the entire array DNA to find the starting element subscript (index) of all matching sequences. The elements of the search sequence may take on one of five characters: A, G, T, C and *. The meaning of the * character is that of wild card - that is, it matches all four nucleotides: A, G, T,and C. The program should terminate when the length of the input sequence is zero or less. If the input search sequence contains a character other than A, G, T,C or *, the program should report that as an error and terminate, as shown in the examples below. You should only report the first character that has an error (and exit), there no need to check if there are more characters that are wrong. In the sample output examples that follow, the user input appears after the colon character (:) and is followed by the enter key. Note that there is a single space after the colon (:) in each output line.

MATLAB CODE

image text in transcribed

image text in transcribed

image text in transcribed

the screenshots are how the outputs should be modeled

Run 1 Enter length of DNA sequence to match: 4 Enter 4 characters (one of AGTC*) as a search sequence: CGGG Match of search sequence found at element 2 Enter length of DNA sequence to match: 3 Enter 3 characters (one of AGTC*) as a search sequence: GAC Match of search sequence found at element 5 Match of search sequence found at element 14 Match of search sequence found at element 34 Match of search sequence found at element 86 Enter length of DNA sequence to match: -1 Goodbye Run 2

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 Administrator Make A Difference

Authors: Mohciine Elmourabit

1st Edition

B0CGM7XG75, 978-1722657802

More Books

Students also viewed these Databases questions

Question

1. Where do these biases come from?

Answered: 1 week ago

Question

7. What decisions would you make as the city manager?

Answered: 1 week ago