[Bioperl-l] Inheritance Bio::Map::Physical

Keith Anthony Boroevich kaboroev at sfu.ca
Wed Nov 15 17:14:14 UTC 2006


Thanks, this is exactly what I was looking for.  I didn't know how to
get Bio::MapIO to return "my" class and I was unaware that bless could
be used in such a manner.  Not to nit-pick, but just in case anyone else
has such a problem, quotes are required around the class.
bless $fpc_map "Extended::FPC";

Nancy Hansen wrote:
>
>
> You're right that your Extended::FPC should inherit from
> Bio::Map::Physical, but you really don't want to use it to parse the fpc
> file (Bio::MapIO does that just fine, and gets all the data you need into
> the Bio::Map::Physical object).  Try retrieving a Bio::Map::Physical
> object using Bio::MapIO, then forcing it to be an Extended::FPC, which
> will allow it to use your method(s):
>
> my $mapio = Bio::MapIO->new(-format => 'fpc',
>                             -file => $ARGV[0],
>                             -readcor => 1);
>
> my $fpc_map = $mapio->next_map();
>
> bless $fpc_map, Extended::FPC;
> my $ra_bands = $fpc_map->my_new_extended_method();
>   

-- 
><)))°> -cGRASP- <°(((><
Keith Anthony Boroevich
Simon Fraser University
Tel: 604-268-7276




More information about the Bioperl-l mailing list