Пример #1
0
def run_paired_t(data_generator):
    """Run paired t test on data."""
    test_stats, pvals = [], []
    for b_data, a_data in data_generator:
        test_stat, pval = t_paired(b_data, a_data)
        test_stats.append(test_stat)
        pvals.append(pval)
    return test_stats, pvals
Пример #2
0
def run_paired_t(data_generator):
    """Run paired t test on data."""
    test_stats, pvals = [], []
    for b_data, a_data in data_generator:
        test_stat, pval = t_paired(b_data, a_data)
        test_stats.append(test_stat)
        pvals.append(pval)
    return test_stats, pvals
Пример #3
0
def run_single_paired_T_test(OTU, mapping_data, header, individual_column,\
    timepoint_zero_column, otu_table, ignore_val, filt):
    """run the paired T test on a single OTU
    """
    timepoint_zero_vals, after_treatment_vals = get_single_paired_T_values(OTU,
        mapping_data, header, individual_column, timepoint_zero_column,
        otu_table, ignore_val)
    #get the number of samples from the category mapping and multiply by the filter
    #two samples per individual so divide by 2
    filt = (filt*len(mapping_data))/2
    if len(timepoint_zero_vals) >= round(filt):
        t, prob = t_paired(timepoint_zero_vals, after_treatment_vals,
                           tails=None, exp_diff=0)
        return t, prob, after_treatment_vals, len(after_treatment_vals)
    else:
        return None
Пример #4
0
def run_single_paired_T_test(OTU, mapping_data, header, individual_column,\
    timepoint_zero_column, otu_table, ignore_val, filt):
    """run the paired T test on a single OTU
    """
    timepoint_zero_vals, after_treatment_vals = get_single_paired_T_values(
        OTU, mapping_data, header, individual_column, timepoint_zero_column,
        otu_table, ignore_val)
    #get the number of samples from the category mapping and multiply by the filter
    #two samples per individual so divide by 2
    filt = (filt * len(mapping_data)) / 2
    if len(timepoint_zero_vals) >= round(filt):
        t, prob = t_paired(timepoint_zero_vals,
                           after_treatment_vals,
                           tails=None,
                           exp_diff=0)
        return t, prob, after_treatment_vals, len(after_treatment_vals)
    else:
        return None