Read RCC files and extract count and attribute data. Use read_rcc()
for
multiple files, and use the parse_*()
functions for single files.
Value
read_rcc()
reads in a directory of RCC files and outputs a list
with two elements:
raw
: A tibble of parsed counts for multiple RCC files created by callingparse_counts()
on each sample. Columns include "Code.Class", "Name", "Accession", and a column for each sample ID. There is one row per gene.exp
: A tibble of parsed attributes for multiple RCC files created by callingparse_attributes()
on each sample. Columns include "File.Name" (sample ID), "geneRLF", "nanostring.date", "cartridgeID", "lane.number", fov.count", "fov.counted", "binding.density". There is one row per sample.
parse_counts()
reads a single RCC file and returns a tibble of
parsed counts.
parse_attributes()
reads a single RCC file and returns a list of
parsed attributes.
Details
RCC files for a sample are direct outputs from NanoString runs. We can
extract counts for each gene in a sample. Sample attributes include sample
ID, GeneRLF, date, cartridge ID, lane number, Fov count, Fov counted, and
binding density. read_rcc()
merges both count and attribute data across
samples.
If path
points to a zipped RCC file with multiple samples, the zip file is
uncompressed and a directory of RCC sample files is created with the same
name. Only file extensions ".RCC" or ".rcc" are allowed.
Examples
rcc_file <- system.file("extdata", "example.RCC", package = "nanostringr")
parse_counts(rcc_file)
#> # A tibble: 354 × 4
#> Code.Class Name Accession `TAOC00241-N1`
#> <chr> <chr> <chr> <int>
#> 1 Endogenous COL1A1 NM_000088.3 47179
#> 2 Endogenous ADAM12 NM_003474.4 158
#> 3 Endogenous BRCA2 NM_000059.3 32
#> 4 Endogenous GTF2H5 NM_207118.2 117
#> 5 Endogenous SLC7A11 NM_014331.3 33
#> 6 Endogenous HIF1A NM_001530.2 691
#> 7 Endogenous DCN NM_001920.3 2431
#> 8 Endogenous SVIL NM_003174.2 335
#> 9 Endogenous HBB NM_000518.4 292
#> 10 Endogenous MRPS27 NM_001286748.1 91
#> # ℹ 344 more rows
parse_attributes(rcc_file)
#> $File.Name
#> [1] "TAOC00241-N1"
#>
#> $geneRLF
#> [1] "OTTA2017_C6082"
#>
#> $nanostring.date
#> [1] "2018-07-24"
#>
#> $cartridgeID
#> [1] "OTTA2-108-SYD-20H"
#>
#> $lane.number
#> [1] "4"
#>
#> $fov.count
#> [1] 555
#>
#> $fov.counted
#> [1] 542
#>
#> $binding.density
#> [1] 0.27
#>