def shortest_sequence(msa):
    """
    Returns the shortest sequence in the provided MultipleSequenceAlignment
    object.
    """
    shortest = None
    for sequence in msa.sequences:
        if not shortest or shortest > len(sequence.ungapped()):
            shortest = len(sequence.ungapped())
    return shortest
