-
Notifications
You must be signed in to change notification settings - Fork 0
/
mRNA1.pl
executable file
·94 lines (86 loc) · 1.42 KB
/
mRNA1.pl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
#!/usr/bin/env perl
use strict;
use warnings;
print "DNA->RNA\n";
#my $dna = 'TACCATGTTTCCAGG';
my $dna = 'TACCATGTTTCCAGGATCCGCGCTTAGCTGTACAAGGATGTGACACCCAAACCGT';
my $nA = $dna =~ tr/A//;
my $nC = $dna =~ tr/C//;
my $nG = $dna =~ tr/G//;
my $nT = $dna =~ tr/T//;
print "A($nA) C($nC) G($nG) T($nT)\n";
my @dna = split '', $dna;
(my $rna = $dna) =~ tr|ATGC|UACG|;
my @rna = split '', $rna;
print map {"$dna[$_] -> $rna[$_]\n" } 0..$#dna;
#my %codon =<<'CODON' =~ /^([AUGC]{3})\s(\w+)/mg;
my %codon = qw(
UUU phenylalanine
UUC phenylalanine
UUA leucine
UUG leucine
CUU leucine
CUC leucine
CUA leucine
CUG leucine
AUU isoleucine
AUC isoleucine
AUA isoleucine
AUG methionine
GUU valine
GUC valine
GUA valine
GUG valine
UCU serine
UAU tyrosine
UGU cysteine
UCC serine
UAC tyrosine
UGC cysteine
UCA serine
UAA stop
UGA stop
UCG serine
UAG stop
UGG tryptophan
CCU proline
CAU histidine
CGU arginine
CCC proline
CAC histidine
CGC arginine
CCA proline
CAA glutamine
CGA arginine
CCG proline
CAG glutamine
CGG arginine
ACU threonine
AAU asparagine
AGU serine
ACC threonine
AAC asparagine
AGC serine
ACA threonine
AAA lysine
AGA arginine
ACG threonine
AAG lysine
AGG arginine
GCU alanine
GAU aspartic_acid
GGU glycine
GCC alanine
GAC aspartic_acid
GGC glycine
GCA alanine
GAA glutamic_acid
GGA glycine
GCG alanine
GAG glutamic_acid
GGG glycine);
#CODON
print "Amino Acids:\n";
while ($rna =~ /(...)/g) {
print "$1 -> " . $codon{$1} ."\n";
}