Supervised Spatial Inference
Types
Functions
SeqSpace.Inference.cost
— Methodcost(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_simple
— Methodcost_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_transform
— Methodcost_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:
- Transforming the
qry
distribution to theref
distribution. - Looking at the SSE across transformed genes.
Use this unless you know what you are doing.
SeqSpace.Inference.inversion
— Methodinversion(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.sinkhorn
— Methodsinkhorn(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.transform
— Methodtransform(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.virtualembryo
— Methodvirtualembryo(;directory="/home/nolln/mnt/data/drosophila/dvex")
Load the Berkeley Drosophila Transcriptional Network Project database. directory
should be path to folder containing two folders:
- bdtnp.txt.gz : gene expression over point cloud of virtual cells
- geometry.txt.gz : spatial position (x,y,z) of point cloud of virtual cells.