From 2647ac90ae6a142a2e884306a5bd1e785ebbfd9c Mon Sep 17 00:00:00 2001 From: Viktor Petukhov Date: Tue, 6 Apr 2021 16:19:31 +0200 Subject: [PATCH] out_dim arg for gene_composition_transformation --- src/data_processing/expression_local_vectors.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/data_processing/expression_local_vectors.jl b/src/data_processing/expression_local_vectors.jl index c94bb9d..7eafcd4 100644 --- a/src/data_processing/expression_local_vectors.jl +++ b/src/data_processing/expression_local_vectors.jl @@ -48,7 +48,7 @@ truncate_pca(pca::MultivariateStats.PCA, outdim::Int) = MultivariateStats.PCA(pca.mean, pca.proj[:, 1:outdim], pca.prinvars[1:outdim], pca.tvar) function gene_composition_transformation(count_matrix::Matrix{Float64}, confidence::Vector{Float64}=ones(size(count_matrix, 2)); - sample_size::Int=10000, seed::Int=42, method::Symbol=:umap, return_all::Bool=false, n_pcs::Int=15, kwargs...) + sample_size::Int=10000, seed::Int=42, method::Symbol=:umap, return_all::Bool=false, n_pcs::Int=15, out_dim::Int=3, kwargs...) sample_size = min(sample_size, size(count_matrix, 2)) Random.seed!(seed) @@ -65,7 +65,7 @@ function gene_composition_transformation(count_matrix::Matrix{Float64}, confiden emb = nothing if method == :umap - emb = fit(UmapFit, count_matrix_sample, pca; n_components=3, kwargs...); + emb = fit(UmapFit, count_matrix_sample, pca; n_components=out_dim, kwargs...); elseif method == :pca emb = truncate_pca(pca, 3); else