def get_feature(features, id, tags=('locus_tag', 'gene', 'old_locus_tag')):
 for f in features:
  for key in tags:
   for x in f.qualifiers.get(key, []):
    if (x == id):
     return f
 raise KeyError(id)

def get_feature ( features , id , tags = ( 'locus_tag' , 'gene' , 'old_locus_tag' ) ) : for f in features : for key in tags : for x in f . qualifiers . get ( key , [ ] ) : if ( x == id ) : return f raise KeyError ( id )
search list of seqfeature objects for an identifier under the given tags .