[gt-users] get feature by ID

Sascha Steinbiss steinbiss at zbh.uni-hamburg.de
Thu Feb 12 10:38:30 CET 2009


Brent Pedersen wrote:
> i do this often enough that i just wrote a FeatureIndexMemory subclass
> to automatically
> create a dict with key => value of  ID => gt_pointer. then the
> FeatureNode object is not
> created until it's actually requested.
> i also had some fun abusing the python slicing syntax. usage and
> implementation here:
> http://gist.github.com/62359
> 
> it currently doesn't handle potentially repeated ID's... but i'm
> usually just dealing with a single file at a time.

Looks very convenient and intuitive (python-like) to use. If this can be 
extended to handle ID clashes as well (e.g. by using the filename as an 
additional key which is optional if there is only one file), it may find 
its way into the official bindings. Any comments?

Sascha

-- 
Sascha Steinbiss
Center for Bioinformatics
University of Hamburg
Bundesstr. 43
20146 Hamburg
Germany

Email:  steinbiss at zbh.uni-hamburg.de
URL:    http://www.zbh.uni-hamburg.de/steinbiss
Phone:  +49 (40) 42838 7322
FAX:    +49 (40) 42838 7312



More information about the gt-users mailing list