[Bioperl-l] treeio->write_tree problem

Jim Hu jimhu at tamu.edu
Wed Oct 20 16:16:52 UTC 2010


Doh!  I suspected it was something brain-dead that I was doing.

Thanks very much.  That worked.

Jim

On Oct 20, 2010, at 11:01 AM, Adam Witney wrote:

> 
> you are writing to your input stream. I think you need to create a separate output stream. Maybe something like this (untested):
> 
> my $treeio = new Bio::TreeIO(-file   => "PF03466_seed.nhx.txt",
>                           -format => "newick");
> 
> my $treeio_out = new Bio::TreeIO(-fh   => \*STDOUT,
>                           -format => "newick");
> 
> while( my $tree = $treeio->next_tree ) {
> 	$treeio_out->write_tree($tree);
> 	print Dumper($tree);
> }
> 
> 
> 
> On 20 Oct 2010, at 16:27, Jim Hu wrote:
> 
>> Help! In the script below, I'm not getting any output from treeio->write_tree.  Dumper shows that the tree is populated.
>> 
>> Jim
>> 
>> use Data::Dumper;
>> use Bio::TreeIO;
>> my $treeio = new Bio::TreeIO(-file   => "PF03466_seed.nhx.txt",
>>                           -format => "newick");
>> while( my $tree = $treeio->next_tree ) {
>> 	$treeio->write_tree($tree);
>> 	print Dumper($tree);
>> 
>> }
>> 
>> =====================================
>> Jim Hu
>> Associate Professor
>> Dept. of Biochemistry and Biophysics
>> 2128 TAMU
>> Texas A&M Univ.
>> College Station, TX 77843-2128
>> 979-862-4054
>> 
>> 
>> 
>> _______________________________________________
>> Bioperl-l mailing list
>> Bioperl-l at lists.open-bio.org
>> http://lists.open-bio.org/mailman/listinfo/bioperl-l
> 

=====================================
Jim Hu
Associate Professor
Dept. of Biochemistry and Biophysics
2128 TAMU
Texas A&M Univ.
College Station, TX 77843-2128
979-862-4054






More information about the Bioperl-l mailing list