def cdp_file_output(in_seq_name1, in_seq_name2, ref, nt, ext):
    """
    Generate output file name
    :param in_seq_name1: sample name/s (str)
    :param in_seq_name2: sample name/s (str)
    :param ref: reference name (str)
    :param nt: aligned read length (int)
    :param ext: extension (ie. csv or pdf)
    :return: output filename (str)
    """
    file_name = "{0}_{1}_{2}_{3}.{4}".format(in_seq_name1,
                                             in_seq_name2,
                                             ref,
                                             nt,
                                             ext)
    if len(file_name) > 240:
        print("Auto-generated file name too long\n")
        file_name = "{0}_{1}.{2}".format(ref, nt, ext)
        print("{0} used instead\n".format(file_name))
    return file_name