[Bioperl-l] Feature/Location

Ewan Birney birney@ebi.ac.uk
Tue, 23 Jan 2001 16:45:34 +0000 (GMT)


On Tue, 23 Jan 2001, David Block wrote:

> > 
> > I updated the wiki - please feel free to make corrections, clarifications,
> > or to elaborated the interfaces.  SplitLocationI will have a method 
> > sub_Locations which returns the list of LocationI objects that represent
> > the sub locations of the, well, location.  In code terms -
> > 
> > # get a $geneobj somehow
> > my $location = $geneobj->location;
> > if( $location->isa('Bio::Location::SplitLocationI') ) {	
> > 	foreach my $exon ( $location->sub_locations() ){ 
> > 		print "exon at ", $exon->start, "..", $exon->end, "\n";
> > 	}
> > }
> > 
> > One problem with this approach - what if I want to actually have the real
> > Exon object....  Must I instead iterate through what is returned 
> > by sub_Features?  Does the SeqFeature::GeneStructureI instead handle all
> > of this and I should instead call $geneobj->exons() not touching the
> > Location objects (makes most sense to me).
> > 
> > -jason
> > 
> 
> That would be good.  Then you could call that exon's location method to
> get the location object of the exon.  So you have two routes to the
> start/end pair.  That sounds good to me.

<<Ewan Winces>>

I think we are giving ourselves *alot of rope* to hang ourselves here and
we will end up with different conventions about how to descend these
objects...

But... I guess I should roll with the has-a decision. So... my view here
would be that in "stupid" implementations location->sub_locations() give 
separate location objects, but in "smart" implementations (perhaps
bioperl's gene/transcript object?) is gives the same location object as
the exon, therefore guarenteeing that whichever route you take to an
exon's location, you get the same thing...


ie... this is up to the implmentation, and the generic implementation has
to be "stupid" I guess....






> 
> -- 
> David Block
> dblock@gene.pbi.nrc.ca
> http://bioinfo.pbi.nrc.ca/dblock/wiki
> Plant Biotechnology Institute
> National Research Council of Canada
> Saskatoon, Saskatchewan
> 
> 
> 

-----------------------------------------------------------------
Ewan Birney. Mobile: +44 (0)7970 151230, Work: +44 1223 494420
<birney@ebi.ac.uk>. 
-----------------------------------------------------------------