sleuth_prepR Documentation

Constructor for a 'sleuth' object


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.


sleuth_prep(sample_to_covariates, full_model = NULL, target_mapping = NULL,
  aggregation_column = NULL, num_cores = max(1L, parallel::detectCores() -
  1L), ...)



a data.frame which contains a mapping from sample (a required 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.


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)


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. Note that sleuth_prep will treat all columns as having the 'character' data type.


a string of the column name in target_mapping to aggregate targets (typically to summarize the data on the gene level). The aggregation is done using a p-value aggregation method when generating the results table. See sleuth_results for more information.


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


any of several other arguments that can be used as advanced options for sleuth preparation. See details.


This method takes a list of samples with kallisto results and returns a sleuth object with the defined normalization of the data across samples (default is the DESeq method; See basic_filter), and then the defined transformation of the data (default is log(x + 0.5)). This also collects all of the bootstraps for the modeling done using sleuth_fit. This function also takes several advanced options that can be used to customize your analysis. Here are the advanced options for sleuth_prep:

Extra arguments related to Bootstrap Summarizing:

Advanced Options for Filtering:

Advanced Options for the Normalization Step: (NOTE: Be sure you know what you're doing before you use these options)

Advanced Options for the Transformation Step: (NOTE: Be sure you know what you're doing before you use these options)

Advanced Options for Gene Aggregation:


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


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