4 use Data
::Dump
qw(ddx);
6 my (%gen_code,%t,@t,%start_codes,$code,%AA,@AAs);
8 AAs = FFLLSSSSYY**CC*WLLLLPPPPHHQQRRRRIIIMTTTTNNKKSSRRVVVVAAAADDEEGGGG
9 Starts = ---M---------------M---------------M----------------------------
10 Base1 = TTTTTTTTTTTTTTTTCCCCCCCCCCCCCCCCAAAAAAAAAAAAAAAAGGGGGGGGGGGGGGGG
11 Base2 = TTTTCCCCAAAAGGGGTTTTCCCCAAAAGGGGTTTTCCCCAAAAGGGGTTTTCCCCAAAAGGGG
12 Base3 = TCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAG
16 map {s/\s//g;@_=split /=/;$t{$_[0]}=[split //,$_[1]]} @t;
19 my $base=(shift @
{$t{Base1
}}).(shift @
{$t{Base2
}}).(shift @
{$t{Base3
}});
21 my $start=shift @
{$t{Starts
}};
22 ++$start_codes{$base} if $start eq 'M';
30 ddx
scalar @AAs,\
@AAs;
32 my @Bases = sort qw( A T C G );
34 $mutBases{$_} = [] for @Bases;
35 for my $mut (@Bases) {
37 push @
{$mutBases{$_}},$mut if $mut ne $_;
43 my ($cnsSyn,$cntAAc) = (0,0);
44 for my $codon (sort keys %gen_code) {
45 my $ntApos = substr $codon,$pos,1;
46 my $oriAA = $gen_code{$codon};
47 next if $oriAA eq '*';
48 print "$pos\t$codon:$oriAA\t";
49 for my $mut ( @
{$mutBases{$ntApos}} ) {
50 my $mutCodon = $codon;
51 substr $mutCodon,$pos,1,$mut;
52 my $newAA = $gen_code{$mutCodon};
53 next if $newAA eq '*';
54 print "$mutCodon:$newAA";
55 if ( $oriAA eq $newAA ) {
66 print ">>$pos: $cnsSyn,$cntAAc,",$cnsSyn/($cnsSyn+$cntAAc),"\n";
70 $ perl get1986property
.pl
|grep \
>\
>
71 >>0: 8,166,0.0459770114942529
73 >>2: 126,50,0.715909090909091