sleuth_resultsR Documentation

Extract Wald or Likelihood Ratio test results from a sleuth object

Description

This function extracts Wald or Likelihood Ratio test results from a sleuth object.

Usage

sleuth_results(obj, test, test_type = "wt", which_model = "full",
  rename_cols = TRUE, show_all = TRUE,
  pval_aggregate = obj$pval_aggregate, ...)

Arguments

obj

a sleuth object

test

a character string denoting the test to extract. Possible tests can be found by using models(obj).

test_type

'wt' for Wald test or 'lrt' for Likelihood Ratio test.

which_model

a character string denoting the model. If extracting a wald test, use the model name. Not used if extracting a likelihood ratio test.

rename_cols

if TRUE will rename some columns to be shorter and consistent with the vignette

show_all

if TRUE will show all transcripts (not only the ones passing filters). The transcripts that do not pass filters will have NA values in most columns.

pval_aggregate

if TRUE and both target_mapping and aggregation_column were provided, to sleuth_prep, use lancaster's method to aggregate p-values by the aggregation_column.

...

advanced options for sleuth_results. See details.

Details

The columns returned by this function will depend on a few factors: whether the test is a Wald test or Likelihood Ratio test, and whether pval_aggregate is TRUE.

The sleuth model is a measurement error in the response model. It attempts to segregate the variation due to the inference procedure by kallisto from the variation due to the covariates – the biological and technical factors of the experiment (represented by the columns in obj$sample_to_covariates). For the Wald test, the 'b' column represents the estimate of the selected coefficient. In the default setting, it is analogous to, but not equivalent to, the fold-change. The transformed values are on the natural-log scale, and so the the estimated coefficient is also on the natural-log scale. This value is taking into account the estimated 'inferential variance' estimated from the kallisto bootstraps.

If the user wishes to get gene-level results from this function, there are two ways of doing so:

An important note if pval_aggregate or the old gene_mode is TRUE: when combining the gene annotations from obj$target_mapping, all of the columns except for the transcript ID, obj$target_mapping$target_id, will be included. If there are transcript-level entries for any of the other columns, this will result in duplicate rows in the results table (usually an undesirable result).

Here are advanced options for customizing the p-value aggregation procedure:

Value

If pval_aggregate is FALSE, returns a data.frame with the following columns:

If pval_aggregate is TRUE, returns a data.frame with the following columns:

See Also

sleuth_wt and sleuth_lrt to compute tests, models to view which models, tests to view which tests were performed (and can be extracted)

Examples

models(sleuth_obj) # for this example, assume the formula is ~condition,
                     and a coefficient is IP
results_table <- sleuth_results(sleuth_obj, 'conditionIP')