[Bioperl-l] tree copy by-value

Sendu Bala bix at sendu.me.uk
Thu Apr 19 09:24:41 EDT 2007


Stephen Montgomery wrote:
> my $tree_copy = $tree;  #copies by reference a Bio::Tree::Tree object
> 
> as an example, a method like
> my $tree_copy = $tree->clone; #copies by value (this method doesn't
> exist) or
> my $tree_copy = Storable::dclone($tree); 

Right, sorry for being a little slow on the uptake. As a matter of fact 
I recently added _clone() to Bio::Tree::TreeFunctionsI which does a 
"safe tree clone that doesn't seg fault". Its undocumented and I thought 
would only be needed by simplify_to_leaves_string(), but I guess I can 
document it and make it public (ie. remove the underscore from the name) 
if this might be popular.

Oh, it's also not that well tested, so proceed with caution and provide 
feedback if you can.


Cheers,
Sendu.


More information about the Bioperl-l mailing list