def sort_sample_ids_by_mapping_value(mapping_file, field, field_type_f=float):
 (data, headers, comments) = parse_mapping_file(mapping_file)
 try:
  column = headers.index(field)
 except ValueError:
  raise ValueError(('Column (%s) not found in mapping file headers:\n %s' % (field, ' '.join(headers))))
 results = [(e[0], field_type_f(e[column])) for e in data]
 results.sort(key=itemgetter(1))
 return results

def sort_sample_ids_by_mapping_value ( mapping_file , field , field_type_f = float ) : ( data , headers , comments ) = parse_mapping_file ( mapping_file ) try : column = headers . index ( field ) except ValueError : raise ValueError ( ( 'Column (%s) not found in mapping file headers:\n %s' % ( field , ' ' . join ( headers ) ) ) ) results = [ ( e [ 0 ] , field_type_f ( e [ column ] ) ) for e in data ] results . sort ( key = itemgetter ( 1 ) ) return results
return list of sample ids sorted by ascending value from mapping file .