bixverse-r
0.9.0), several times smaller on disk and faster to scan. v3 stores still
work, load_existing() warns on them and the new upgrade_sc_store()
converts them in place.bixverse-r 0.8.0 under the hood. petgraph is out of the dependency tree.params_knn_graph_defaults(). Its knn_sym picks the graph the
clustering runs on: "snn" (bluster/Seurat sNN, the default), "umap" (the
fuzzy simplicial set ScanPy keeps in obsp/connectivities) or "knn" (plain
kNN union). Pass it via graph in params_sc_neighbours() or graph_params
in generate_wnn_graph_sc(). Resolutions don't carry over between the
graphs, retune them when switching.fast_cluster_sc() is rewritten. It coarsens the cells with k-means, builds
a graph over the centroids (a symmetrised centroid kNN or the Secuer
cell-mediated graph) and runs Louvain or Leiden on it. All knobs live in
params_sc_fast_cluster(). With n_seeds > 1 it runs every resolution once
per seed, keeps the labels of the seed with the lowest mean conductance and
returns ARI and conductance stability stats.leiden_clustering() gained min_gain and local_moving ("queue", or
"coloured" to move nodes in parallel). A negative n_iterations iterates
until stable. find_clusters_sc() and step_clusters_sc() pass these on via
....params_sc_pca() has a new svd_solver = "auto", which is now the default.
It runs Lanczos on the sparse path and the covariance solver on the dense
one. The doublet detection methods (params_scrublet(), params_boost(),
params_scdblfinder()) accept it too; their default stays "randomised".svd_solver of params_sc_pca() is "auto" rather than
"covariance", so on the sparse path the PCs now come from Lanczos. Both are
exact, but the trailing PCs can shift slightly.n_iterations defaults and the rewritten fast clustering.get_snn_graph(), set_snn_graph() and remove_snn_graph() are now
get_connectivities(), set_connectivities() and remove_connectivities(),
since the graph isn't always an sNN any more. The old names still work and
warn. The cache slot, the state check artefact and graph in the ForceAtlas2
layout went from "snn" to "connectivities". load_existing() migrates
objects saved with 0.7.x.1/12 to 1/16, i.e. about 2 of 16 shared
cells at k = 15, in line with Seurat's 1/15. The WNN graph uses the same
default instead of 1/15.full_snn (neighbours) and snn_type (WNN) are gone.fast_cluster_sc() lost km_type, n_centroids, snn, grid_search and
no_seeds. The first two moved into params_sc_fast_cluster(), where
km_type = "kmeans" is now "standard"; n_seeds replaces the grid search.kmeans_iters in params_fast_cluster_default() (Boost, scDblFinder) is now
k_means_iter.rs_sc_knn_graph() replaces rs_sc_snn(). rs_fast_cluster_sc() absorbs
rs_fast_cluster_sc_grid().cell_type_annotation). On top of Symphony it covers the graph
choice, Leiden vs Louvain, fast clustering and per-cell scType calls.transfer_labels_symphony() no longer panics when the reference labels
contain NA (e.g. scType Unknown cells). NA is treated as its own class,
so query cells can come back NA.bixverse-rs 0.7.0 under the hood, with faer 0.24 and edge-rs 0.3.leiden_clustering() on any igraph, and
find_clusters_sc() uses it. Results depend on seed only, not on the
global RNG or the thread count.params_sc_fast_cluster() gained cell_mediated and n_anchors for the
cell-mediated centroid graph from Secuer (Wei et al., PLoS Comput Biol,
2022).calc_meta_cell_compactness() and calc_meta_cell_separation() score any
meta cell assignment against a diffusion map, including meta cells built
outside bixverse.SingleCellsSubset objects) are read from the cell-major file for HVG
detection and the residual fits. HVG on 6k of 985k cells: 0.82 s to 43 ms.set_residual_fit(), get_residual_fit() and remove_residual_fit() work
on SingleCellsSubset.edge-rs.tol = 1e-12, rs_page_rank* gained damping_factor and tol)
(#254).save_h5ad() exports a SingleCells object to an AnnData .h5ad file for
ScanPy: raw or normalised counts in X, obs/var, and cached PCA, embeddings
and sNN graph (obsm/varm/obsp). Counts are streamed in cell batches and
written via scx-core.as_ligand_target_influence() wraps a ligand-target matrix built elsewhere
(e.g. nichenetr) as a LigandTargetInfluence, so it can be scored with
ligand_activity_scores().Larger release with performance improvements across the board and new methods. The Rust backend got a sweep and parts that could be parallelised, but were not are now parallel, SIMD/GEMM integrated everywhere applicable and better memory access patterns across the board. Some of the rounding might be slightly different, hence, major release.
cellphonedb_sc() and get_cellphonedb_db().
The NicheNet vignette is now a general ligand-receptor vignette.params_sc_hvg(method = "scran").svd_solver for the PCA in the doublet detection methods.archive_sc_exp(). The
gene-centric view gets deleted and the cell-centric view gets massively
compressed. Ideal for archiving after large analysis are done.1 - max(abs(cor)) to identify the point where two ICs are strongly
correlated with each other.hvg_method = "mvb" in the doublet params silently fell back to VST. The
choice is now "meanvarbin", plus the new "scran".find_all_markers_sc() and
find_specific_markers_sc().extract_milo_plot_data() to generate plots in conjuction with
bixverse.plots≥0.2.9.Accelerate for MacOS users properly wired in.extract_binary_heatmap_data().manifoldsR from the single
cell-related 2D embedding methods.csc_mem_gb: NULL (default)
converts in one pass, a number caps the conversion buffers at that many GB.
Available on all count loaders (load_mtx(), load_multi_mtx(),
load_h5ad(), load_h5ad_norm(), load_multi_h5ad(), stream_h5ad(),
load_tenx_h5(), load_multi_tenx_h5(), load_seurat(), load_sce(),
load_r_data()), plus merge_sc_experiments() and cellsweep_sc().load_h5ad() gained h5ad_streaming (default TRUE), which streams the
counts into the cell-based binary in batches instead of materialising the
filtered matrix first. stream_h5ad() is now an alias for
load_h5ad(h5ad_streaming = TRUE).densmap_sc() and densne_sc() for the density-preserving versions
of UMAP and t-SNE (Narayan et al.),
and forceatlas2_sc() for ForceAtlas2 layouts of either the kNN or the sNN
graph. See the updated
plotting vignette.tsne_sc() and densne_sc() take approx_type = "fft_3k", the
three-kernel FFT optimiser (Unix only, like "fft").streaming, batch_size, max_genes_in_memory and cell_batch_size are
deprecated on every function listed above. They are ignored and warn if
supplied; use csc_mem_gb instead. Nothing breaks, old calls keep running._index of /obs and
/var rather than the first dataset in the group, and CSR vs CSC comes from
the encoding-type attribute of X instead of being guessed from the
indptr length.tsne_sc() documentation had the use_knn default and the perplexity
default wrong.params_sc_pca() has a new svd_solver
argument, one of "covariance" (the new default), "randomised" or
"exact". The covariance solver builds the gene x gene cross-product
straight from the sparse counts and eigendecomposes it. The randomised solver
got about 2x faster as well.calculate_pca_sc() and step_pca_sc() now default to sparse_svd = NULL,
which picks the sparse path for the normalised data (faster and lighter on
memory for every solver) and the dense one for residuals = TRUE.run_ppca() and run_bpca() for
probabilistic and Bayesian PCA, ported from
pcaMethods.randomised argument of params_sc_pca() is deprecated. TRUE maps to
svd_solver = "randomised", FALSE to "exact", with a warning.mean_center = FALSE and
normalise_variance = FALSE.calc_blitzgsea(). Permutation GSEA pays per pathway, this does
not: random gene sets are drawn once across a log-spaced grid of set sizes,
gamma tails are fitted to the null enrichment scores, and every pathway's
p-value is read straight off the fitted tail. One gamma evaluation per
pathway, no matter how big the library. No gene set library enters the
calibration, so blitzgsea_calibrate() gives you a BlitzGseaNull that
serves every library scored against that signature and survives saveRDS().
params_blitzgsea() and a print() method come with it.bixverse-rs 0.5.0 under the hood. kNN graphs now return true Euclidean
distances, so the is_squared plumbing is gone from the binding layer.extract_knn: hand back the graph the descent already built
instead of running a separate search over the index.load_sce() reads SingleCellExperiment objects. The Seurat loader was
deduplicated against it.plot.Hotspot() draws readable module blocks, and the scored modules are the
ones the heatmap actually shows.nebula_sc() on SingleCells and nebula_mc() on MetaCells, for
when you have repeated measures per subject and pseudobulk throws away too
much.rs_make_milor_nhoods(),
behind get_miloR_abundances_sc() and test_nhoods().edge-rs crate: run_edger_ql()
does the fit in Rust rather than round tripping through the R package.consensus_nmf_bulk() on BulkCoExp and consensus_nmf_sc() on
SingleCells and MetaCells.nmf_k_sweep_bulk() and nmf_k_sweep_sc() sweep a range of k and report
stability against reconstruction error, so choosing k stops being a guess.
Both return an NmfKSweepResult with a plot() method.params_nmf_consensus() plus the matching checkmate assertions.ConsensusNmfResult class with get_w(), get_h(), get_data() and a
new get_stability() generic for the clustering diagnostics.get_nmf_stability() on BulkCoExp now covers consensus fits as well as
stabilised ones.install_agent_skill() installs an agent skill.MetaCells class.@importFrom Matrix sparseMatrix to the package import to avoid issues
with meta cells and the conversions of the sparse matrices to lists for Rust.Meta cells:
Single cells:
"recovery" a more top heavy score. If you want the
old behaviour, please use "wilcox".bixverse-rs that propagate into here.If you want to develop on the package, set:
Sys.setenv(DEV_BUILD = "true")
devtools::document()
devtools::install()
for local testing and exploration. It will optimise less aggressively in terms of performance, but still reach very good speeds this way, while massively reducing compile times.
"vst" might be slightly different now.ScCache part.
Less foot guns in the future. This works still with older objects, but good
practice for the future.cells_to_keep are stored now avoiding some problems with state.bixverse-rs version bump for better performance in SEACells and more robust
streaming engine. Old files will still behave, but the desired target size is
now encoded in the files.TRUE by default in SEACells after
further benchmarking.SingleCellsSubset class. This class creates a view into a subset of cells,
think doing further analysis on T cells within your data set.aucell_sc() now takes a params_sc_aucell() list instead
of an auc_type string, and offers three statistics: "wilcox" (the
Mann-Whitney AUC, still the default), "recovery" (the recovery-curve AUC of
Aibar et al., with a max_rank cutoff) and "ap" (average precision).
Scores can be z-scored per gene set via standardise.aucell_sc(auc_type = ...) is gone, use
aucell_sc(aucell_params = params_sc_aucell(auc_type = ...)). The "auroc"
value has been dropped and now errors. "wilcox" results are unchanged.bixverse-rs that has a fix for the IVF-type approximate
nearest neighbour seraches.get_centroids() was renamed to get_centroids_sc() for the usage on the fast
clustering algorithms.
SingleCellsSubset class that can split from the main class and allows for
analysis of e.g., a subset of cell types, etc.Following things were added:
SingleCellsMultiModal.load_multi_tenx_h5(), load_multi_h5ad()) no longer
write NA gene ids into the var table under gene_universe = "union" when
the var reference file does not contain every gene in the universe. The
gene_id is now pinned to the canonical universe id and additional data found
in the vars is dropped. The user has to add them subsequently.The interface to the i/o functions for the single cell was changed. The
streaming = TRUE parameter was simplified and gives you now more control over
how to stream in data. This can (and will) break old code! If you get an error
like:
Assertion on 'streaming' failed. Must be of class 'integer', not 'logical'.
Update the streaming parameter to 0L, 1L or 2L, pending on data set size
and available memory. Additionally, the interface to the PCA function has
changed, see here:
calculate_pca_sc(
object,
no_pcs,
pca_params = params_sc_pca(), # new parameter replacing randomised_svd
sparse_svd = FALSE,
hvg = NULL,
seed = 42L,
.verbose = TRUE
)
This gives you way more control over how to run the PCA normalisation (mean centering, variance normalisation or now also the new PFLogPF normalisation).
bixverse-rs side in the next release, but needed now.Following things were added:
KmKnn as a nearest neighbour methodbixverseThe big one... First, shift of versioning + release of full single cell analysis suite. See below for more details.
preprocess_bulk_coexp() caused a matrix transpose.qc_bulk_dge() and normalise_bulk_dge().calculate_dge_limma() and calculate_dge_hedges().rs_set_similarity_list() renamed to rs_set_similarity_list2().
The former now takes a single list and calculates set similarity across all
permutations of elements.preprocess_bulk_dge() and calculate_all_dges() have been removed.weights parameter.cor_module_check_res() renamed to cor_module_graph_check_res()
and cor_module_final_modules() renamed to cor_module_graph_final_modules().n_more_extreme is now returned by GSEA
functions.future::plan() for iterating over resolutions in reciprocal best
hit graph generation.community_detection() now uses
params_community_detection() for parameters.