createTIEC {benchdamic} | R Documentation

## createTIEC

### Description

Extract the list of p-values from the outputs of the differential abundance detection methods to compute several statistics to study the ability to control the type I error.

### Usage

    createTIEC(object)

### Arguments

`object` | Output of the differential abundance tests on mock comparisons. Must follow a specific structure with comparison, method, matrix of p-values, and method's name (See vignette for detailed information).

### Value

A `list` of `data.frame`s:

- `df_pval`3 columns per number_of_features x methods x comparisons rows data.frame. The three columns are called Comparison, pval, and method;

- `df_FPR`5 columns per methods x comparisons rows data.frame. For each set of method and comparison, the proportion of false discoveries, considering 3 threshold (0.01, 0.05, 0.1) are reported;

- `df_QQ`contains the coordinates to draw the QQ-plot to compare the mean observed p-value distribution across comparisons, with the theoretical uniform distribution;

- `df_KS`5 columns and methods x comparisons rows data.frame. For each set of method and comparison, the Kolmogorov-Smirnov test statistics and p-values are reported in KS and KS_pval columns respectively.

### See Also

`createMocks`

### Examples

    # Load some data
    data(ps_stool_16S)

    # Generate the patterns for 10 mock comparison for an experiment
    # (N = 1000 is suggested)
    mocks <- createMocks(nsamples = phyloseq::nsamples(ps_stool_16S), N = 10)
    head(mocks)

    # Add some normalization/scaling factors to the phyloseq object
    my_norm <- setNormalizations(fun = c("norm_edgeR", "norm_CSS"),
        method = c("TMM", "median"))
    ps_stool_16S <- runNormalizations(normalization_list = my_norm,
        object = ps_stool_16S)

    # Initialize some limma based methods
    my_limma <- set_limma(design = ~ group, coef = 2,
        norm = c("TMM", "CSSmedian"))

    # Run methods on mock datasets
    results <- runMocks(mocks = mocks, method_list = my_limma,
        object = ps_stool_16S)

    # Prepare results for Type I Error Control
    TIEC_summary <- createTIEC(results)

    # Plot the results
    plotFPR(df_FPR = TIEC_summary$df_FPR)
    plotQQ(df_QQ = TIEC_summary$df_QQ, zoom = c(0, 0.1))
    plotKS(df_KS = TIEC_summary$df_KS)

[Package benchdamic version 1.0.0 Index]