Convert between nacho objects and Bioconductor containers
Source:R/interop.R
as_summarized_experiment.Rdas_summarized_experiment() gives a SummarizedExperiment with the raw and
normalised counts as assays counts and normalised, nacho_samples() as
colData, nacho_probes() as rowData, and the settings, thresholds, RCC
type and provenance in metadata()$nacho.
Details
as_nacho() goes the other way, from a SummarizedExperiment or from a
NanoStringRccSet read by NanoStringNCTools::readNanoStringRccSet().
The dates of a NanoStringRccSet are written as YYYYMMDD, as in RCC
files.
Its probe names lose a trailing numeric suffix such as |0, as in
load_rcc(), so both give the same probe names for the same RCC files.
It computes the quality-control
metrics and the normalisation from the raw counts; settings and thresholds
come from metadata()$nacho when present, and are the defaults otherwise.
They are checked like the arguments of normalise().
The result always carries the current object schema.
A nacho object is checked and returned as is, and a NACHO 2 object gets a
hint to use upgrade_nacho().
Examples
if (requireNamespace("SummarizedExperiment", quietly = TRUE)) {
se <- as_summarized_experiment(GSE74821)
as_nacho(se)
}
#> Warning: replacing previous import ‘S4Arrays::makeNindexFromArrayViewport’ by ‘DelayedArray::makeNindexFromArrayViewport’ when loading ‘SummarizedExperiment’
#> <nacho> 48 samples, 72 probes, from single-sample RCC files
#> Normalisation: GLM, with 8 housekeeping genes
#> Flagged samples: 0 of 48
#> Created with NACHO 2.0.7.9000