[Bioperl-l] Bio::TreeIO

Komal Jain kj2230 at columbia.edu
Tue Jan 25 21:50:39 UTC 2011


Thanks very much for your prompt reply. I greatly appreciate it.

Komal.

-----Original Message-----
From: Jason Stajich [mailto:jason.stajich at gmail.com] On Behalf Of Jason
Stajich
Sent: Tuesday, January 25, 2011 4:46 PM
To: Komal Jain; BioPerl List
Subject: Re: Bio::TreeIO

Hi Komal -

You would just iterate over all the nodes, unset the bootstrap value if it
is < that your cutoff.

  for my $node ( $tree->get_nodes ) {
   if($node->bootstrap < $CUTOFF ){
    $node->bootstrap('');
    }
  }

The subtly between whether values get moved to boostrap value or just as an
id can be set when you do Bio::TreeIO reading in, you can also call
$tree->move_id_to_bootstrap which moves them over to the bootstrap slot.

Alternatively you can just know that ids for internal nodes are for
boostraps and use that field, e.g.
for my $node ( $tree->get_nodes ) {
   if(! $node->is_Leaf && $node->id < $CUTOFF ){
    $node->id('');
    }
  }

And write the tree back out. The HOWTO on Trees shows I/O for trees in more
detail.

Best wishes.


Komal Jain wrote:
> Dear Jason,
>
>
>
> I went through the documentation of the Bio::Tree module and it is a 
> very useful tool. I would like to know from you if it is possible to 
> remove the bootstrap values smaller than a cutoff from the newick tree.
>
>
>
> Thanks in advance for your reply,
>
> Komal.
>

--
Jason Stajich
jason at bioperl.org
http://bioperl.org/wiki






More information about the Bioperl-l mailing list