def sortPeaksByLength(peaks):
    """
    Sort peaks from longer to shoter.
    """
    #sort peaks according to size, from small to big
    peaks = sorted( peaks, key=lambda peak: peak.length )
    return peaks