Part 2: [Bioperl-l] TreeIO question/problem
Jason Stajich
jason at cgt.duhs.duke.edu
Wed Mar 10 09:17:36 EST 2004
Did you try other tree files like the examples in t/data?
I cannot do much to help without a copy of the offending tree file
in newick_tree.
-jason
On Wed, 10 Mar 2004, Simon K. Chan wrote:
> My apologies, but there was a mistake in my first email. My code is actually
> the following:
>
>
> use lib '/home/skchan/bioperl/bioperl-1.4';
> use Bio::Tree::Node;
> use Bio::TreeIO;
> use Bio::Tree::Tree;
> use Bio::Tree::TreeI;
>
> # obtained code from bioperl documentation:
>
> my $treeio = new Bio::TreeIO(-format=>"newick", -file=>"./newick_tree");
> my $tree = $treeio->next_tree;
>
> print "tree: $tree\n";
>
> $treeio->next_tree does not return anything, thus, I cannot run get_nodes.
>
> Many thanks again.
>
> Simon
>
>
> ----- Forwarded message from "Simon K. Chan" <skchan at cs.usask.ca> -----
> Date: Tue, 09 Mar 2004 23:56:24 -0600
> From: "Simon K. Chan" <skchan at cs.usask.ca>
> Reply-To: "Simon K. Chan" <skchan at cs.usask.ca>
> Subject: [Bioperl-l] TreeIO question/problem
> To: bioperl-l at bioperl.org
>
> Hi,
>
> I wish to parse a tree in newick format.
>
> I attempted to use the TreeIO module to do so:
>
> My problem is that $treeio->next_tree does not return anything, thus I cannot
> call the get_nodes method to get all the nodes in my tree.
>
> My code follows. Many thanks for your time.
>
> use lib '/home/skchan/bioperl/bioperl-1.4';
> use Bio::Tree::Node;
> use Bio::TreeIO;
> use Bio::Tree::Tree;
> use Bio::Tree::TreeI;
>
> # obtained code from bioperl documentation:
>
> my $treeio = new Bio::TreeIO(-format=>"newick", -file=>"./newick_tree");
> my $tree = $treeio->next_tree;
>
> print "tree: $tree\n";
>
> my @nodes = $treeIO->get_nodes;
>
> print "nodes: @nodes\n";
>
>
>
>
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at portal.open-bio.org
> http://portal.open-bio.org/mailman/listinfo/bioperl-l
>
> ----- End forwarded message -----
>
>
> _______________________________________________
> 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
More information about the Bioperl-l
mailing list