SnowyOwl
SnowyOwl.Analysis.project
SnowyOwl.Analysis.project!
SnowyOwl.Preprocess.filter_cells!
SnowyOwl.Preprocess.filter_genes!
SnowyOwl.Preprocess.highly_variable_genes
SnowyOwl.Preprocess.highly_variable_genes!
SnowyOwl.Preprocess.logarithmize
SnowyOwl.Preprocess.logarithmize!
SnowyOwl.Preprocess.normalize
SnowyOwl.Preprocess.normalize!
SnowyOwl.Preprocess.quality_control_metrics
SnowyOwl.Preprocess.quality_control_metrics!
SnowyOwl.Preprocess.quality_control_metrics
— Functionquality_control_metrics(p; kwargs...)
quality_control_metrics(X, obs, var; obsindex, varindex, kwargs...)
Calculate quality control metrics.
Arguments
p::Profile
: The profile object to calculate on.X::AbstractMatrix
: The count matrix to calculate on.obs::DataFrame
: The feature information matrix with cell information.var::DataFrame
: The feature information matrix with gene information.
Common Keyword arguments
obsindex::Symbol=:barcode
: The index of dataframeobs
.varindex::Symbol=:gene_symbols
: The index of dataframevar
.use_log1p::Bool
: Computing log1p-transformed quality control metric.qc_vars::AbstractVector{String}=["mt"]
: The boolean mask for identifying variables you could calculate on.percent_top=nothing
: The proportions of top genes to calculate on.
Example
See also quality_control_metrics!
for non-inplace operation.
SnowyOwl.Preprocess.quality_control_metrics!
— Functionquality_control_metrics!(p; kwargs...)
quality_control_metrics!(X, obs, var; kwargs...)
Calculate quality control metrics.
Arguments
p::AnnotatedProfile
: The profile object to calculate on.X::AbstractMatrix
: The count matrix to calculate on.obs::DataFrame
: The feature information matrix with cell information.var::DataFrame
: The feature information matrix with gene information.
Common Keyword arguments
use_log1p::Bool
: Computing log1p-transformed quality control metric.qc_vars::AbstractVector{String}=["mt"]
: The boolean mask for identifying variables you could calculate on.percent_top=nothing
: The proportions of top genes to calculate on.
Example
See also quality_control_metrics
for non-inplace operation.
SnowyOwl.Preprocess.filter_genes!
— FunctionFilter out genes which are not satisfy specific criteria.
SnowyOwl.Preprocess.filter_cells!
— FunctionFilter out cells which are not satisfy specific criteria.
SnowyOwl.Preprocess.normalize
— Functionnormalize(prof, method; omicsname=:RNA, layer=:count, kwargs...)
normalize(X, method; kwargs...)
Normalize counts per cell.
Arguments
prof::AnnotatedProfile
: The profile object to calculate on.X::AbstractMatrix
: The count matrix to calculate on.method
: Method to calculate highly variable genes, available forLogNormalization
,RelativeNormalization
,CenteredLogRatioNormalization
andCustomNormalization
.
Specific keyword arguments
omicsname::Symbol
: TheOmicsProfile
specified to calculate on.layer::Symbol
: The layer specified to calculate on.
Common keyword arguments
scaled_size::Real=1e4
: Scaled total counts for each cell over all genes.
Examples
See also normalize!
for inplace operation.
SnowyOwl.Preprocess.normalize!
— Functionnormalize!(prof, method; omicsname=:RNA, layer=:count, kwargs...)
normalize!(X, method; kwargs...)
Normalize counts per cell.
Arguments
prof::AnnotatedProfile
: The profile object to calculate on.X::AbstractMatrix
: The count matrix to calculate on.method
: Method to calculate highly variable genes, available forLogNormalization
,RelativeNormalization
,CenteredLogRatioNormalization
andCustomNormalization
.
Specific keyword arguments
omicsname::Symbol
: TheOmicsProfile
specified to calculate on.layer::Symbol
: The layer specified to calculate on.
Common keyword arguments
scaled_size::Real=1e4
: Scaled total counts for each cell over all genes.
Examples
See also normalize
for non-inplace operation.
SnowyOwl.Preprocess.logarithmize
— Functionlogarithmize(prof; omicsname=:RNA, layer=:count, kwargs...)
logarithmize(X; kwargs...)
Logarithmize the data matrix.
Arguments
prof::AnnotatedProfile
: The profile object to calculate on.X::AbstractMatrix
: The count matrix to calculate on.
Specific keyword arguments
omicsname::Symbol
: TheOmicsProfile
specified to calculate on.layer::Symbol
: The layer specified to calculate on.
Common keyword arguments
base::Real=ℯ
: Base of the logarithm.
Examples
See also logarithmize!
for inplace operation.
SnowyOwl.Preprocess.logarithmize!
— Functionlogarithmize!(prof; omicsname=:RNA, layer=:count, kwargs...)
logarithmize!(X; kwargs...)
Logarithmize the data matrix.
Arguments
prof::AnnotatedProfile
: The profile object to calculate on.X::AbstractMatrix
: The count matrix to calculate on.
Specific keyword arguments
omicsname::Symbol
: TheOmicsProfile
specified to calculate on.layer::Symbol
: The layer specified to calculate on.
Common keyword arguments
base::Real=ℯ
: Base of the logarithm.
Examples
See also logarithmize
for non-inplace operation.
SnowyOwl.Preprocess.highly_variable_genes
— Functionhighly_variable_genes(prof, method; omicsname=:RNA, layer=:count, kwargs...)
highly_variable_genes(X, var, method; varname=:gene_symbols, kwargs...)
Calculate highly variable genes and return a new DataFrame
with column :highlyvariable, which selects highly variable genes from given gene set. Additional information including :means
, :dispersions
and `:dispersionsnormwill be added to returned
DataFrame`.
Arguments
prof::AnnotatedProfile
: The profile object to calculate on.X::AbstractMatrix
: The count matrix to calculate on.var::DataFrame
: The feature information matrix with gene information.method::HighlyVariableMethod
: Method to calculate highly variable genes, available forCellRangerHVG
,SeuratHVG
andSeuratv3HVG
.
Specific keyword arguments
omicsname::Symbol
: TheOmicsProfile
specified to calculate on.layer::Symbol
: The layer specified to calculate on.varname::Symbol
: The variable name to be specified as identifier for genes.
Common keyword arguments
ntop_genes::Int=-1
: Number of top variable genes to be selected. Specify-1
to switch to selection by mean and dispersion. Available forCellRangerHVG
andSeuratHVG
methods.min_disp::Real=0.5
: Minimum dispersion for selecting highly variable genes. Available forCellRangerHVG
andSeuratHVG
methods.max_disp::Real=Inf
: Maximum dispersion for selecting highly variable genes. Available forCellRangerHVG
andSeuratHVG
methods.min_mean::Real=0.0125
: Minimum mean for selecting highly variable genes. Available forCellRangerHVG
andSeuratHVG
methods.max_mean::Real=3.
: Maximum mean for selecting highly variable genes. Available forCellRangerHVG
andSeuratHVG
methods.
Examples
See also highly_variable_genes!
for inplace operation.
SnowyOwl.Preprocess.highly_variable_genes!
— Functionhighly_variable_genes!(prof, method; omicsname=:RNA, layer=:count, kwargs...)
highly_variable_genes!(X, var, method; kwargs...)
Calculate highly variable genes and modify var
directly by adding column :highlyvariable, which selects highly variable genes from given gene set. Additional information including :means
, :dispersions
and `:dispersionsnormwill be added to
var`.
Arguments
prof::AnnotatedProfile
: The profile object to calculate on.X::AbstractMatrix
: The count matrix to calculate on.var::DataFrame
: The feature information matrix with gene information.method
: Method to calculate highly variable genes, available forCellRangerHVG
,SeuratHVG
andSeuratv3HVG
.
Specific keyword arguments
omicsname::Symbol
: TheOmicsProfile
specified to calculate on.layer::Symbol
: The layer specified to calculate on.
Common keyword arguments
ntop_genes::Int=-1
: Number of top variable genes to be selected. Specify-1
to switch to selection by mean and dispersion. Available forCellRangerHVG
andSeuratHVG
methods.min_disp::Real=0.5
: Minimum dispersion for selecting highly variable genes. Available forCellRangerHVG
andSeuratHVG
methods.max_disp::Real=Inf
: Maximum dispersion for selecting highly variable genes. Available forCellRangerHVG
andSeuratHVG
methods.min_mean::Real=0.0125
: Minimum mean for selecting highly variable genes. Available forCellRangerHVG
andSeuratHVG
methods.max_mean::Real=3.
: Maximum mean for selecting highly variable genes. Available forCellRangerHVG
andSeuratHVG
methods.
Examples
See also highly_variable_genes
for non-inplace operation.
SnowyOwl.Analysis.project
— Functionproject(prof, method; omicsname=:RNA, layer=:count, kwargs...)
project(X, method; kwargs...)
Project the count matrix from original space to low-dimensional space.
Arguments
prof::AnnotatedProfile
: The profile object to calculate on.X::AbstractMatrix
: The count matrix to calculate on. The dimension ofX
should be (nfeature
,nsample
) wherenfeature
is number of features andnsample
is number of samples.method::AnalysisMethod
: Method to project count matrix, available forPCAMethod()
andUMAPMethod()
.
Specific keyword arguments
omicsname::Symbol
: TheOmicsProfile
specified to calculate on.layer::Symbol
: The layer specified to calculate on.
Common keyword arguments
dims::Int=50
: The dimension of target space. Should lower or equal to the dimension of feature from count matrix which isdims
<=nfeature
.n_neighbors::Int=20
: The number of local neighborhood points used in approximations of manifold structure. It is only effective whenmethod = UMAPMethod()
.min_dist::Real=0.5
: This controls how tightly the embedding is allowed compress points together. Larger values prevent points from packing together and will prone to the preservation of global structure instead. Smaller values result in a more clustered/clumped embedding and prone to the preservation of local structure. It is only effective whenmethod = UMAPMethod()
.
Examples
See also project!
for inplace operation.
SnowyOwl.Analysis.project!
— Functionproject!(prof, method; omicsname=:RNA, layer=:count, kwargs...)
project!(X, method; kwargs...)
Project the data matrix from original space to (usually) low-dimensional space.
Arguments
prof::AnnotatedProfile
: The profile object to calculate on.X::AbstractMatrix
: The count matrix to calculate on. The dimension ofX
should be (nfeature
,nsample
) wherenfeature
is number of features andnsample
is number of samples.method::AnalysisMethod
: Method to project count matrix, available forPCAMethod()
andUMAPMethod()
.
Specific keyword arguments
omicsname::Symbol
: TheOmicsProfile
specified to calculate on.layer::Symbol
: The layer specified to calculate on.
Common keyword arguments
dims::Int=50
: The dimension of target space. Should lower or equal to the dimension of feature from count matrix which isdims
<=nfeature
.n_neighbors::Int=20
: The number of local neighborhood points used in approximations of manifold structure. It is only effective whenmethod = UMAPMethod()
.min_dist::Real=0.5
: This controls how tightly the embedding is allowed compress points together. Larger values prevent points from packing together and will prone to the preservation of global structure instead. Smaller values result in a more clustered/clumped embedding and prone to the preservation of local structure. It is only effective whenmethod = UMAPMethod()
.
Examples
See also project
for non-inplace operation.