pyrovelocity.cytotrace#

pyrovelocity.cytotrace.FNNLSa(XtX, Xty, tol=None)[source]#

Faster NNLS imported from https://github.com/delnatan/FNNLSa A fast non-negativity-constrained least squares algorithm. Journal of chemometrics

pyrovelocity.cytotrace.align_diffrate(adatas, labels, field='condition', type='A', outfield='cytotrace', ax=None)[source]#

this is used for differentiation rate comparison across samples

pyrovelocity.cytotrace.any(a)[source]#
pyrovelocity.cytotrace.batch_cytotrace(mvg_batch, gcs_batch, solver='jfnnls')[source]#
pyrovelocity.cytotrace.census_normalize(mat, count)[source]#

RNA-seq census normalization to correct cell lysis

pyrovelocity.cytotrace.compare_cytotrace(adata, layer='all', cell_count=10, condition='age', solver='nnls', is_normalized=False, n_cores=4, top_n_genes=200)[source]#

Main interface of cytotrace reimplementation used for single dataset with multiple conditions

pyrovelocity.cytotrace.compare_cytotrace_ncores(adata, layer='all', cell_count=10, condition='age', solver='nnls', is_normalized=False, ncores=4, batch_cell=2000)[source]#

Main interface of cytotrace reimplementation used for single dataset with multiple conditions

pyrovelocity.cytotrace.compute_gcs(mat, count, top_n_genes=200)[source]#

Compute gene set enrichment scores by correlating gene count and gene expression

pyrovelocity.cytotrace.compute_similarity1(A)[source]#

Compute pairwise correlation of all columns in matrices A

pyrovelocity.cytotrace.compute_similarity2(O, P)[source]#

Compute pearson correlation between two matrices O and P using einstein summation

Return type:

ndarray

pyrovelocity.cytotrace.convert_to_markov(sim)[source]#

Convert the Pearson correlation to Markov matrix

TODO: use velocity graph to replace this markov matrix

pyrovelocity.cytotrace.cumulative_boxplot()[source]#
pyrovelocity.cytotrace.cytotrace(adata, layer='all', cell_count=10, solver='nnls', top_n_genes=200)[source]#

Main interface of cytotrace reimplementation used for single dataset with one condition

pyrovelocity.cytotrace.cytotrace_ncore(adata, layer='all', cell_count=10, solver='nnls', ncores=4, batch_cell=3000, shuffle=3)[source]#

optimized version

pyrovelocity.cytotrace.diffused(markov, gcs, ALPHA=0.9)[source]#

Compute diffusion process

pyrovelocity.cytotrace.find_nonzero(a)[source]#
pyrovelocity.cytotrace.plot_multiadata(adatas)[source]#
pyrovelocity.cytotrace.regressed(markov, gcs, solver='fnnls')[source]#

solve markov @ weight = gcs problems,

solver: fnnls (default) is faster in larger dataset, e.g., above 20,000 cells

nnls is faster in smaller dataset, e.g. less than 5,000 cells

pyrovelocity.cytotrace.remove_zero_mvg(mat)[source]#

remove cells not expressing any of the top 1000 variable genes