limma_pairwise: Set up a model matrix and set of contrasts for pairwise...

View source: R/de_limma.R

limma_pairwiseR Documentation

Set up a model matrix and set of contrasts for pairwise comparisons using voom/limma.

Description

Creates the set of all possible contrasts and performs them using voom/limma.

Usage

limma_pairwise(
  input = NULL,
  conditions = NULL,
  batches = NULL,
  model_cond = TRUE,
  model_batch = TRUE,
  model_intercept = FALSE,
  alt_model = NULL,
  extra_contrasts = NULL,
  annot_df = NULL,
  libsize = NULL,
  which_voom = "limma",
  limma_method = "ls",
  limma_robust = FALSE,
  voom_norm = "quantile",
  limma_trend = FALSE,
  force = FALSE,
  keepers = NULL,
  ...
)

Arguments

input

Dataframe/vector or expt class containing count tables, normalization state, etc.

conditions

Factor of conditions in the experiment.

batches

Factor of batches in the experiment.

model_cond

Include condition in the model?

model_batch

Include batch in the model? If this is a character instead of a logical, then it is passed to all_adjusers() to attempt to find model parameters which describe surrogate variables in the data.

model_intercept

Perform a cell-means or intercept model? A little more difficult for me to understand. I have tested and get the same answer either way.

alt_model

Separate model matrix instead of the normal condition/batch.

extra_contrasts

Some extra contrasts to add to the list. This can be pretty neat, lets say one has conditions A,B,C,D,E and wants to do (C/B)/A and (E/D)/A or (E/D)/(C/B) then use this with a string like: "c_vs_b_ctrla = (C-B)-A, e_vs_d_ctrla = (E-D)-A, de_vs_cb = (E-D)-(C-B),"

annot_df

Data frame for annotations.

libsize

I've recently figured out that libsize is far more important than I previously realized. Play with it here.

which_voom

Try out different invocations of voom.

limma_method

And different invocations of limma itself.

limma_robust

Pass along the robust args for limma?

voom_norm

Use a specific normalization for voom?

limma_trend

Include a trendline in the limma plot?

force

Force data which may not be appropriate for limma into it?

keepers

Choose a set of contrasts instead of all.

...

Use the elipsis parameter to feed options to write_limma().

Value

List including the following information: macb = the mashing together of condition/batch so you can look at it macb_model = The result of calling model.matrix(~0 + macb) macb_fit = The result of calling lmFit(data, macb_model) voom_result = The result from voom() voom_design = The design from voom (redundant from voom_result, but convenient) macb_table = A table of the number of times each condition/batch pairing happens cond_table = A table of the number of times each condition appears (the denominator for the identities) batch_table = How many times each batch appears identities = The list of strings defining each condition by itself all_pairwise = The list of strings defining all the pairwise contrasts contrast_string = The string making up the makeContrasts() call pairwise_fits = The result from calling contrasts.fit() pairwise_comparisons = The result from eBayes() limma_result = The result from calling write_limma()

See Also

[limma] [Biobase] [deseq_pairwise()] [edger_pairwise()] [basic_pairwise()] DOI:10.1093/nar/gkv007

Examples

## Not run: 
 pretend <- limma_pairwise(expt)

## End(Not run)

elsayed-lab/hpgltools documentation built on May 9, 2024, 5:02 a.m.