Compare gene-level and isoform-level results of the same samples
Source:R/rsem_reconcile.R
rsem_reconcile.RdRSEM defines a gene's abundance as the sum of the abundances of its
transcripts. rsem_reconcile() checks this for every sample, which
detects files that belong to different samples or runs, truncated files, and
gene files that were quantified against another reference than the isoform
files.
Usage
rsem_reconcile(
data = "data",
isoform_data = data,
columns = c("expected_count", "TPM", "FPKM"),
sample_from = "filename",
tolerance_extra = 1e-06
)Arguments
- data
Folder with the
*.genes.resultsfiles (searched recursively).- isoform_data
Folder with the
*.isoforms.resultsfiles; the default isdata.- columns
Value columns to compare. Any of
"expected_count","TPM"and"FPKM".- sample_from
"filename"or"parent_dir", as inrsem_read().- tolerance_extra
Added to the rounding bound, to allow for files that were written with more digits (default
1e-6).
Value
A data frame with one row per sample and column: n_genes compared,
n_beyond_rounding (genes whose difference is above the bound),
max_abs_diff, the worst_gene, and the numbers of genes only in the gene
file (genes_without_isoforms) or only in the isoform file
(isoform_genes_missing), and transcript_mapping_mismatch, the number of
genes whose transcript_id(s) in the gene file are not the transcripts of
that gene in the isoform file (a change of reference that the sums cannot
show). Samples found in only one of the folders are
reported as a stop.
Details
RSEM writes expected_count, TPM and FPKM with two decimals, and it
rounds the gene and the transcript values separately. The sum of the
printed transcript values can therefore differ from the printed gene value
by at most 0.005 * (n + 1) for a gene with n transcripts; a difference
above this is not explained by rounding. tolerance_extra is added to that
bound.