[Bioperl-l] TreeIO problem

Allen Day allenday at ucla.edu
Thu Apr 15 19:50:02 EDT 2004


there is a problem with your newick input, or its interaction with the 
TreeIO subsystem.  from the bioperl cvs, this code works:

#!/usr/bin/perl -w
use strict;
use lib '.';
use Bio::TreeIO;
use Data::Dumper;
use SVG::Graph;

my $in =  new Bio::TreeIO(-file => './t/data/cysprot1b.newick', -format => 'newick');
my $out = new Bio::TreeIO(-file => '>pik_svg', -format => 'svggraph');

while( my $tree = $in->next_tree ) {
  warn $tree;

  my $svg_xml = $out->write_tree($tree);
}

however using the newick data you provide below, the while loop is never 
entered.  here is the data i am using from the bioperl regression tests.

(
CATH_RAT:0.31356,
(
CATL_HUMAN:0.13938,
CATL_RAT:0.12788)
:0.18794,
PAPA_CARPA:0.34410);

-Allen




On Thu, 15 Apr 2004, Mikel Ega wrote:

> At the end I have produced a Dummy simple tree to see if distances
> affected in anything:
> 
> (A,(B,C),(D,E))
> 
> And it doesn't work either. 
> 
> The original tree was:
> 
> (Pf-CNP4:0.07786,(((Tr-CNP3:1.04017,Hs-CNP:0.90128):0.58396,
> ((((Tr-CNP1:0.20253,(Pf-CNP1:0.15012,(Om-CNP:0.12547,
> Ol-CNP1:0.25526):0.03512):0.08989):0.14887,Omy-CNP1:0.36290):0.47164,
> (Ol-CNP2:0.39033,Tr-CNP2:0.31133):0.71930):0.19555,
> (Tr-BNP:0.20983,(Pf-BNP:0.15777,Om-BNP:0.17203):0.09696):0.98657):0.372
> 19):0.64073, Ol-CNP4:0.18286):0.10371,Tr-CNP4:0.09927)
> 
> Find attached the file, 
> 
> Thanks
> 
> -------------------------------------------------
> -->pik at lolita (Debian Sarge-Kernel 2.4.20) 
> 
> -->http://sindominio.net/~pik
> 
> -->"Don Quijote se salva cuando se echa a 
>    los caminos a ser apaleado" (Francisco Umbral)
> -------------------------------------------------
> 
> 
> On Thu, 15 Apr 2004 11:45:39 -0700 (PDT)
> Allen Day <allenday at ucla.edu> wrote:
> 
> > send me your input file and i will try to replicate it here.
> > 
> > On Thu, 15 Apr 2004, Mikel Ega wrote:
> > 
> > > I have tried it with 
> > > 
> > > use SVG::Graph
> > > 
> > > and the script works, but the input is void (the pik_svg file).
> > > Perhaps I'm doing wrong something really obvious....here is the
> > > script again:
> > > 
> > > -------------------------------------------------------------------
> > > -----#!/usr/bin/perl -w
> > > 
> > > use strict;
> > > use SVG::Graph;
> > > use Bio::TreeIO;
> > > 
> > > my $in = new Bio::TreeIO(-file => 'pik_tree', -format => 'newick');
> > > my $out = new Bio::TreeIO(-file => '>pik_svg', -format =>
> > > 'svggraph');
> > > 
> > >   while( my $tree = $in->next_tree ) {
> > >       my $svg_xml = $out->write_tree($tree);
> > >   }
> > > -------------------------------------------------------------------
> > > -----
> > > 
> > > 
> > > Regards
> > > 
> > > -------------------------------------------------
> > > -->pik at lolita (Debian Sarge-Kernel 2.4.20) 
> > > 
> > > -->http://sindominio.net/~pik
> > > 
> > > -->"Don Quijote se salva cuando se echa a 
> > >    los caminos a ser apaleado" (Francisco Umbral)
> > > -------------------------------------------------
> > > 
> > > 
> > > On Thu, 15 Apr 2004 10:40:13 -0700 (PDT)
> > > Allen Day <allenday at ucla.edu> wrote:
> > > 
> > > > it looks like you need to in your script include SVG::Graph, a la
> > > > 
> > > > use strict;
> > > > use Bio::TreeIO;
> > > > use SVG::Graph;
> > > > #...
> > > > 
> > > > if this works let me know.  you shouldn't have to do this and i'll
> > > > fix it in cvs.
> > > > 
> > > > -allen
> > > > 
> > > > 
> > > > On Thu, 15 Apr 2004, Jason Stajich wrote:
> > > > 
> > > > > I don't really know - this is Allen's baby so he'll have to
> > > > > chime in.
> > > > > 
> > > > > -jason
> > > > > On Thu, 15 Apr 2004, Mikel [ISO-8859-1] Ega)`)t1^Y^Q! wrote:
> > > > > 
> > > > > > Yes, that's right;
> > > > > >
> > > > > > I forgot to install SVG::Graph, I have installed it and the
> > > > > > script works... but the output file is void!
> > > > > >
> > > > > > the -w option doesn't give any clues.
> > > > > >
> > > > > > I have been having a brief look into SVG::Graph and
> > > > > > Bio::TreeIO::svggraph and I cannot figure out what should be
> > > > > > wrong.
> > > > > >
> > > > > > Regards.
> > > > > >
> > > > > > On Thu, 15 Apr 2004 12:44:14 -0400 (EDT)
> > > > > > Jason Stajich <jason at cgt.duhs.duke.edu> wrote:
> > > > > >
> > > > > > > And you did install SVG::Graph... which pulls in a bunch of
> > > > > > > dependancies:
> > > > > > >
> > > > > > >  Math::Derivative
> > > > > > >  Math::Spline
> > > > > > >  Tree::DAG_Node
> > > > > > >
> > > > > > >
> > > > > > > What does 'perldoc SVG::Graph' report?
> > > > > > >
> > > > > > > If I do the install via the cpan shell I get all the
> > > > > > > dependancies too.-jason
> > > > > > >
> > > > > > > On Thu, 15 Apr 2004, Mikel [ISO-8859-1] Ega wrote:
> > > > > > >
> > > > > > > > Hello people;
> > > > > > > >
> > > > > > > > First of all, Bioperl is great. I have just started using
> > > > > > > > it for one of my projects and I'm amazed.
> > > > > > > >
> > > > > > > > I have a problem with the TreeIO class. I just want to
> > > > > > > > write a newick tree in SVG format, so I got this code from
> > > > > > > > the api and put it in this little script:
> > > > > > > >
> > > > > > > > ---------------------------------------------------------
> > > > > > > > ---------------#!/usr/bin/perl
> > > > > > > >
> > > > > > > > use Bio::TreeIO;
> > > > > > > >
> > > > > > > > my $in = new Bio::TreeIO(-file => 'input', -format =>
> > > > > > > > 'newick'); my $out = new Bio::TreeIO(-file => '>output',
> > > > > > > > -format =>'svggraph');
> > > > > > > >
> > > > > > > >   while( my $tree = $in->next_tree ) {
> > > > > > > >       my $svg_xml = $out->write_tree($tree);
> > > > > > > >   }
> > > > > > > >
> > > > > > > > ---------------------------------------------------------
> > > > > > > > ---------------
> > > > > > > >
> > > > > > > > And the following exception was given:
> > > > > > > >
> > > > > > > > ---------------------------------------------------------
> > > > > > > > --------------- MSG: Failed to load module
> > > > > > > > Bio::TreeIO::svggraph. Can't locate SVG/Graph.pm in @INC
> > > > > > > > (@INC contains:
> > > > > > > > /etc/perl/usr/local/lib/perl/5.8.3/usr/local/share/perl/5
> > > > > > > > .8.3/usr/lib/perl5/usr/share/perl5/usr/lib/perl/5.8
> > > > > > > > /usr/share/perl/5.8/usr/local/lib/site_perl .)
> > > > > > > > at/usr/local/share/perl/5.8.3/Bio/TreeIO/svggraph.pm line
> > > > > > > > 78. BEGIN failed--compilation aborted
> > > > > > > > at/usr/local/share/perl/5.8.3/Bio/TreeIO/svggraph.pm line
> > > > > > > > 78. Compilation failed in require at
> > > > > > > > /usr/local/share/perl/5.8.3/Bio/Root/Root.pm line 394.
> > > > > > > >
> > > > > > > > STACK Bio::Root::Root::_load_module
> > > > > > > > /usr/local/share/perl/5.8.3/Bio/Root/Root.pm:396 STACK
> > > > > > > > (eval)/usr/local/share/perl/5.8.3/Bio/TreeIO.pm:227 STACK
> > > > > > > > Bio::TreeIO::_load_format_module
> > > > > > > > /usr/local/share/perl/5.8.3/Bio/TreeIO.pm:226 STACK
> > > > > > > > Bio::TreeIO::new/usr/local/share/perl/5.8.3/Bio/TreeIO.pm
> > > > > > > > :126 STACK
> > > > > > > > toplevel./svg.pl:6---------------------------------------
> > > > > > > > ---------------------------------
> > > > > > > >
> > > > > > > > So I have installed all the SVG related modules via CPAN
> > > > > > > > but I receive the same error, and I cannot figure out what
> > > > > > > > should I do next.
> > > > > > > >
> > > > > > > > Thank you for your time,
> > > > > > > >
> > > > > > > > Mikel Egaña.
> > > > > > > >
> > > > > > > > PS: I'm using bioperl 1.4 in Debian Sarge.
> > > > > > > >
> > > > > > > > -------------------------------------------------
> > > > > > > > -->pik at lolita (Debian Sarge-Kernel 2.4.20)
> > > > > > > >
> > > > > > > > -->http://sindominio.net/~pik
> > > > > > > >
> > > > > > > > -->"Don Quijote se salva cuando se echa a
> > > > > > > >    los caminos a ser apaleado" (Francisco Umbral)
> > > > > > > > -------------------------------------------------
> > > > > > > > _______________________________________________
> > > > > > > > Bioperl-l mailing list
> > > > > > > > Bioperl-l at portal.open-bio.org
> > > > > > > > http://portal.open-bio.org/mailman/listinfo/bioperl-l
> > > > > > > >
> > > > > > >
> > > > > > > --
> > > > > > > Jason Stajich
> > > > > > > Duke University
> > > > > > > jason at cgt.mc.duke.edu
> > > > > > >
> > > > > > > _______________________________________________
> > > > > > > Bioperl-l mailing list
> > > > > > > Bioperl-l at portal.open-bio.org
> > > > > > > http://portal.open-bio.org/mailman/listinfo/bioperl-l
> > > > > >
> > > > > >
> > > > > > -------------------------------------------------
> > > > > > -->pik at lolita (Debian Sarge-Kernel 2.4.20)
> > > > > >
> > > > > > -->http://sindominio.net/~pik
> > > > > >
> > > > > > -->"Don Quijote se salva cuando se echa a
> > > > > >    los caminos a ser apaleado" (Francisco Umbral)
> > > > > > -------------------------------------------------
> > > > > >
> > > > > 
> > > > > --
> > > > > Jason Stajich
> > > > > Duke University
> > > > > jason at cgt.mc.duke.edu
> > > > > 
> > > 
> > > 
> > > -------------------------------------------------
> > > -->pik at lolita (Debian Sarge-Kernel 2.4.20) 
> > > 
> > > -->http://sindominio.net/~pik
> > > 
> > > -->"Don Quijote se salva cuando se echa a 
> > >    los caminos a ser apaleado" (Francisco Umbral)
> > > -------------------------------------------------
> > > 
> 
> 
> -------------------------------------------------
> -->pik at lolita (Debian Sarge-Kernel 2.4.20) 
> 
> -->http://sindominio.net/~pik
> 
> -->"Don Quijote se salva cuando se echa a 
>    los caminos a ser apaleado" (Francisco Umbral)
> -------------------------------------------------
> 


More information about the Bioperl-l mailing list