~ubuntu-branches/ubuntu/trusty/bioperl/trusty-proposed

« back to all changes in this revision

Viewing changes to Bio/Align/DNAStatistics.pm

  • Committer: Bazaar Package Importer
  • Author(s): Charles Plessy
  • Date: 2009-03-10 07:19:11 UTC
  • mfrom: (1.2.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20090310071911-fukqzw54pyb1f0bd
Tags: 1.6.0-2
* Removed patch system (not used):
  - removed instuctions in debian/rules;
  - removed quilt from Build-Depends in debian/control.
* Re-enabled tests:
  - uncommented test command in debian/rules;
  - uncommented previously missing build-dependencies in debian/control.
  - Re-enabled tests and uncommented build-dependencies accordingly.
* Removed libmodule-build-perl and libtest-harness-perl from
  Build-Depends-Indep (provided by perl-modules).
* Better cleaning of empty directories using find -type d -empty -delete
  instead of rmdir in debian/rules (LP: #324001).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# $Id: DNAStatistics.pm,v 1.32.4.2 2006/10/02 23:10:12 sendu Exp $
 
1
# $Id: DNAStatistics.pm 14829 2008-08-27 06:19:17Z heikki $
2
2
#
3
3
# BioPerl module for Bio::Align::DNAStatistics
4
4
#
19
19
  use Bio::AlignIO;
20
20
  use Bio::Align::DNAStatistics;
21
21
 
22
 
  my $stats = new Bio::Align::DNAStatistics;
23
 
  my $alignin = new Bio::AlignIO(-format => 'emboss',
 
22
  my $stats = Bio::Align::DNAStatistics->new();
 
23
  my $alignin = Bio::AlignIO->new(-format => 'emboss',
24
24
                                 -file   => 't/data/insulin.water');
25
25
  my $aln = $alignin->next_aln;
26
26
  my $jcmatrix = $stats->distance(-align => $aln, 
29
29
  print $jcmatrix->print_matrix;
30
30
  ## and for measurements of synonymous /nonsynonymous substitutions ##
31
31
 
32
 
  my $in = new Bio::AlignIO(-format => 'fasta',
 
32
  my $in = Bio::AlignIO->new(-format => 'fasta',
33
33
                            -file   => 't/data/nei_gojobori_test.aln');
34
34
  my $alnobj = $in->next_aln;
35
35
  my ($seq1id,$seq2id) = map { $_->display_id } $alnobj->each_seq;
373
373
=head2 new
374
374
 
375
375
 Title   : new
376
 
 Usage   : my $obj = new Bio::Align::DNAStatistics();
 
376
 Usage   : my $obj = Bio::Align::DNAStatistics->new();
377
377
 Function: Builds a new Bio::Align::DNAStatistics object 
378
378
 Returns : Bio::Align::DNAStatistics
379
379
 Args    : none
385
385
    my ($class,@args) = @_;
386
386
    my $self = $class->SUPER::new(@args);
387
387
    
388
 
    $self->pairwise_stats( new Bio::Align::PairwiseStatistics());
 
388
    $self->pairwise_stats( Bio::Align::PairwiseStatistics->new());
389
389
 
390
390
    return $self;
391
391
}
1102
1102
        my $tj_index = $NucleotideIndexes{$tj};     
1103
1103
 
1104
1104
        if( ! defined $ti_index ) {
1105
 
            print "ti_index not defined for $ti\n";
 
1105
            $self->warn("ti_index not defined for $ti\n");
1106
1106
            next;
1107
1107
        }
1108
1108
        
1548
1548
=head2 get_syn_changes
1549
1549
 
1550
1550
 Title   : get_syn_changes
1551
 
 Usage   : Bio::Align::DNAStatitics->get_syn_chnages
 
1551
 Usage   : Bio::Align::DNAStatitics->get_syn_changes
1552
1552
 Function: Generate a hashref of all pairwise combinations of codns
1553
1553
           differing by 1
1554
1554
 Returns : Symetic matrix using hashes