Open main menu

Biolecture.org β

Perl Code of AKT1

Revision as of 21:40, 26 May 2016 by imported>위민우 (Created page with "<p>#!/usr/bin/perl<br /> # Translate DNA into protein</p> <p>my $dna = 'ATGAGCGACGTGGCTATTGTGAAGGAGGGTTGGCTGCACAAACGAGGGGAGTACATCAAGACCTGGCGGCCACGCTACTTCCTCCTCAAGAATGATGGCAC...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

#!/usr/bin/perl

  1. Translate DNA into protein

my $dna = 'ATGAGCGACGTGGCTATTGTGAAGGAGGGTTGGCTGCACAAACGAGGGGAGTACATCAAGACCTGGCGGCCACGCTACTTCCTCCTCAAGAATGATGGCACCTTCATTGGCTACAAGGAGCGGCCGCAGGATGTGGACCAACGTGAGGCTCCCCTCAACAACTTCTCTGTGGCGCAGTGCCAGCTGATGAAGACGGAGCGGCCCCGGCCCAACACCTTCATCATCCGCTGCCTGCAGTGGACCACTGTCATCGAACGCACCTTCCATGTGGAGACTCCTGAGGAGCGGGAGGAGTGGACAACCGCCATCCAGACTGTGGCTGACGGCCTCAAGAAGCAGGAGGAGGAGGAGATGGACTTCCGGTCGGGCTCACCCAGTGACAACTCAGGGGCTGAAGAGATGGAGGTGTCCCTGGCCAAGCCCAAGCACCGCGTGACCATGAACGAGTTTGAGTACCTGAAGCTGCTGGGCAAGGGCACTTTCGGCAAGGTGATCCTGGTGAAGGAGAAGGCCACAGGCCGCTACTACGCCATGAAGATCCTCAAGAAGGAAGTCATCGTGGCCAAGGACGAGGTGGCCCACACACTCACCGAGAACCGCGTCCTGCAGAACTCCAGGCACCCCTTCCTCACAGCCCTGAAGTACTCTTTCCAGACCCACGACCGCCTCTGCTTTGTCATGGAGTACGCCAACGGGGGCGAGCTGTTCTTCCACCTGTCCCGGGAACGTGTGTTCTCCGAGGACCGGGCCCGCTTCTATGGCGCTGAGATTGTGTCAGCCCTGGACTACCTGCACTCGGAGAAGAACGTGGTGTACCGGGACCTCAAGCTGGAGAACCTCATGCTGGACAAGGACGGGCACATTAAGATCACAGACTTCGGGCTGTGCAAGGAGGGGATCAAGGACGGTGCCACCATGAAGACCTTTTGCGGCACACCTGAGTACCTGGCCCCCGAGGTGCTGGAGGACAATGACTACGGCCGTGCAGTGGACTGGTGGGGGCTGGGCGTGGTCATGTACGAGATGATGTGCGGTCGCCTGCCCTTCTACAACCAGGACCATGAGAAGCTTTTTGAGCTCATCCTCATGGAGGAGATCCGCTTCCCGCGCACGCTTGGTCCCGAGGCCAAGTCCTTGCTTTCAGGGCTGCTCAAGAAGGACCCCAAGCAGAGGCTTGGCGGGGGCTCCGAGGACGCCAAGGAGATCATGCAGCATCGCTTCTTTGCCGGTATCGTGTGGCAGCACGTGTACGAGAAGAAGCTCAGCCCACCCTTCAAGCCCCAGGTCACGTCGGAGACTGACACCAGGTATTTTGATGAGGAGTTCACGGCCCAGATGATCACCATCACACCACCTGACCAAGATGACAGCATGGAGTGTGTGGACAGCGAGCGCAGGCCCCACTTCCCCCAGTTCTCCTACTCGGCCAGCAGCACGGCCTGA';
my $protein = '';
my $codon;

 sub Codon_table {
     my($codon) = @_;
        if( $codon =~ /TCA/i ){ return 'S' }
     elsif( $codon =~ /TCC/i ){ return 'S' }
     elsif( $codon =~ /TCG/i ){ return 'S' }
     elsif( $codon =~ /TCT/i ){ return 'S' }
     elsif( $codon =~ /TTC/i ){ return 'F' }
     elsif( $codon =~ /TTT/i ){ return 'F' }
     elsif( $codon =~ /TTA/i ){ return 'L' }
     elsif( $codon =~ /TTG/i ){ return 'L' }
     elsif( $codon =~ /TAC/i ){ return 'Y' }
     elsif( $codon =~ /TAT/i ){ return 'Y' }
     elsif( $codon =~ /TAA/i ){ return '*' }
     elsif( $codon =~ /TAG/i ){ return '*' }
     elsif( $codon =~ /TGC/i ){ return 'C' }
     elsif( $codon =~ /TGT/i ){ return 'C' }
     elsif( $codon =~ /TGA/i ){ return '*' }
     elsif( $codon =~ /TGG/i ){ return 'W' }
     elsif( $codon =~ /CTA/i ){ return 'L' }
     elsif( $codon =~ /CTC/i ){ return 'L' }
     elsif( $codon =~ /CTG/i ){ return 'L' }
     elsif( $codon =~ /CTT/i ){ return 'L' }
     elsif( $codon =~ /CCA/i ){ return 'P' }
     elsif( $codon =~ /CCC/i ){ return 'P' }
     elsif( $codon =~ /CCG/i ){ return 'P' }
     elsif( $codon =~ /CCT/i ){ return 'P' }
     elsif( $codon =~ /CAC/i ){ return 'H' }
     elsif( $codon =~ /CAT/i ){ return 'H' }
     elsif( $codon =~ /CAA/i ){ return 'Q' }
     elsif( $codon =~ /CAG/i ){ return 'Q' }
     elsif( $codon =~ /CGA/i ){ return 'R' }
     elsif( $codon =~ /CGC/i ){ return 'R' }
     elsif( $codon =~ /CGG/i ){ return 'R' }
     elsif( $codon =~ /CGT/i ){ return 'R' }
     elsif( $codon =~ /ATA/i ){ return 'I' }
     elsif( $codon =~ /ATC/i ){ return 'I' }
     elsif( $codon =~ /ATT/i ){ return 'I' }
     elsif( $codon =~ /ATG/i ){ return 'M' }
     elsif( $codon =~ /ACA/i ){ return 'T' }
     elsif( $codon =~ /ACC/i ){ return 'T' }
     elsif( $codon =~ /ACG/i ){ return 'T' }
     elsif( $codon =~ /ACT/i ){ return 'T' }
     elsif( $codon =~ /AAC/i ){ return 'N' }
     elsif( $codon =~ /AAT/i ){ return 'N' }
     elsif( $codon =~ /AAA/i ){ return 'K' }
     elsif( $codon =~ /AAG/i ){ return 'K' }
     elsif( $codon =~ /AGC/i ){ return 'S' }
     elsif( $codon =~ /AGT/i ){ return 'S' }
     elsif( $codon =~ /AGA/i ){ return 'R' }
     elsif( $codon =~ /AGG/i ){ return 'R' }
     elsif( $codon =~ /GTA/i ){ return 'V' }
     elsif( $codon =~ /GTC/i ){ return 'V' }
     elsif( $codon =~ /GTG/i ){ return 'V' }
     elsif( $codon =~ /GTT/i ){ return 'V' }
     elsif( $codon =~ /GCA/i ){ return 'A' }
     elsif( $codon =~ /GCC/i ){ return 'A' }
     elsif( $codon =~ /GCG/i ){ return 'A' }
     elsif( $codon =~ /GCT/i ){ return 'A' }
     elsif( $codon =~ /GAC/i ){ return 'D' }
     elsif( $codon =~ /GAT/i ){ return 'D' }
     elsif( $codon =~ /GAA/i ){ return 'E' }
     elsif( $codon =~ /GAG/i ){ return 'E' }
     elsif( $codon =~ /GGA/i ){ return 'G' }
     elsif( $codon =~ /GGC/i ){ return 'G' }
     elsif( $codon =~ /GGG/i ){ return 'G' }
     elsif( $codon =~ /GGT/i ){ return 'G' }
     else{print STDERR "Wrong!!\nPlease check your sequence\n\n";
          exit;}
}

for(my $i=0; $i < (length($dna) - 2) ; $i += 3) {
    $codon = substr($dna,$i,3);
    $protein .= Codon_table($codon);
}

print "\n  <DNA>\n\n$dna\n\n  <Protein>\n\n$protein\n\n";

exit;

________________________________________________________________________________________________________________________________________________________

Homo sipiences AKT1