[Bioperl-l] DNAStatistics distance between non-overlapping sequences

Fields, Christopher J cjfields at illinois.edu
Sat Mar 29 02:34:37 UTC 2014


Hannes, this is working for me (see below).  Can you check whether there is an older version of bioperl installed locally for you that may be causing the problem?  You can use ‘perldoc -l Bio::Align::DNAStatistics’ to find out.

chris

[cjfields at pyrimidine-laptop dnastats]$ cat test.pl
#!/usr/bin/perl

use strict;
use Bio::AlignIO;
use Bio::Align::DNAStatistics;

my $in = Bio::AlignIO->new(-file => shift,-format => 'fasta');
my $stats = Bio::Align::DNAStatistics->new();
while (my $aln = $in->next_aln()) {
    my $matrix = $stats->distance(-align => $aln,   -method =>  'Uncorrected');
    print $matrix->print_matrix;
}

[cjfields at pyrimidine-laptop dnastats]$ cat bug2901.fa
>seq1
GGTACCAGCAGGTGGGCCGCCTACTGCGCACGCGCGGGTTTGCGGGCAGCCGC
>seq2
GGTACCAGCTGGTGGGCCGCCTACTGCGCACGCGCGGGTTTGCGGGCAGCCGC
>seq3
GGTACCAGCAGGTGGTCCGCCTA------------------------------
>seq4
--------------------------CGCACGCGCGTGTTTGCGGGCAGCCGC

[cjfields at pyrimidine-laptop dnastats]$ perl test.pl bug2901.fa

--------------------- WARNING ---------------------
MSG: No distance calculated between seq3 and seq4, inserting -1
---------------------------------------------------
    4
seq1           0.00000  0.01887  0.04348  0.03704
seq2           0.01887  0.00000  0.08696  0.03704
seq3           0.04348  0.08696  0.00000  -1
seq4           0.03704  0.03704  -1       0.00000
[cjfields at pyrimidine-laptop dnastats]$ perldoc -l Bio::Align::DNAStatistics
/Users/cjfields/bioperl/bioperl-live/Bio/Align/DNAStatistics.pm




On Mar 27, 2014, at 5:36 PM, Fields, Christopher J <cjfields at illinois.edu> wrote:

> Interesting, since I'm the one in that email.  I'll have to investigate.
> 
> Chris
> 
> Sent from my iPad
> 
>> On Mar 27, 2014, at 9:36 AM, "Hannes Hettling" <hannes.hettling at gmail.com> wrote:
>> 
>> A few years ago, a bug was reported (bug 2901) and apparently fixed
>> (http://bioperl.org/pipermail/bioperl-l/2010-January/032026.html) in
>> DNAStatistics when calculating distances of non overlapping sequences. 
>> 
>> However, I am still getting the error
>> 
>> 'Illegal division by zero
>> at /usr/local/src/bioperl-live/Bio/Align/DNAStatistics.pm line 527'
>> 
>> when calculating distances for the following sequences:
>> 
>> 
>>> seq1
>> GGTACCAGCAGGTGGGCCGCCTACTGCGCACGCGCGGGTTTGCGGGCAGCCGC
>>> seq2
>> GGTACCAGCTGGTGGGCCGCCTACTGCGCACGCGCGGGTTTGCGGGCAGCCGC
>>> seq3
>> GGTACCAGCAGGTGGTCCGCCTA------------------------------
>>> seq4
>> --------------------------CGCACGCGCGTGTTTGCGGGCAGCCGC
>> 
>> I am using the latest bioperl-live from github.
>> Could anyone suggest a way around this?
>> 
>> Many thanks in advance,
>> 
>> Hannes
>> 
>> 
>> _______________________________________________
>> Bioperl-l mailing list
>> Bioperl-l at lists.open-bio.org
>> http://lists.open-bio.org/mailman/listinfo/bioperl-l
> 
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/bioperl-l





More information about the Bioperl-l mailing list