[Bioperl-l] BioPerl object deep copy

Chris Fields cjfields at illinois.edu
Mon Sep 28 16:29:14 UTC 2009


As Spiros points out, Clone works in almost all cases and is very fast  
(XS-based I think).  IIRC the only time it borks out is if there is a  
code ref, as with Bio::Tree::Tree, but if it doesn't work you should  
get an error indicating the problem.

chris

On Sep 28, 2009, at 11:05 AM, Mark A. Jensen wrote:

> For some relatively careful examples of cloning code, you can look  
> at the source for Bio::Tree::TreeFunctionsI::clone
> and Bio::Restriction::Enzyme::clone (not clone_depr)
> MAJ
>
> ----- Original Message ----- From: "Paolo Pavan" <paolo.pavan at gmail.com 
> >
> To: <bioperl-l at lists.open-bio.org>
> Sent: Monday, September 28, 2009 11:51 AM
> Subject: [Bioperl-l] BioPerl object deep copy
>
>
>> Hi all,
>> I would like to have just a programming hint, there is a way in
>> bioperl (or just in perl) to get an deep copy or a clone of an  
>> object?
>> That is, I get a new object with all the fields copied one by one.
>> At least, can I do so for a Bio::SeqI or a Bio::AlignI compliant  
>> object?
>> Thank you,
>> Paolo
>> _______________________________________________
>> Bioperl-l mailing list
>> Bioperl-l at lists.open-bio.org
>> http://lists.open-bio.org/mailman/listinfo/bioperl-l
>>
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/bioperl-l




More information about the Bioperl-l mailing list