def add_to_result_table(result_table, motif_name, seq, postfilter, reads_blue, reads_grey, confidence):
    """
    Create report table in pandas
    :param result_table: pandas.DataFrame - table with the results
    :param motif_name: str- motif name
    :param seq: str - sequence
    :param postfilter: dict - postfilter options
    :param reads_blue: int - number of full reads
    :param reads_grey: int - number of partial reads
    :param confidence: tuple - allele predictions and their confidence
    :return: pandas.DataFrame - table with all the results
    """
    # write the results into a table in TSV format
    result_table.at['%s_%s' % (motif_name, postfilter['index_rep']), 'Motif'] = motif_name
    result_table.at['%s_%s' % (motif_name, postfilter['index_rep']), 'Sequence'] = seq
    result_table.at['%s_%s' % (motif_name, postfilter['index_rep']), 'Repetition index'] = postfilter['index_rep']
    result_table.at['%s_%s' % (motif_name, postfilter['index_rep']), 'Postfilter bases'] = postfilter['bases']
    result_table.at['%s_%s' % (motif_name, postfilter['index_rep']), 'Postfilter repetitions'] = postfilter['repetitions']
    result_table.at['%s_%s' % (motif_name, postfilter['index_rep']), 'Reads (full)'] = reads_blue
    result_table.at['%s_%s' % (motif_name, postfilter['index_rep']), 'Reads (partial)'] = reads_grey

    if confidence is not None:
        result_table.at['%s_%s' % (motif_name, postfilter['index_rep']), 'Overall confidence'] = confidence[0]
        result_table.at['%s_%s' % (motif_name, postfilter['index_rep']), 'Allele 1 prediction'] = confidence[1]
        result_table.at['%s_%s' % (motif_name, postfilter['index_rep']), 'Allele 2 prediction'] = confidence[2]
        result_table.at['%s_%s' % (motif_name, postfilter['index_rep']), 'Allele 1 confidence'] = confidence[3]
        result_table.at['%s_%s' % (motif_name, postfilter['index_rep']), 'Allele 2 confidence'] = confidence[4]
        result_table.at['%s_%s' % (motif_name, postfilter['index_rep']), 'Both Background prob.'] = confidence[5]
        result_table.at['%s_%s' % (motif_name, postfilter['index_rep']), 'One Background prob.'] = confidence[6]
        result_table.at['%s_%s' % (motif_name, postfilter['index_rep']), 'Background Expanded prob.'] = confidence[7]
        result_table.at['%s_%s' % (motif_name, postfilter['index_rep']), 'One Expanded prob.'] = confidence[8]

    return result_table