run_limma_replicate: Run limma contrasts with optional probe replicates

run_limma_replicateR Documentation

Run limma contrasts with optional probe replicates

Description

Run limma contrasts with optional probe replicates

Usage

run_limma_replicate(
  imatrix,
  idesign,
  icontrasts,
  weights = NULL,
  robust = FALSE,
  adjust.method = "BH",
  confint = FALSE,
  trim_colnames = c("t", "B", "F", "sca.t"),
  adjp_cutoff = 0.05,
  p_cutoff = NULL,
  fold_cutoff = 1.5,
  int_adjp_cutoff = adjp_cutoff,
  int_p_cutoff = p_cutoff,
  int_fold_cutoff = fold_cutoff,
  mgm_cutoff = NULL,
  ave_cutoff = NULL,
  block = NULL,
  rowData_df = NULL,
  collapse_by_gene = FALSE,
  correlation = NULL,
  posthoc_test = c("none", "DEqMS"),
  posthoc_args = list(DEqMS = list(PSM_counts = NULL, fit.method = "loess")),
  seed = 123,
  verbose = FALSE,
  ...
)

Arguments

confint

logical passed to limma::topTable(), which defines whether to return confidence intervals for each log2 fold change.

adjp_cutoff, p_cutoff, fold_cutoff, mgm_cutoff, ave_cutoff

numeric values representing the appropriate statistical threshold, or NULL when a threshold should not be applied.

int_adjp_cutoff, int_p_cutoff, int_fold_cutoff

numeric thresholds to apply only to interaction contrasts.

rowData_df

data.frame representing optional rowData annotation to be retained in the resulting stat data.frame. This argument is usually defined using rowData_colnames in se_contrast_stats(), which uses corresponding columns from rowData(se).

collapse_by_gene

logical indicating whether to apply collapse_stats_by_gene which chooses one "best" exemplar per gene when there are multiple rows that represent the same gene.

correlation

numeric or NULL passed to limma::lmFit(). Note that when block is defined (and non-empty), and when correlation=NULL, the correlation will be calculated by calling limma::duplicateCorrelation().

seed

numeric value used to define set.seed() for reproducibility. To avoid setting seed, use seed=NULL.

verbose

logical indicating whether to print verbose output.

Details

This function is called by se_contrast_stats() to perform the comparisons defined as contrasts. The se_contrast_stats() function operates on a SummarizedExperiment object, this function operates on the numeric matrix values directly.

This function also calls ebayes2dfs() which extracts each contrast result as a data.frame, whose column names are modified to include the contrast names.

This function optionally (not yet ported from previous implementation) detects replicate probes, and performs the internal correlation calculations recommended by ⁠limma user guide⁠ for replicate probes. In that case, it detects each level of probe replication so that each can be properly calculated. For example, Agilent human 4x44 arrays often contain a large number of probes with 8 replicates; a subset of probes with 4 replicates; then the remaining probes (the majority overall) have only one replicate each. In that case, this function splits data into 8-replicate, 4-replicate, and 1-replicate subsets, calculates correlations on the 8-replicate and 4-replicate subsets separately, then runs limma calculations on the three subsets independently, then merges the results into one large table. The end result is that the final table contains one row per unique probe after adjusting for probe replication properly in each scenario. As the Agilent microarray layout is markedly less widely used that in past, the priority to port this methodology is quite low.

Value

list with the following entries:

  • "stats_df": data.frame with all individual data.frame per contrast, merged together.

  • "stats_df": list of individual data.frame per contrast, each result is the output from ebayes2dfs().

  • "rep_fits": list of various intermediate model fits, dependent upon whether limma, limma-voom, or limma-DEqMS were used.

See Also

Other jamses stats: ebayes2dfs(), format_hits(), handle_na_values(), hit_array_to_list(), process_sestats_to_hitim(), save_sestats(), se_contrast_stats(), sestats_to_dfs(), sestats_to_df(), voom_jam()


jmw86069/jamses documentation built on Nov. 4, 2024, 9:25 p.m.