Skip to content

Commit

Permalink
out_dim arg for gene_composition_transformation
Browse files Browse the repository at this point in the history
  • Loading branch information
VPetukhov committed Apr 6, 2021
1 parent 89a4c9a commit 2647ac9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/data_processing/expression_local_vectors.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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
Expand Down

0 comments on commit 2647ac9

Please sign in to comment.