Home
Reading
Searching
Subscribe
Sponsors
Statistics
Posting
Contact
Spam
Lists
Links
About
Hosting
Filtering
Features Download
Marketing
Archives
FAQ
Blog
 
Gmane
From: Fields, Christopher J <cjfields <at> illinois.edu>
Subject: Re: DNAStatistics distance between non-overlapping sequences
Newsgroups: gmane.comp.lang.perl.bio.general
Date: Saturday 29th March 2014 02:34:37 UTC (over 2 years ago)
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

[[email protected] 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;
}

[[email protected] dnastats]$ cat bug2901.fa
>seq1
GGTACCAGCAGGTGGGCCGCCTACTGCGCACGCGCGGGTTTGCGGGCAGCCGC
>seq2
GGTACCAGCTGGTGGGCCGCCTACTGCGCACGCGCGGGTTTGCGGGCAGCCGC
>seq3
GGTACCAGCAGGTGGTCCGCCTA------------------------------
>seq4
--------------------------CGCACGCGCGTGTTTGCGGGCAGCCGC

[[email protected] 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
[[email protected] 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 
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"
 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
>> [email protected]
>> http://lists.open-bio.org/mailman/listinfo/bioperl-l
> 
> _______________________________________________
> Bioperl-l mailing list
> [email protected]
> http://lists.open-bio.org/mailman/listinfo/bioperl-l
 
CD: 3ms