code: def best_hits(self):
          
          self.quality_sort()
  
          best_hits = dict((query, next(blines)) for (query, blines) in \
                          groupby(self, lambda x: x.query))
  
          self.ref_sort()
  
          return best_hits
docs: returns a dict with query => best mapped position