get_salmon_meta: Get Salmon metadata and aux info into a data.frame

get_salmon_metaR Documentation

Get Salmon metadata and aux info into a data.frame

Description

Get Salmon metadata and aux info into a data.frame

Usage

get_salmon_meta(metafile, exclude_hashes = TRUE, ...)

Arguments

metafile

character vector of one or more files, usually the full file path to the meta_info.json file after running Salmon quant. The path metafile should be the path to any output file from one Salmon quant analysis.

exclude_hashes

logical indicating whether to drop columns that contain file hashes.

...

additional arguments are ignored.

Details

This function takes a file path to one or more Salmon output files, uses that path to locate the full set of available files, loads data from each of the discovered files, and returns the results in a data.frame format.

This function uses rprojroot::find_root() to find the root directory, defined as the directory that contains the file "cmd_info.json". The path to "meta_info.json" is constructed relative to that location.

Recognized files:

  • meta_info.json - typically in a subdirectory aux_info/meta_info.json

  • cmd_info.json - typically in the same directory as the aux_info directory.

If a relative path to "cmd_info.json" cannot be determined, this function returns NULL.

When the input metafile includes multiple files, only the unique Salmon root directories are returned.

This function uses jsonlite to read each JSON file, which is converted to a data.frame. Any JSON fields that contain multiple values are comma-delimited using jamba::cPaste() in order to fit on one row in the data.frame.

Value

data.frame whose number of rows is equal to the number of unique Salmon root directories in the input metafile. For any input metafile not found, the output is NULL.

See Also

Other jam nextgen sequence functions: get_salmon_root(), parse_salmon_flenfile(), save_salmon_qc_xlsx()

Examples

cmdinfopath <- system.file("data", "salmonOut", "cmd_info.json", package="platjam");
if (nchar(cmdinfopath) > 0) {
   get_salmon_meta(cmdinfopath);
}


jmw86069/platjam documentation built on Sept. 26, 2024, 3:31 p.m.