<div>For a list of genbank accession numbers i wanna extract all missense variations and their frequencies. Right now my script extracts all snp's from the slice ($slice), but how can I restrict it to only print the snp's that lead to a change in the protein sequence? Also, i want it to return the frequencies of the snp's?</div>
<div><br></div><div>use Bio::EnsEMBL::Registry;</div><div>my $reg = 'Bio::EnsEMBL::Registry';</div><div>$reg->load_registry_from_db(-host => '<a href="http://ensembldb.ensembl.org">ensembldb.ensembl.org</a>', -user => 'anonymous');</div>
<div>my $gene_name = shift;</div><div>my $ga = $reg->get_adaptor('Human', 'Core', 'Gene');</div><div>my $sa = $reg->get_adaptor('Human', 'Core', 'Slice');</div><div>my $vfa = $reg->get_adaptor('Human', 'Variation', 'VariationFeature');</div>
<div><br></div><div>my $genes = $ga->fetch_all_by_external_name($gene_name);</div><div>while (my $gene = shift @{$genes}) {</div><div>  my $chr   = $gene->seq_region_name;</div><div>  my $start = $gene->seq_region_start;</div>
<div>  my $end   = $gene->seq_region_end;</div><div>  my $region = sprintf "%s:%d-%d", $chr, $gene->start, $gene->end;</div><div>  print join("\t", ($gene->stable_id, $region, $length, $gene->external_name, $gene->description) ), "\n";</div>
<div>  my $slice = $sa->fetch_by_region('chromosome', $chr, $start, $end);</div><div>  my @vfs = @{$vfa->fetch_all_by_Slice($slice)};</div><div>  for my $vf (@vfs) {</div><div>    print</div><div>      $vf->variation_name, ' has alleles ', $vf->allele_string,</div>
<div>      ' located at ', $slice->seq_region_name, ':', </div><div>      $vf->seq_region_start, '-', $vf->seq_region_end, "\n";</div><div>  }</div><div>}</div>