maxfuse.utils
General utility functions
Functions
Filter bad matched pairs, align arr1 and arr2 using init_matching, fit CCA, and get CCA embeddings of arr1 and arr2. |
|
Calculate pair-wise 1 - Pearson correlation between X and Y. |
|
Column-wise center and scale by standard deviation. |
|
Convert dict_ into a list. |
|
Drop columns for which its standard deviation is zero in any one of the arrays in arr_list. |
|
Filter bad matches according to the distances of matched pairs. |
|
Compute the centroids (cluster mean) of arr. |
|
For each row of arr, shrink it towards the average of its neighborhood by taking wt*raw_data + (1-wt)*nhbd_avg |
|
Convert list_ to a dict. |
|
Calculate the vector of pearson correlations between each row of arr1 and arr2. |
|
Process count data according to scanpy pipeline. |
|
Recode the cluster labels to 0, 1, ..., num_clusters-1 |
|
Do deterministic or randomized SVD on arr. |
|
For each row of arr, shrink it towards its cluster centroid by taking wt*raw_data + (1-wt)*centroid |
|
Return a copy of dict_ with both keys and values sorted. |
|
Compute the majority cell type for each cluster. |
|
Compute best rank-n_components approximation of arr by SVD. |
|
Compute rank-n_components SVD embeddings of arr. |