Question: please fix and solve the issue my matlab code project : % Mike _ id _ Project _ main.m : Load the DNA sequence load
please fix and solve the issue my matlab code project : MikeidProjectmain.m : Load the DNA sequence
loadchrsectmat';
dna chrsectdna;
numBases lengthdna;
Find the start and stop codons
startCodon ; ATG
stopCodons TAA 'TAG', 'TGA';
Initialize variables to store coding segments
codingSegments ;
i ;
Iterate through the DNA sequence
while i numBases
Check for start codon
if isequaldnai:i startCodon
Start codon found, now search for the stop codon
j i ;
while j numBases
if anycellfun@x isequaldnaj:j x stopCodons
Stop codon found
codingSegments codingSegments j i ;
break;
end
j j ;
end
i j ; Move index past this coding region
else
i i ; Move to the next codon
end
end
Calculate and print the statistics
totalSegments lengthcodingSegments;
averageLength meancodingSegments;
maxLength maxcodingSegments;
minLength mincodingSegments;
fprintfTotal ProteinCoding Segments: d
totalSegments;
fprintfAverage Length: f
averageLength;
fprintfMaximum Length: d
maxLength;
fprintfMinimum Length: d
minLength; Homework Prompt:
DNA Analysis.
In class, we discussed how DNA is a good example of how a huge amount of information can be stored in a vector. In this problem, you will use iteration and logical expressions to analyze a segment of human DNA stored as a D array. For the sake of programming convenience, you can find the DNA file here downarrow uses numeric values instead of the usual alphabetic abbreviations A C G and T as shown in the key below.
DNA Letter to
Number Conversion
Your task is to write a script to calculate the lengths of every proteincoding segment in the DNA as shown in the example below.
Part a
Begin by downloading the DNA segment file downarrow on Canvas into your current working directoryfolder
Next load the file into MATLAB using the load function as shown below.
file loadchrsectmat'
You can find the size of the DNA array by using the script line:
numBases lengthfiledna
Part b
Iterate through the codons the threebase segments shown above in your DNA vector until you identify the location of the start codon: ATG or after conversion After finding the start codon, continue iterating until reaching the first stop codon: either TAA, TAG, or TGA. Record the length of this proteincoding segment in a new array and begin looking for the next start codon. We will ignore any new start codons that may appear before we first encounter one of the stop codons.
Note: Remember, it is only meaningful to compare intact codons sets of three starting from the first element in our vector we will assume this is the only biologically correct reading dna: and dna: are valid groupings; while dna: which splits up two codons, is not valid.
Part c
After reaching the end of the DNA vector, print the following statistics to the command window in the format shown below the values shown are for illustration only
Total ProteinCoding Segments:
Average Length:
Maximum Length:
Minimum Length:
You are welcome to use builtin MATLAB functions mean, max, and min if you find them helpful. As with all things programming, it is much easier to start with a small test case where you know the answer first. Try creating your own DNA vector with the numbers in the above example and confirm that you recover the correct answer before using the full sequence stored in chr sectmat downarrow
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
