]> git.donarmstrong.com Git - bio-dbsnp.git/blob - bin/vcf_add_snp_info
add base versions of routines
[bio-dbsnp.git] / bin / vcf_add_snp_info
1 #! /usr/bin/perl
2 # vcf_add_snp_info adds additional snp information to vcf files, and
3 # is released under the terms of the GPL version 2, or any later
4 # version, at your option. See the file README and COPYING for more
5 # information.
6 # Copyright 2011 by Don Armstrong <don@donarmstrong.com>.
7
8
9 use warnings;
10 use strict;
11
12 BEGIN {$|=1};
13
14 use Getopt::Long;
15 use Pod::Usage;
16
17 =head1 NAME
18
19 vcf_add_snp_info - Add additional snp information to vcf files
20
21 =head1 SYNOPSIS
22
23  [options]
24
25  Options:
26   --debug, -d debugging level (Default 0)
27   --help, -h display this help
28   --man, -m display manual
29
30 =head1 OPTIONS
31
32 =over
33
34 =item B<--debug, -d>
35
36 Debug verbosity. (Default 0)
37
38 =item B<--help, -h>
39
40 Display brief usage information.
41
42 =item B<--man, -m>
43
44 Display this manual.
45
46 =back
47
48 =head1 EXAMPLES
49
50 vcf_fill_rsid foo.vcf > bar.vcf
51
52 =cut
53
54
55 use vars qw($DEBUG);
56 use DBI;
57 use Data::Dumper;
58 use Scalar::Util qw(looks_like_number);
59
60
61 my %options = (debug           => 0,
62                help            => 0,
63                man             => 0,
64                verbose         => 0,
65                build           => '135',
66                refseq          => '37_3',
67                );
68
69 GetOptions(\%options,
70            'build',
71            'refseq',
72            'verbose|v+',
73            'debug|d+','help|h|?','man|m');
74
75 pod2usage() if $options{help};
76 pod2usage({verbose=>2}) if $options{man};
77
78 $DEBUG = $options{debug};
79
80 my @USAGE_ERRORS;
81 # if (1) {
82 #      push @USAGE_ERRORS,"You must pass something";
83 # }
84
85 pod2usage(join("\n",@USAGE_ERRORS)) if @USAGE_ERRORS;
86
87
88 my $dbh = DBI->connect("dbi:Pg:service=snp",'','',{AutoCommit => 0}) or
89     die "Unable to connect to database: ".$DBI::errstr;
90
91 my $sth = $dbh->prepare(<<"END") // die "Unable to prepare snpinfo statement: ".$dbh->errstr;
92 SELECT snp_id FROM b$options{build}_snpchrposonref_$options{refseq} WHERE chr=? AND pos=?;
93 END
94
95 my $real_snp_sth = $dbh->prepare(<<'END') // die "Unable to prepare realsnp statement: ".$dbh->errstr;
96 SELECT DISTINCT rscurrent FROM rsmergearch WHERE rslow=? OR rshigh=?
97 END
98
99 my $sth_mrna_ss = $dbh->prepare(<<'END') // die "Unable to prepare mrna_ss statement: ".$dbh->errstr;
100 SELECT * FROM mrna WHERE start<=? AND stop>=? AND chr=? ORDER BY variant;
101 END
102
103 my $sth_cds_ss = $dbh->prepare(<<'END') // die "Unable to prepare cds_ss statement: ".$dbh->errstr;
104 SELECT * FROM cds WHERE start<=? AND stop>=? AND chr=? ORDER BY variant;
105 END
106
107 my $sth_mrna_cds = $dbh->prepare(<<'END') // die "Unable to prepare mrna_cds statement: ".$dbh->errstr;
108 SELECT * FROM mrna_cds_table WHERE cds_gi=?;
109 END
110
111 my $sth_snp_history = $dbh->prepare(<<'END') // die "Unable to prepare snp_history statement: ".$dbh->errstr;
112 SELECT * FROM snphistory WHERE snp_id=?;
113 END
114
115
116 my $sth_allele_freq = $dbh->prepare(<<'END') // die "Unable to prepare allele_freq statement: ".$dbh->errstr;
117 SELECT ssl.snp_id AS snp_id,
118        si.subsnp_id AS subsnp_id,
119 --        ssl.substrand_reversed_flag,
120        si.chr AS chr,
121        si.submitted_ind_id AS submitted_ind_id,
122        ga.chr_num AS chr_num,
123 --       si.submitted_strand_code,
124 --       si.allele_flag,
125        ga.rev_flag AS rev_flag,
126        a.allele AS allele,
127        ra.allele AS rev_allele,
128        p.handle AS pop_handle,
129        p.loc_pop_id AS loc_pop_id
130   FROM snpsubsnplink ssl
131     JOIN subind si on ssl.subsnp_id=si.subsnp_id
132     JOIN gtyallele ga on si.gty_id=ga.gty_id
133     JOIN allele a on ga.fwd_allele_id = a.allele_id
134     JOIN allele ra on a.rev_allele_id = ra.allele_id
135     JOIN submittedindividual sind on si.submitted_ind_id=sind.submitted_ind_id
136     JOIN population p on sind.pop_id=p.pop_id
137     WHERE ssl.snp_id=? AND
138           si.chr=? AND ga.rev_flag = '0' AND
139           a.allele <> 'N';
140 END
141
142 my $sth_rsid_info = $dbh->prepare(<<'END') // die "Unable to prepare rsid info statement: ".$dbh->errstr;
143 SELECT * FROM cds WHERE start<=? AND stop>=? AND chr=? ORDER BY variant;
144 END
145
146 my $sth_ga_info = $dbh->prepare(<<'END') // die "Unable to prepare ga_snp info statement: ".$dbh->errstr;
147 SELECT * FROM ga_snp WHERE snp_id=?;
148 END
149
150 my $prot_table;
151
152 while (<DATA>) {
153     chomp;
154     my ($codon,$aa,$aa_med,$aa_long) = split /\t/;
155     $prot_table->{$codon} = $aa;
156 }
157
158 my @headers = qw(chr pos id ref alt qual filter info format);
159 while (<>) {
160     print $_ and next if /^#/;
161     chomp;
162     my @row = split /\t/, $_;
163     my %row;
164     @row{@headers} = @row[0..$#headers];
165     # this is taken directly from vcf_fill_rsid; we want it for the time being anyway
166     if ($row{id} !~ /^(?:rs|ss)?\d+(?:,\s*(?:rs|ss)?\d+)*$/) {
167         $row{id} = find_rsid(chr => fixup_chr($row{chr}),
168                              # snps are 0 indexed
169                              pos => $row{pos} - 1,
170                              dbh => $dbh,
171                              sth => $sth,
172                             );
173     }
174     if ($row{id} =~ /(rs|ss)(\d+)/) {
175         my $type = $1;
176         my $id = $2;
177         $id = find_real_snp_id(id => $id,
178                                dbh => $dbh,
179                                sth => $real_snp_sth,
180                               );
181         if (not defined $id and
182             is_retired_snp(id  => $id,
183                            dbh => $dbh,
184                            sth => $sth_snp_history,
185                           )) {
186             if (defined $row{chr} and defined $row{pos}) {
187                 $row{id} = undef;
188             }
189         }
190         else {
191             $row{id} = "$type$id";
192         }
193     }
194     my $mrna_information = mrna_information(dbh => $dbh,
195                                             sth => $sth_mrna_ss,
196                                             # these are all 1 indexed
197                                             pos => $row{pos},
198                                             chr => fixup_chr($row{chr}),
199                                             ref => $row{ref},
200                                             alt => $row{alt},
201                                             cds_sth => $sth_cds_ss,
202                                             mrna_cds_sth => $sth_mrna_cds,
203                                            );
204     if (keys %{$mrna_information}) {
205         # strip out existing information in $row{info}
206         $row{info} =~ s{(?:GENE|(?:CDS|PROT|)POS|NUM|VAR|ACC|NONSYN|(?:ALT|REF)(?:AA|CODON))\=(?:[^\;]+|"[^"]+")(?:;|$)}{}g;
207         my @extra_info;
208         push @extra_info,"GENE=".$mrna_information->{gene};
209         push @extra_info,"NONSYN=".1 if defined $mrna_information->{nonsyn} and $mrna_information->{nonsyn};
210         push @extra_info,"REFAA=".$mrna_information->{orig_aa} if defined $mrna_information->{orig_aa};
211         push @extra_info,"ALTAA=".$mrna_information->{new_aa} if defined $mrna_information->{new_aa};
212         push @extra_info,"REFCODON=".$mrna_information->{orig_codon} if defined $mrna_information->{orig_codon};
213         push @extra_info,"ALTCODON=".$mrna_information->{new_codon} if defined $mrna_information->{new_codon};
214         push @extra_info,"CDSPOS=".$mrna_information->{cds_pos} if defined $mrna_information->{cds_pos};
215         push @extra_info,"PROTPOS=".$mrna_information->{prot_pos} if defined $mrna_information->{prot_pos};
216         push @extra_info,"POS=".($mrna_information->{exon}?'exon':'intron');
217         push @extra_info,"NUM=".$mrna_information->{number};
218         push @extra_info,"VAR=".$mrna_information->{variant} if defined $mrna_information->{variant};
219         push @extra_info,"ACC=".$mrna_information->{accession};
220         push @extra_info,"ACCVER=".$mrna_information->{accession_ver};
221         push @extra_info,"PHASE=".$mrna_information->{phase} if defined $mrna_information->{phase};
222         $row{info} = join(';',@extra_info,$row{info});
223     }
224     my $allele_freq_information = allele_freq_information(dbh => $dbh,
225                                                           sth => $sth_allele_freq,
226                                                           id  => $row{id},
227                                                           # these are all 1 indexed
228                                                           pos => $row{pos},
229                                                           chr => fixup_chr($row{chr}),
230                                                           ref => $row{ref},
231                                                           alt => $row{alt},
232                                                          );
233     if (keys %{$allele_freq_information}) {
234         # strip out existing information in $row{info}
235         $row{info} =~ s{(?:REFFREQ|ALTFREQ|REFALTN)\=(?:[^\;]+|"[^"]+")(?:;|$)}{}g;
236         my @extra_info;
237         if (exists $allele_freq_information->{alleles} and keys %{$allele_freq_information->{alleles}}) {
238             push @extra_info,"REFFREQ=".sprintf('%.3f',allele_freq($allele_freq_information->{alleles},$row{ref}));
239             push @extra_info,"ALTFREQ=".sprintf('%.3f',allele_freq($allele_freq_information->{alleles},$row{alt}));
240             push @extra_info,"REFALTN=".$allele_freq_information->{alleles}{total};
241         }
242         $row{info} = join(';',@extra_info,$row{info});
243     }
244     my $ga_study_information = ga_study_information(dbh => $dbh,
245                                                     sth => $sth_ga_info,
246                                                     id  => $row{id},
247                                                    );
248     if (defined $ga_study_information) {
249         # strip out existing information in $row{info}
250         $row{info} =~ s{(?:GASTUDY|GASTUDYSIG)\=(?:[^\;]+|"[^"]+")(?:;|$)}{}g;
251         my @extra_info;
252         push @extra_info,"GASTUDY=".$ga_study_information->{studies};
253         push @extra_info,"GASTUDYSIG=".($ga_study_information->{significant}?'TRUE':'FALSE');
254         $row{info} = join(';',@extra_info,$row{info});
255     }
256     print join("\t",@row{@headers},$#row > $#headers?@row[@headers..$#row]:())."\n";
257     if ($options{verbose} > 0 and $. % 100 == 0) {
258         print STDERR "At line $.\n";
259     }
260 }
261
262 sub ga_study_information {
263     my %param = @_;
264
265     return undef unless $param{id} =~ /^\d+$/;
266     my $rv = $param{sth}->execute($param{id}) or
267         die "Unable to execute statement properly: ".$param{dbh}->errstr;
268     my $results = $param{sth}->fetchall_arrayref({});
269     if (not @{$results}) {
270         return undef;
271     }
272     my $any_significant=0;
273     my @values;
274     for my $result (sort {
275         if (looks_like_number($a->{pvalue})) {
276             if (looks_like_number($b->{pvalue})) {
277                 $a->{pvalue} <=> $b->{pvalue};
278             } else {
279                 -1;
280             }
281         } elsif (looks_like_number($b->{pvalue})) {
282             1;
283         } else {
284             0;
285         }} @{$results}) {
286         if ($result->{significant}) {
287             $any_significant=1;
288         }
289         my $value = $result->{study_name}.':'.$result->{subpart_name};
290         for my $t (qw(pvalue qvalue fdr)) {
291             next unless exists $result->{$t} and defined $result->{$t} and length $result->{$t};
292             my ($fl) = $t =~ m/^(.)/;
293             $value .= ":$fl:".sprintf('%.3g',$result->{$t});
294         }
295         push @values, $value;
296     }
297     return {significant => $any_significant,
298             studies     => join(',',@values),
299            };
300
301 }
302
303 sub mrna_information{
304     my %param = @_;
305
306     my $rv = $param{sth}->execute($param{pos},$param{pos},$param{chr}) or
307         die "Unable to execute statement properly: ".$param{dbh}->errstr;
308
309     my $results = $param{sth}->fetchall_arrayref({});
310     if ($param{sth}->err) {
311         print STDERR $param{sth}->errstr;
312         return {};
313     }
314     my $chosen_result;
315     for my $result (@{$results}) {
316         if (not defined $chosen_result) {
317             $chosen_result = $result;
318             next;
319         }
320         if (not defined $chosen_result->{variant} or
321             (defined $result->{variant} and
322              $chosen_result->{variant} > $result->{variant})) {
323             $chosen_result = $result;
324             next;
325         }
326     }
327     if (defined $chosen_result and $chosen_result->{exon}) {
328         # try to figure out the cds if there is mrna information and
329         # we're in an exon
330         my $cds_rv = $param{cds_sth}->execute($param{pos},$param{pos},$param{chr}) or
331             die "Unable to execute statement properly: ".$param{dbh}->errstr;
332         my $cds_results = $param{cds_sth}->fetchall_arrayref({});
333         if ($param{cds_sth}->err) {
334             print STDERR $param{cds_sth}->errstr;
335         }
336         else {
337             print STDERR Data::Dumper->Dump([$cds_results],[qw(cds_results)]) if $DEBUG;
338             my $chosen_cds;
339             for my $cds_result (@{$cds_results}) {
340                 if (not defined $chosen_cds) {
341                     $chosen_cds = $cds_result;
342                     next;
343                 }
344                 if (not defined $cds_result->{variant} or
345                     (defined $chosen_cds->{variant} and
346                      $chosen_cds->{variant} ge $cds_result->{variant})) {
347                     $chosen_cds = $cds_result;
348                     next;
349                 }
350             }
351             if (defined $chosen_cds and keys %{$chosen_cds}) {
352                 my $comp_offset = $chosen_cds->{complement}?-1:1;
353                 $chosen_result->{in_cds} = 1;
354                 $chosen_result->{cds_pos} =
355                     ($chosen_cds->{complement}?$chosen_cds->{stop}-$param{pos}:$param{pos}-$chosen_cds->{start}) +
356                         $chosen_cds->{position};
357                 $chosen_result->{gene} = $chosen_cds->{gene};
358                 $chosen_result->{pos} = $chosen_cds->{pos};
359                 $chosen_result->{number} = $chosen_cds->{number};
360                 $chosen_result->{variant} = $chosen_cds->{variant};
361                 $chosen_result->{acc} = $chosen_cds->{accession};
362                 $chosen_result->{accver} = $chosen_cds->{accession_ver};
363                 $chosen_result->{prot_pos} = sprintf("%.1f",$chosen_result->{cds_pos}/ 3);
364                 $chosen_result->{phase} = ($chosen_cds->{phase} + $param{pos} - $chosen_cds->{start}) % 3;
365                 print STDERR Data::Dumper->Dump([$chosen_cds,$chosen_result],[qw(chosen_cds chosen_result)]) if $DEBUG;
366                 my $mrna_cds_rv = $param{mrna_cds_sth}->execute($chosen_cds->{gi}) or
367                     die "Unable to execute statement properly: ".$param{dbh}->errstr;
368                 my $mrna_cds_result = $param{mrna_cds_sth}->fetchrow_hashref();
369                 if (defined $mrna_cds_result and keys %{$mrna_cds_result}) {
370                     print STDERR Data::Dumper->Dump([$mrna_cds_result,$chosen_result,\%param],
371                                                     [qw(mrna_cds_result chosen_result *param)]) if $DEBUG;
372                     my $codon = substr $mrna_cds_result->{sequence},$chosen_result->{cds_pos} - (($chosen_result->{cds_pos}) % 3)  ,3;
373                     my $orig_aa = convert_to_prot_seq($codon);
374                     my $modified_codon = $codon;
375                     substr($modified_codon,$chosen_result->{cds_pos} % 3,1)=
376                         ($chosen_cds->{complement}?dna_complement($param{alt}):$param{alt});
377                     my $new_aa = convert_to_prot_seq($modified_codon);
378                     print STDERR Dumper($mrna_cds_result,$chosen_result,$chosen_cds,{codon_pos => $chosen_result->{cds_pos} - ($chosen_result->{cds_pos} % 3),
379                                                                                      codon=>$codon,modified_codon=>$modified_codon,pos=>$param{pos}}) if $DEBUG;
380                     if ($DEBUG > 1) {
381                         my $a = -1;
382                         print STDERR map {$a++; ($a*3)." $_\n"} $mrna_cds_result->{sequence} =~ m/.../g;
383                     }
384                     $chosen_result->{orig_aa} = $orig_aa;
385                     $chosen_result->{new_aa} = $new_aa;
386                     $chosen_result->{new_codon} = $modified_codon;
387                     $chosen_result->{orig_codon} = $codon;
388                     $chosen_result->{nonsyn} = $new_aa ne $orig_aa ? 1 : 0;
389                 }
390             }
391         }
392     }
393     return $chosen_result // {};
394 }
395
396 sub find_real_snp_id {
397     my %param = @_;
398
399     my %info;
400     my $rv = $param{sth}->execute($param{id},$param{id}) //
401         die "Unable to execute statement properly: ".$param{dbh}->errstr;
402     my ($real_id) = map {ref $_ ?@{$_}:()} map {ref $_ ?@{$_}:()} $param{sth}->fetchall_arrayref([0]);
403     if ($param{sth}->err) {
404         print STDERR $param{sth}->errstr;
405         $param{sth}->finish;
406         return $param{id};
407     }
408     $param{sth}->finish;
409     return $real_id // $param{id};
410 }
411
412 sub is_retired_snp {
413     my %param = @_;
414
415     my %info;
416     my $rv = $param{sth}->execute($param{id}) //
417         die "Unable to execute statement properly: ".$param{dbh}->errstr;
418     if ($param{sth}->rows >= 1) {
419         return 1;
420     }
421     return 0;
422 }
423
424
425 sub fixup_chr {
426     my ($chr) = @_;
427
428     $chr =~ s/^NC_00000?//;
429     $chr =~ s/^chr//;
430     if (looks_like_number($chr)) {
431         if ($chr == 23) {
432             $chr = "X"
433         }
434         elsif ($chr == 24) {
435             $chr = "Y"
436         }
437     }
438     return ($chr);
439 }
440
441 sub allele_freq_information{
442     my %param = @_;
443
444     return {} if $param{id} !~ /^\d+$/;
445
446     my $rv = $param{sth}->execute($param{id},$param{chr}) or
447         die "Unable to execute statement properly: ".$param{dbh}->errstr." id:".$param{id}." chr:".$param{chr};
448
449     my $results = $param{sth}->fetchall_arrayref({});
450     if ($param{sth}->err) {
451         print STDERR $param{sth}->errstr;
452         return {};
453     }
454     my %pop_alleles;
455     my %alleles;
456     my %seen_indiv;
457     my %indivs;
458     for my $result (@{$results}) {
459         next if exists $seen_indiv{$result->{submitted_ind_id}.'.'.$result->{chr_num}};
460         $indivs{$result->{submitted_ind_id}}{pop_handle} = $result->{pop_handle};
461         $indivs{$result->{submitted_ind_id}}{loc_pop_id} = $result->{loc_pop_id};
462         $indivs{$result->{submitted_ind_id}}{'chr_'.$result->{chr_num}} = $result->{allele};
463         if (defined $result->{loc_pop_id}) {
464             $pop_alleles{$result->{loc_pop_id}}{$result->{allele}}++;
465             $pop_alleles{$result->{loc_pop_id}}{total}++;
466         }
467         $alleles{$result->{allele}}++;
468         $alleles{total}++;
469         $seen_indiv{$result->{submitted_ind_id}.'.'.$result->{chr_num}} = 1;
470     }
471     my %genotypes;
472     my %pop_genotypes;
473     for my $indiv (values %indivs) {
474         if (defined $indiv->{chr_1} and defined $indiv->{chr_2}) {
475             my $genotype = join('/',
476                                 sort($indiv->{chr_1},
477                                      $indiv->{chr_2}));
478             $pop_genotypes{$indiv->{loc_pop_id}}{$genotype}++;
479             $pop_genotypes{$indiv->{loc_pop_id}}{total}++;
480             $genotypes{$genotype}++;
481             $genotypes{total}++;
482         }
483     }
484     return {pop_alleles   => \%pop_alleles,
485             pop_genotypes => \%pop_genotypes,
486             genotypes     => \%genotypes,
487             alleles       => \%alleles,
488            };
489 }
490
491 sub allele_freq{
492     my ($freq_table,$allele) = @_;
493     if (defined $allele) {
494         return ((exists $freq_table->{$allele} and defined $freq_table->{$allele}) ?
495                 $freq_table->{$allele}/$freq_table->{total} : 0);
496     }
497     my @alleles = grep {$_ ne 'total'} keys %{$freq_table};
498     return join(',',map {$_.':'.(defined $freq_table->{$_} ?
499                                  $freq_table->{$_}/$freq_table->{total} : 0)} @alleles);
500 }
501
502
503 sub find_rsid {
504     my %param = @_;
505
506     my $rv = $param{sth}->execute($param{chr},$param{pos}) //
507         die "Unable to execute statement properly: ".$param{dbh}->errstr;
508     my @snp_ids = grep {$_ =~ /^\d+$/}
509         map {ref $_ eq 'ARRAY'? @{$_}:$_}
510             map {ref $_ eq 'ARRAY'? @{$_}:$_}
511                 $sth->fetchall_arrayref([0]);
512     if ($sth->err) {
513         print STDERR $sth->errstr;
514         return '?';
515     }
516     if (not @snp_ids) {
517         return '.';
518     }
519     return join(',',@snp_ids);
520 }
521
522 sub dna_complement{
523     my ($seq) = @_;
524     return join('',map {tr /ATCG/TAGC/; $_} reverse split //,$seq);
525 }
526
527 sub convert_to_prot_seq{
528     my ($mrna) = @_;
529     $mrna =~ s/U/T/g;
530     my $prot = '';
531     for my $pos (0..(length($mrna) / 3 - 1)) {
532         my $codon = substr($mrna,$pos*3,3);
533         if (not exists $prot_table->{$codon}) {
534             # this isn't quite right, as we should really be handling
535             # ambiguities which do not result in different amino
536             # acids, but for the time being, do it this way.
537             $prot .= 'N';
538         }
539         else {
540             $prot .= $prot_table->{$codon};
541         }
542     }
543     return $prot;
544 }
545
546
547 __DATA__
548 ATT     I       Ile     Isoleucine
549 ATC     I       Ile     Isoleucine
550 ATA     I       Ile     Isoleucine
551 CTT     L       Leu     Leucine
552 CTC     L       Leu     Leucine
553 CTA     L       Leu     Leucine
554 CTG     L       Leu     Leucine
555 TTA     L       Leu     Leucine
556 TTG     L       Leu     Leucine
557 GTT     V       Val     Valine
558 GTC     V       Val     Valine
559 GTA     V       Val     Valine
560 GTG     V       Val     Valine
561 TTT     F       Phe     Phenylalanine
562 TTC     F       Phe     Phenylalanine
563 ATG     M       Met     Methionine
564 TGT     C       Cys     Cysteine
565 TGC     C       Cys     Cysteine
566 GCT     A       Ala     Alanine
567 GCC     A       Ala     Alanine
568 GCA     A       Ala     Alanine
569 GCG     A       Ala     Alanine
570 GGT     G       Gly     Glycine
571 GGC     G       Gly     Glycine
572 GGA     G       Gly     Glycine
573 GGG     G       Gly     Glycine
574 CCT     P       Pro     Proline
575 CCC     P       Pro     Proline
576 CCA     P       Pro     Proline
577 CCG     P       Pro     Proline
578 ACT     T       Thr     Threonine
579 ACC     T       Thr     Threonine
580 ACA     T       Thr     Threonine
581 ACG     T       Thr     Threonine
582 TCT     S       Ser     Serine
583 TCC     S       Ser     Serine
584 TCA     S       Ser     Serine
585 TCG     S       Ser     Serine
586 AGT     S       Ser     Serine
587 AGC     S       Ser     Serine
588 TAT     Y       Tyr     Tyrosine
589 TAC     Y       Tyr     Tyrosine
590 TGG     W       Trp     Tryptophan
591 CAA     Q       Gln     Glutamine
592 CAG     Q       Gln     Glutamine
593 AAT     N       Asn     Asparagine
594 AAC     N       Asn     Asparagine
595 CAT     H       His     Histidine
596 CAC     H       His     Histidine
597 GAA     E       Glu     Glutamic acid
598 GAG     E       Glu     Glutamic acid
599 GAT     D       Asp     Aspartic acid
600 GAC     D       Asp     Aspartic acid
601 AAA     K       Lys     Lysine
602 AAG     K       Lys     Lysine
603 CGT     R       Arg     Arginine
604 CGC     R       Arg     Arginine
605 CGA     R       Arg     Arginine
606 CGG     R       Arg     Arginine
607 AGA     R       Arg     Arginine
608 AGG     R       Arg     Arginine
609 TAA     *       *       Stop codon
610 TAG     *       *       Stop codon
611 TGA     *       *       Stop codon