Learn R Programming

scater (version 1.0.4)

readKallistoResultsOneSample: Read kallisto results for a single sample into a list

Description

Read kallisto results for a single sample into a list

Usage

readKallistoResultsOneSample(directory, read_h5 = FALSE, kallisto_version = "current")

Arguments

directory
character string giving the path to the directory containing the kallisto results for the sample.
read_h5
logical, if TRUE then read in bootstrap results from the HDF5 object produced by kallisto.
kallisto_version
character string indicating whether or not the version of kallisto to be used is "pre-0.42.2" or "current". This is required because the kallisto developers changed the output file extensions and added features in version 0.42.2.

Value

A list with two elements: (1) a data.frame abundance with columns for 'target_id' (feature, transcript, gene etc), 'length' (feature length), 'eff_length' (effective feature length), 'est_counts' (estimated feature counts), 'tpm' (transcripts per million) and possibly many columns containing bootstrap estimated counts; and (2) a list run_info with details about the kallisto run that generated the results.

Details

The directory is expected to contain results for just a single sample. Putting more than one sample's results in the directory will result in unpredictable behaviour with this function. The function looks for the files (with the default names given by kallisto) 'abundance.txt', 'run_info.json' and (if read_h5=TRUE) 'abundance/h5'. If these files are missing, or if results files have different names, then this function will not find them.

Examples

Run this code
# If kallisto results are in the directory "output", then call:
# readKallistoResultsOneSample("output")

Run the code above in your browser using DataLab