[Bioperl-l] Feature/Location

Jason Stajich jason@chg.mc.duke.edu
Tue, 23 Jan 2001 10:41:52 -0500 (EST)


On Tue, 23 Jan 2001, Hilmar Lapp wrote:

> Ewan Birney wrote:
> > 
> > Ok. It looks like I have to conceed the has-a location, as long as I am
> > allowed to return $self for C extensions for ensembl ;)
> > 
> > I think I have "won" on the no exception throwing (???)
> > 
> 
> I think it's BioPerl that won -- by all the feedback we got. We
> can have more confidence now that it makes some sense what we
> code. Thanks to everyone, and sorry for forgetting you, Mark, I'm
> glad you stepped in without being asked.
> 
> I see that exception throwing in ->start()/end() is not the best
> idea for many applications. In a sense the situation may be
> similar to SeqIO, where we now have client-controllable severity
> level of putative format violations (which in fact mostly are
> BioPerl incapabilities). So, we can design the start/end
> implementation along a client-controllable policy, with a relaxed
> default.

I'll see how that shakes out as we start to look at implementation.  
Also - should our locations go into a new directory?

Interfaces - 
Bio::Location::LocationI
Bio::Location::SplitLocationI
Bio::Location::FuzzyLocationI

Implementations -
Bio::Location::SimpleLocation
Bio::Location::SplitLocation
Bio::Location::FuzzyLocation

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

> 
> 	Hilmar
> -- 
> -----------------------------------------------------------------
> Hilmar Lapp                                email: hlapp@gmx.net
> GNF, San Diego, Ca. 92122                  phone: +1 858 812 1757
> -----------------------------------------------------------------
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l@bioperl.org
> http://bioperl.org/mailman/listinfo/bioperl-l
> 

Jason Stajich
jason@chg.mc.duke.edu
Center for Human Genetics
Duke University Medical Center 
http://www.chg.duke.edu/