def count_repeat_in_sequences(sequences, repeat_unit, min_occurrences=3, min_fraction_bases_covered=0.8):
    """Count how many of the given sequences support a specific repeat unit.

    Args:
        sequences (str): Iterator over read sequences.
        repeat_unit (str): The repeat unit to search for within the sequences.
        min_occurrences (int): The repeat unit must occur in the sequence at least this many times for the sequence to be counted.
        min_fraction_bases_covered (float): The repeat unit must cover this fraction of the sequence for the sequence to be counted.

    Returns:
        2-tuple: (The number of sequences that contain the repeat unit, The total number of sequences in the input iterator)
    """

    read_count = 0
    total = 0
    for sequence in sequences:
        total += 1
        count = sequence.count(repeat_unit)
        if count >= min_occurrences and count * len(repeat_unit)/len(sequence) >= min_fraction_bases_covered:
            read_count += 1

    return read_count, total