scRNAseq Data

Types

SeqSpace.scRNA.CountType
struct Count{T <: Real} <: AbstractArray{T,2}
    data :: Array{T,2}
    gene :: Array{AbstractString,1}
    cell :: Array{AbstractString,1}
end

Data structure used to represent count data obtained during a scRNAseq sequencing experiment. Individual cells are stored as column vectors while expression of singular genes are obtained as row vectors. data contains the raw/normalized count matrix. gene and cell contain the row/column labels respectively. Genes and cells can be indexed either by integers or names, i.e. strings.

Functions

Base.:∪Method
∪(seq₁::Count{T}, seq₂::Count{S}) where {T <: Real, S <: Real}

Collate count matrix seq₁ and seq₂ by taking the union across genes. Reorders rows of seq₂ to match gene names of seq₁. Additional genes in seq₂ not contained in seq₁ are added as augmented rows.

SeqSpace.scRNA.:∩Method
∩(seq₁::Count{T}, seq₂::Count{S}) where {T <: Real, S <: Real}

Collate count matrix seq₁ and seq₂ by taking the union across genes. Reorders rows of seq₂ to match gene names of seq₁. Only keeps genes present in both seq₁ and seq₂.

SeqSpace.scRNA.filtercellMethod
filtercells(f, seq::Count)

Filters cells of count matrix seq based upon column function f.

SeqSpace.scRNA.generateMethod
generate(ngene, ncell; ρ=(α=Gamma(0.25,2), β=Normal(1,.01), γ=Gamma(3,3)))

Generate scRNAseq data assuming a monoclonal population of cells sampled against a heteroskedastic negative binomial model.

SeqSpace.scRNA.loadMethod
load(dir::AbstractString; batch=missing)

Read in scRNAseq experimental data from directory dir. The directory is expected to contain the following files:

  1. barcodes.tsv : one cell name per line
  2. features.tsv : one gene name per line
  3. matrix.mtx : count matrix in mtx format

If batch is not missing, then it will be appended to each cell label.