[Bioperl-l] Classifying SNPs

Mark A. Jensen maj at fortinbras.us
Wed Jul 8 11:23:54 EDT 2009

Hey Abhishek-
You might root around in Bio::PopGen. Here's a script to get stuff from
raw fasta data--see comments within.

use Bio::AlignIO;
use Bio::PopGen::Utilities;

$file = "your_raw_file.fas";

my $aln = Bio::AlignIO->new(-format=>'fasta', -file=>$file)->next_aln;
# get the alignment into a Bio::PopGen::Population format, with codons
# as the marker sites
my $pop = 
Bio::PopGen::Utilities->aln_to_population(-alignment=>$aln, -site_model=>'cod');
# here are your variable codons...
my @cdnpos = $pop->get_marker_names;
# here are your individuals represented in the alignment
my @inds = $pop->get_Individuals;
# which have names like "Codon-3-9", "Codon-4-12", etc
foreach my $cdn (@cdnpos) {
    # calculate the unique codons represented at this codon position
    my (%ucdns, @ucdns);
    @genos = $pop->get_Genotypes(-marker=>$cdn);
    $ucdns{$_->get_Alleles}++ for @genos;
    @ucdns = sort keys %ucdns;
    # here, use translate or something faster to identify syn/non-syn
    # check out code in Bio::Align::DNAStatistics for various methods

# relate back to individuals with this
foreach my $ind (@inds) {
    print "Individual ".$ind->unique_id."\n";
    print "Site\tAllele\n";
    foreach my $cdn (@cdnpos) {
 print $cdn, "\t", $ind->get_Genotypes($cdn)->get_Alleles, "\n";


----- Original Message ----- 
From: "Abhishek Pratap" <abhishek.vit at gmail.com>
To: <bioperl-l at lists.open-bio.org>
Sent: Wednesday, July 08, 2009 10:24 AM
Subject: [Bioperl-l] Classifying SNPs

Hi All

This might seem to be an old track question. However I was not able to
find a good answer in the many diff mailing list archives.

For all our SNP predictions we would like to know whether they are
synonymous / non-synonymous. If Non-synonymous/Exonic then find the
position on the gene where amino acid is getting changed and to what
...Also info about indels will help.

I am not sure if something like this already exists. If not even some
pointers on how to move forward will help.


Bioperl-l mailing list
Bioperl-l at lists.open-bio.org

More information about the Bioperl-l mailing list