Supervised Spatial Inference

Types

Functions

SeqSpace.Inference.costMethod
cost(ref, qry; α=1, β=1, γ=0, ω=nothing)

Return the cost matrix $J_{ilpha}$ associated to matching cells in qry to cells in ref. The cost matrix is computed by a heuristic distance between quantiles. Deprecated.

SeqSpace.Inference.cost_simpleMethod
cost_simple(ref, qry)

Return the cost matrix $J_{i\alpha}$ associated to matching cells in qry to cells in ref. The cost matrix is computed by hamming distance between cells via transforming quantiles to continuous spin variables. Deprecated.

SeqSpace.Inference.cost_transformMethod
cost_transform(ref, qry; ω=nothing, ν=nothing)

Return the cost matrix $J_{i\alpha}$ associated to matching cells in qry to cells in ref. The cost matrix is computed by:

  1. Transforming the qry distribution to the ref distribution.
  2. Looking at the SSE across transformed genes.

Use this unless you know what you are doing.

SeqSpace.Inference.inversionMethod
inversion(counts, genes; ν=nothing, ω=nothing, refdb=nothing)

Infer the original position of scRNAseq data counts where genes, given by genes are arranged along rows. The sampling probability over space is computed by regularized optimal transport by comparing to the Berkeley Drosophila Transcription Network Project database. The cost matrix is determined by summing over the 1D Wasserstein metric over all genes within the BDTNP databse. Returns the inversion as a function of inverse temperature.

SeqSpace.Inference.sinkhornMethod
sinkhorn(M::Array{Float64,2};
              a::Maybe{Array{Float64}} = missing,
              b::Maybe{Array{Float64}} = missing,
              maxᵢ::Integer            = 1000,
              τ::Real                  = 1e-5,
              verbose::Bool            = false
)

Rescale matrix M to have row & column marginals a and b respectively. Will terminate either when constraints are held to within tolerance τ or the number of iterations exceed maxᵢ.

SeqSpace.Inference.transformMethod
transform(src, dst, ν)

Transform distribution src to distribution dst by minimizing the Wasserstein metric. This is equivalent to $x \to F^{-1}_{dst}\left(F_{src}\left(x\right)\right)$ where $F$ denotes the cumulative density function.

SeqSpace.Inference.virtualembryoMethod
virtualembryo(;directory="/home/nolln/mnt/data/drosophila/dvex")

Load the Berkeley Drosophila Transcriptional Network Project database. directory should be path to folder containing two folders:

  1. bdtnp.txt.gz : gene expression over point cloud of virtual cells
  2. geometry.txt.gz : spatial position (x,y,z) of point cloud of virtual cells.