[Bioperl-l] Can't locate object method "is_compatible" via package "Bio::Tree::Tree"

Sendu Bala bix at sendu.me.uk
Thu Jan 17 11:35:57 UTC 2008


Sendu Bala wrote:
>> the error changed: Can't locate object method "get_nodes" via
>> package "Bio::Tree::Compatible" at
>> i:/Perl/site/lib/Bio/Tree/Compatible.pm line 252, <GEN1> line 1.
> 
> I didn't get quite that error; instead I had an issue with TreeIO:
> for whatever reason it is only returning one tree from your input
> file (ie. $t2 is undefined).
> 
> I therefore got "Can't call method "get_nodes" on an undefined value
> [...]"
> 
> Can someone look into/confirm that?

... Yeah, I think I'm losing my mind. The code below is 'ok' using the
commented out -fh input for TreeIO, but is 'not ok' using the -file
input, where the specified file contains the exact same data as
__DATA__. Huh?


#!/usr/bin/perl -w
use strict;
use warnings;

use Bio::Tree::Compatible;
use Bio::TreeIO;
my $input = new Bio::TreeIO('-format' => 'newick',
                             #-fh      => \*DATA,
                             -file    => 'input.tre'
                             );
my $t1 = $input->next_tree;
my $t2 = $input->next_tree;

if ($t2) {
    print "ok\n";
}
else {
    print "not ok\n";
}

__DATA__
(((A,B)C,D),(E,F,G));
((A,B)H,E,(J,(K)G)I);





More information about the Bioperl-l mailing list