Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- %% DNA to Amino Acids
- % converts a DNA strand to amino acids
- A = {'A' 'T'
- 'C' 'G'
- 'G' 'C'
- 'T' 'A'};
- seq_file = fopen('KIF11.txt');
- template3_5 = fscanf(seq_file,'%s');
- seq_len = length(template3_5);
- synth3_5 = [];
- for i = 1:seq_len
- template_base = template3_5(i);
- row_A = strcmp(template_base,A(:,2));
- synth_base = A(row_A);
- synth_base = char(synth_base);
- synth3_5(i) = (synth_base);
- end
- synth3_5 = char(synth3_5);
- B = {'A' 'U'
- 'C' 'G'
- 'G' 'C'
- 'T' 'A'};
- RNA5_3 = [];
- for i = 1:seq_len
- DNA_base = synth3_5(i);
- row_B = strcmp(DNA_base,B(:,1));
- RNA_base = B(row_B,2);
- RNA_base = char(RNA_base);
- RNA5_3(i) = (RNA_base);
- end
- RNA5_3 = char(RNA5_3);
- C = {'UUU' 'F'
- 'UUC' 'F'
- 'UUA' 'L'
- 'UUG' 'L'
- 'CUU' 'L'
- 'CUC' 'L'
- 'CUA' 'L'
- 'CUG' 'L'
- 'AUU' 'I'
- 'AUC' 'I'
- 'AUA' 'I'
- 'AUG' 'M'
- 'GUU' 'V'
- 'GUC' 'V'
- 'GUA' 'V'
- 'GUG' 'V'
- 'UCU' 'S'
- 'UCC' 'S'
- 'UCA' 'S'
- 'UCG' 'S'
- 'CCU' 'P'
- 'CCC' 'P'
- 'CCA' 'P'
- 'CCG' 'P'
- 'ACU' 'T'
- 'ACC' 'T'
- 'ACA' 'T'
- 'ACG' 'T'
- 'GCU' 'A'
- 'GCC' 'A'
- 'GCA' 'A'
- 'GCG' 'A'
- 'UAU' 'Y'
- 'UAC' 'Y'
- 'UAA' '*'
- 'UAG' '*'
- 'CAU' 'H'
- 'CAC' 'H'
- 'CAA' 'Q'
- 'CAG' 'Q'
- 'AAU' 'N'
- 'AAC' 'N'
- 'AAA' 'K'
- 'AAG' 'K'
- 'GAU' 'D'
- 'GAC' 'D'
- 'GAA' 'E'
- 'GAG' 'E'
- 'UGU' 'C'
- 'UGC' 'C'
- 'UGA' '*'
- 'UGG' 'W'
- 'CGU' 'R'
- 'CGC' 'R'
- 'CGA' 'R'
- 'CGG' 'R'
- 'AGU' 'S'
- 'AGC' 'S'
- 'AGA' 'R'
- 'AGG' 'R'
- 'GGU' 'G'
- 'GGA' 'G'
- 'GGC' 'G'
- 'GGG' 'G'};
- ORF = RNA5_3(155:3358);
- AA_seq = NaN;
- AA_pos = 1;
- ORF_pos = 1:3;
- while ~strcmp(char(AA_seq(end)),'*')
- codon = ORF(ORF_pos);
- row_C = strcmp(codon,C(:,1));
- AA = C(row_C,2);
- AA = char(AA);
- AA_seq(AA_pos) = AA;
- AA_pos = AA_pos + 1;
- ORF_pos = ORF_pos + 3;
- end
- %{
- I guess this code can be used for others. I really just put this here for me
- so I wouldn't lose it when I have to get a new computer :(
- To edit the text file being scanned edit line 8
- The code will transcribe the whole DNA strand but will only translate the
- DNA strand at the start codon. The range of bases are in line 97.
- There is probably some code that will determine the start sequence
- but I am not putting that in here.
- %}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement