edger_pairwise: Set up a model matrix and set of contrasts to do pairwise...

View source: R/de_edger.R

edger_pairwiseR Documentation

Set up a model matrix and set of contrasts to do pairwise comparisons using EdgeR.

Description

This function performs the set of possible pairwise comparisons using EdgeR.

Usage

edger_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,
  force = FALSE,
  keepers = NULL,
  edger_method = "long",
  ...
)

Arguments

input

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

conditions

Factor of conditions in the experiment.

batches

Factor of batches in the experiment.

model_cond

Include condition in the experimental model?

model_batch

Include batch in the model? In most cases this is a good thing(tm).

model_intercept

Use an intercept containing model?

alt_model

Alternate experimental model to use?

extra_contrasts

Add some extra contrasts to add to the list of pairwise contrasts. 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

Annotation information to the data tables?

force

Force edgeR to accept inputs which it should not have to deal with.

keepers

Ask for a specific set of contrasts instead of all.

edger_method

I found a couple/few ways of doing edger in the manual, choose with this.

...

The elipsis parameter is fed to write_edger() at the end.

Details

Like the other _pairwise() functions, this attempts to perform all pairwise contrasts in the provided data set. The details are of course slightly different when using EdgeR. Thus, this uses the function choose_binom_dataset() to try to ensure that the incoming data is appropriate for EdgeR (if one normalized the data, it will attempt to revert to raw counts, for example). It continues on to extract the conditions and batches in the data, choose an appropriate experimental model, and run the EdgeR analyses as described in the manual. It defaults to using an experimental batch factor, but will accept a string like 'sva' instead, in which case it will use sva to estimate the surrogates, and append them to the experimental design. The edger_method parameter may be used to apply different EdgeR code paths as outlined in the manual. If you want to play with non-standard data, the force argument will round the data and shoe-horn it into EdgeR.

Value

List including the following information: contrasts = The string representation of the contrasts performed. lrt = A list of the results from calling glmLRT(), one for each contrast. contrast_list = The list of each call to makeContrasts() I do this to avoid running into the limit on # of contrasts addressable by topTags() all_tables = a list of tables for the contrasts performed.

See Also

[edgeR] [deseq_pairwise()] [ebseq_pairwise()] [limma_pairwise()] [basic_pairwise()] DOI:10.12688/f1000research.8987.2

Examples

## Not run: 
 expt <- create_expt(metadata = "metadata.xlsx", gene_info = annotations)
 pretend <- edger_pairwise(expt, model_batch = "sva")

## End(Not run)

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