def reorder_exons(exon_ids):
	"""
	Reorder exons if they were out of order.

	Parameters:
		exon_ids (list of str): List of exons 'chrom_coord1_coord2_strand_exon'

	Returns:
		exons (list of str): List of same exon IDs ordered based on strand
			and genomic location
	"""
	strand = exon_ids[0].split('_')[-2]
	coords = [int(i.split('_')[-4]) for i in exon_ids]
	exons = sorted(zip(exon_ids, coords), key=lambda x: x[1])
	exons = [i[0] for i in exons]
	if strand == '-':
		exons.reverse()
	return exons