def translate(rec):
    """
    Translates a BioPython Sequence record
    """
    # Truncate to nearest codon
    end = len(rec.seq) // 3 * 3
    rec.seq = rec.seq[:end].translate()
    rec.description = f"translated {rec.description}"
    return rec