use array_agg order by to sort samples