[Bioperl-l] Feature/Location

David Block dblock@gene.pbi.nrc.ca
Tue, 23 Jan 2001 09:56:08 -0600 (CST)


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

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