def classfy_orf(orfiv, cdsiv):
    """
	define the orf type according the orf position related to cds region
	"""
    if not cdsiv:
        orftype = 'novel'
    else:
        orftype = 'annotated'
        if orfiv.end == cdsiv.end:
            orftype = 'annotated'
        elif orfiv.end < cdsiv.start:
            orftype = 'uORF'
        elif orfiv.start > cdsiv.end:
            orftype = 'dORF'
        elif orfiv.start < cdsiv.start and orfiv.end < cdsiv.end and orfiv.end > cdsiv.start:
            orftype = 'Overlap_uORF'
        elif cdsiv.start < orfiv.start < cdsiv.end and orfiv.end > cdsiv.end:
            orftype = 'Overlap_dORF'
        elif cdsiv.start < orfiv.start < orfiv.end < cdsiv.end and (cdsiv.
            end - orfiv.end) % 3 != 0:
            orftype = 'internal'
    return orftype
