runErrorModel: Apply error model to estimate technical SD from raw counts

View source: R/runErrorModel.R

runErrorModelR Documentation

Apply error model to estimate technical SD from raw counts

Description

Based on raw counts, uses past data to estimate each raw count's log-scale SD from technical noise. Specifies different error models for different platforms.

Usage

runErrorModel(counts, platform = "general")

Arguments

counts

vector or matrix of raw counts

platform

String specifying which platform was used to create "rawCounts". Default to "dsp", for digital spatial profiler/ aka GeoMx. Other options include "ncounter", "rsem", "quantile", and "st" for spatial transcriptomics/visium.

Value

a matrix of log2-scale SDs

Examples

library(GeomxTools)
datadir <- system.file("extdata", "DSP_NGS_Example_Data", package = "GeomxTools")
demoData <- readRDS(file.path(datadir, "/demoData.rds"))

demoData <- shiftCountsOne(demoData)
target_demoData <- aggregateCounts(demoData)

sd_from_noise <- runErrorModel(counts = exprs(target_demoData), platform = "dsp") 
wts <- 1 / sd_from_noise

Nanostring-Biostats/SpatialDecon documentation built on Jan. 26, 2024, 8:20 p.m.