[Bioperl-l] tree copy by-value

Stephen Montgomery sm8 at sanger.ac.uk
Thu Apr 19 09:33:18 EDT 2007


Thanks Sendu!  That is perfect.
Cheers
Stephen

-----Original Message-----
From: Sendu Bala [mailto:bix at sendu.me.uk] 
Sent: 19 April 2007 14:25
To: Stephen Montgomery
Cc: bioperl-l at lists.open-bio.org
Subject: Re: [Bioperl-l] tree copy by-value

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