from Bio import SeqIO
def check_Adapter(file):
    Starting_signal = 0
    seq_equal_signal = 0
    line_signal = 1
    repeat_signal = 1
    seq_info = open(file,"r")
    seq_length = 0
    while True:
        line = seq_info.readline().rstrip()
        if not line:break
        if line_signal != 2:
            if line_signal == 4:
                line_signal = 1
            else:
                line_signal += 1
            continue
        else:
            if Starting_signal == 0:
                seq_length = len(line)
                Starting_signal += 1
            else:
                if len(line) == seq_length:
                    seq_equal_signal += 1
                    if seq_equal_signal == 100:
                        return True
                else:
                    if repeat_signal == 3:
                        break
                    else:
                        seq_length = 0
                        repeat_signal += 1
            line_signal += 1
    return False

if __name__ == '__main__':
    import argparse
    parser = argparse.ArgumentParser()
    parser.add_argument("--input_file", "-i",required=True,help="use_for_rfam")
    args = parser.parse_args()
    input_file_arg = args.input_file
    print(check_Adapter(input_file_arg))


