Learn R Programming

sleuth (version 0.29.0)

sleuth_prep: Constructor for a 'sleuth' object

Description

A sleuth is a group of kallistos. Borrowing this terminology, a 'sleuth' object stores a group of kallisto results, and can then operate on them while accounting for covariates, sequencing depth, technical and biological variance.

Usage

sleuth_prep(sample_to_covariates, full_model = NULL,
  filter_fun = basic_filter, target_mapping = NULL, max_bootstrap = NULL,
  norm_fun_counts = norm_factors, norm_fun_tpm = norm_factors,
  aggregation_column = NULL, read_bootstrap_tpm = FALSE,
  extra_bootstrap_summary = FALSE, transformation_function = log_transform,
  num_cores = max(1L, parallel::detectCores() - 1L), ...)

Arguments

sample_to_covariates

a data.frame which contains a mapping from sample (a column) to some set of experimental conditions or covariates. The column path is also required, which is a character vector where each element points to the corresponding kallisto output directory. The column sample should be in the same order as the corresponding entry in path.

full_model

an R formula which explains the full model (design) of the experiment OR a design matrix. It must be consistent with the data.frame supplied in sample_to_covariates. You can fit multiple covariates by joining them with '+' (see example)

filter_fun

the function to use when filtering.

target_mapping

a data.frame that has at least one column 'target_id' and others that denote the mapping for each target. if it is not NULL, target_mapping is joined with many outputs where it might be useful. For example, you might have columns 'target_id', 'ensembl_gene' and 'entrez_gene' to denote different transcript to gene mappings.

max_bootstrap

maximum number of bootstrap values to read for each transcript.

norm_fun_counts

a function to perform between sample normalization on the estimated counts.

norm_fun_tpm

a function to perform between sample normalization on the TPM

aggregation_column

a string of the column name in target_mapping to aggregate targets

read_bootstrap_tpm

read and compute summary statistics on bootstraps on the TPM. NOTE: Unnecessary for typical analyses

extra_bootstrap_summary

if TRUE, compute extra summary statistics needed for some plots (e.g. plot_bootstrap). NOTE: Unnecessary for typical analyses

transformation_function

the transformation that should be applied to the normalized counts. Default is 'log(x+0.5)' (i.e. natural log with 0.5 offset) NOTE: be sure you know what you're doing before you change this.

num_cores

an integer of the number of computer cores mclapply should use to speed up sleuth preparation

...

additional arguments passed to the filter function

Value

a sleuth object containing all kallisto samples, metadata, and summary statistics

See Also

sleuth_fit to fit a model, sleuth_wt or sleuth_lrt to perform hypothesis testing

Examples

Run this code
# NOT RUN {
# Assume we have run kallisto on a set of samples, and have two treatments,
genotype and drug.
colnames(s2c)
# [1] "sample"  "genotype"  "drug"  "path"
so <- sleuth_prep(s2c, ~genotype + drug)
# }

Run the code above in your browser using DataLab