[Bioperl-l] Feature/Location

David Block dblock@gene.pbi.nrc.ca
Tue, 23 Jan 2001 12:00:37 -0600 (CST)


On Tue, 23 Jan 2001, Ewan Birney wrote:

> 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
> > > 

Okay, for clarity, this only is relevant when there is a SplitLocationI
situation, correct?  So the implementation of SplitLocationI was going to
be an array of simple LocationI's?  If not, then what I'm talking about is
irrelevant.

> > 
> > 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...

Different conventions for different situations?  What I was talking about
was the two different situations:
1) gene drawing, I want to know all the locations that are 'gene' so I can
draw them somehow -> sub_locations gives me a list of simple locations
that I can iterate through.  I don't care about the nature of the exons I
am drawing, just that they belong to a gene.

2) exon interrogation, I want to examine each exon individually.  Now I
want the gene/transcript's exons method to give me each exon.  Each of
those also has a location.  The exon's location method links to the
location object that is linked to by the sub_location call, so there is no
duplication of data.

And if any of these exon locations are fuzzy or split, etc., the location
object gives us that.


> 
> But... I guess I should roll with the has-a decision. 

Yes, you should (hee, hee, we win).

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...

I think that's what I was thinking too, isn't it?

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

No comment.
> 
> 
> 
> 
> 
> 
> > 
> > -- 
> > 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>. 
> -----------------------------------------------------------------
> 

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