p4protein - % paa{n} = [ ] ; for f=1:3:length(prna{n})...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
% Script P4protein.m % Translate given protein DNA sequences to amino acid sequences. % Construct a structure array of the given proteins. % load p4data l % aa - Short names (single character) of amino acides (character vector) % pname - protein names (1-d cell array of strings) % pdna - protein dna sequence (1-d cell array of strings) % Note pname{p} and pdna{p} correspond to the same protein % %%%%%%%%%%%%%%%%%%%%%%%%% % My Code - Added Below % %%%%%%%%%%%%%%%%%%%%%%%%% % % Create the 64-by-3 character matrix of codons (reference fcn. allCodons) % codon = allCodons; c % For each protein p given in cell array pname (and pdna) % prna = cell(1,5); %initialize RNA cell p paa = cell(1,5); %initialize amino acid cell p for n=1:5 %iterate through proteins 1-5: everything in this loop % Transcribe from pdna{p} to prna{p} for o=1:length(pdna{n}) if strcmp(pdna{n}(o),'T') %dna letter is T, so make Rna letter U prna{n}(o) = 'U'; else prna{n}(o) = pdna{n}(o); %dna letter not T, make Rna letter Dna letter end end % Translate from prna{p} to paa{p}
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
Background image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: % paa{n} = [ ] ; for f=1:3:length(prna{n}) %iterate through every group of 3 codonvariable = prna{n}(f:f+2); %store group of 3 codons in codonvariable rownumber = findRow(codonvariable,codon); %find row# where this codon occurs o itsAminoLetter = aa(rownumber); paa{n} = [paa{n} itsAminoLetter]; end % Make a record (structure} from the data of protein p % possiblePairs = {'TT' 'TC' 'TA' 'TG'; 'CT' 'CC' 'CA' 'CG'; 'AT' 'AC' 'AA' 'AG'; 'GT' 'GC' 'GA' 'GG'}; frequencyMatrix=zeros(4,4); for x=1:length(pdna{n})-1 for r=1:4 for t=1:4 % dna two codons match one of the possible pairs if strcmp(pdna{n}(x:x+1),possiblePairs{r,t}) % increment corresponding position of frequencyMatrix frequencyMatrix(r,t) = frequencyMatrix(r,t)+1; end end end end %Create 'nth' element of the array called protein; the array is a %structure array which holds information about the protein protein(n) = MakeProtein(pname(n),paa(n),prna(n),pdna(n),frequencyMatrix); end e e...
View Full Document

Page1 / 3

p4protein - % paa{n} = [ ] ; for f=1:3:length(prna{n})...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online