Reference API

Documentation for Sainsc.jl's public interface.

Index

API

Sainsc.GridCount.GridCountsMethod
GridCounts(df::DataFrame, binsize::Real)

Construct from a DataFrame with columns 'x' (Real), 'y' (Real), 'count', and 'geneID' (Pool) binning the data by binsize.

source
Sainsc.GridCount.GridCountsMethod
GridCounts(df::DataFrame)

Construct from a DataFrame with columns 'x' (Integer), 'y' (Integer), 'count', and 'geneID' (Pool).

source
Sainsc.GridCount.mask!Method
mask!(counts, mask::AbstractMatrix{Bool})

Remove all counts in each gene layer for which mask is false.

source
Sainsc.KDE.assigncelltypeMethod
assigncelltype(counts, signatures, kernel; celltypes=nothing, log=false) -> (celltypes, cosine)

Assign a celltype to each pixel.

The cosine similarity is calculated using signatures to assign the celltype with the highest similarity to each pixel.

The eltype(kernel) will be used for calculations and signatures will be cast to it.

Arguments

  • signatures::AbstractDataFrame: celltype signatures (celltypes x genes).
  • celltypes::Vector{AbstractString}=nothing: optional celltype names.
  • log::Bool: whether to log-transform the KDE. Useful if signatures are calculated from log-transformed gene expression.
source
Sainsc.KDE.kdeMethod
kde(counts, kernel)

Calculate kernel density estimate.

Arguments

  • kernel: usually a centered OffsetArrays.OffsetArray.
source
Sainsc.LocalMax.getlocalmaximaMethod
getlocalmaxima(counts, localmax, kernel; genes=nothing) -> (expression, genes, coordinates)

Load KDE with kernel for coordinates at localmax.

Arguments

  • localmax: vector of locations (indices).
  • genes=nothing: vector of genes for which to calculate KDE. If nothing all genes are used.
source