[Bioperl-l] neighbor.pm

Elizabeth Williams ew9 at york.ac.uk
Tue Feb 24 05:30:02 EST 2004


Hello,
I have a problem running the bit of code below.  I get this message:

"Can't call method "names" on an undefined value at 
/biol/programs/perl580/lib/site_perl/5.8.0/Bio/Tools/Run/Phylo/Phylip/Neighbor.pm 
line 470."

but not all the time - it mostly works but on some alignments it comes up 
with this error.
Any ideas of what the problem is or how to fix it?


                         #align sequences
                         my @params_align = ('ktuple' => 2, 'matrix' => 
'BLOSUM', 'QUIET' => 1);
                         my $factory = 
Bio::Tools::Run::Alignment::Clustalw->new(@params_align);
                         my $seq_array_ref = \@seq_array; # where 
@seq_array is an array of Bio::Seq objects
                         my $aln = $factory->align($seq_array_ref);
                         my @params_protdist = ('MODEL' => 'PAM', 'QUIET' 
=> 1);

                         my $protdist_factory = 
Bio::Tools::Run::Phylo::Phylip::ProtDist->new(@params_protdist);

                         $protdist_factory->version('3.6');

                         my $matrix = $protdist_factory->run($aln);

                         my @params_neighbor = ('type'=>'NJ', 'QUIET' => 1);

                         my $neighborfactory = 
Bio::Tools::Run::Phylo::Phylip::Neighbor->new(@params_neighbor);

                         $neighborfactory->version('3.6');

                         my (@trees) = $neighborfactory->run($matrix);

                         my $outtree = new Bio::TreeIO(-file => 
">>geneorigin_results2.xls");

                         foreach my $tree (@trees) {

                                 $outtree->write_tree($tree);

                         }

Elizabeth J.B. Williams
CNAP
Department of Biology
University of York
York
YO10 5YW
mobile: 07813149274
work: 01904 328757
Fax: 01904 328762



More information about the Bioperl-l mailing list