Looks at every RSEM result file and reports what would make the data
unreliable or stop a later step, all at once instead of stopping at the
first problem. Nothing is read into a table and nothing is changed. Use it
before rsem_read() on a new data set, or when rsem_read() stops.
Arguments
- data, metadata, sample_from
As in
rsem_read();metadata = NULLfinds the files.- level
"gene"(*.genes.results) or"isoform"(*.isoforms.results).
Value
A data frame with one row per finding: severity, check,
sample_id (NA for a finding about all files), n (how many rows or
genes) and detail. Zero rows when nothing was found.
Checks
Per file: the files can be read; the ID column (gene_id or
transcript_id) is present; expected_count, TPM and
effective_length are present; the values are numeric, not missing, finite
and not negative; the IDs are not duplicated; the effective lengths that
are 0 (the genes that stop DESeqDataSetFromTximport()); a TPM total that
is not 1e6 (RSEM's TPM adds up to one million per sample, within 0.1%
here); a sample without any expected count.
Across files, compared with the first readable file: the same IDs (an
error where IDs are missing or extra; information where only the order
differs, which rsem_read(allow_reorder = TRUE) accepts); the same
transcripts for each gene (transcript_id(s), compared as sets) in
gene-level files, or the same gene for each transcript in isoform files,
which differ when the files were quantified against different references.
Severity
"ERROR": rsem_read() stops or the files cannot be compared.
"WARNING": the files can be read but the values need care.
"INFO": noted, nothing to fix.
Examples
ex <- system.file("extdata", "example", package = "rsemverse")
rsem_check(file.path(ex, "data"))
#> rsem_check: 3 files; 0 errors, 0 warnings, 0 notes
#> [1] severity check sample_id n detail
#> <0 rows> (or 0-length row.names)