[Bioperl-l] how to use Storable.pm to save the object?

Will Spooner whs at ebi.ac.uk
Fri Apr 15 04:15:05 EDT 2005


Hi Sally,

If you mean the Bio::Root::Storable module, then you need to modify 
SimpleAlign.pm to include Bio::Root::Storable in its @ISA array. You will 
then be able to call the 'store' method directly on a SimpleAlign 
object. This can be done within a script, e.g.

---
#!/usr/bin/perl
use strict;
use Bio::Root::Storable;
BEGIN{
  require Bio::SimpleAlign;
  unshift @Bio::SimpleAlign::ISA, 'Bio::Root::Storable';
}
my $align = Bio::SimpleAlign->new(-verbose=>1);
my $token = $align->store;
my $align_copy = Bio::SimpleAlign->retrieve($token);
warn( "ORIG $align\n");
warn( "COPY $align_copy\n" );
exit;
---

Will

On Thu, 14 Apr 2005, Sally Li wrote:

> Hi, there,
> 
> Let's say we have an object which is SimpleAlign
> 
> $aln
> 
> How can we store this object using Storable.pm in a
> specific directory? I have difficulty to understand
> the doc in module Storable.pm. 
> 
> Any help will be appreciated!
> 
> Thanks!
> 
> Sally
> 
> 
> 		
> __________________________________ 
> Do you Yahoo!? 
> Yahoo! Small Business - Try our new resources site!
> http://smallbusiness.yahoo.com/resources/
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at portal.open-bio.org
> http://portal.open-bio.org/mailman/listinfo/bioperl-l
> 



More information about the Bioperl-l mailing list