Package: symphony 0.1.1

symphony: Efficient and Precise Single-Cell Reference Atlas Mapping

Implements the Symphony single-cell reference building and query mapping algorithms and additional functions described in Kang et al <https://www.nature.com/articles/s41467-021-25957-x>.

Authors:Joyce Kang [aut, cre], Ilya Korsunsky [aut], Soumya Raychaudhuri [aut]

symphony_0.1.1.tar.gz
symphony_0.1.1.zip(r-4.5)symphony_0.1.1.zip(r-4.4)symphony_0.1.1.zip(r-4.3)
symphony_0.1.1.tgz(r-4.4-x86_64)symphony_0.1.1.tgz(r-4.4-arm64)symphony_0.1.1.tgz(r-4.3-x86_64)symphony_0.1.1.tgz(r-4.3-arm64)
symphony_0.1.1.tar.gz(r-4.5-noble)symphony_0.1.1.tar.gz(r-4.4-noble)
symphony_0.1.1.tgz(r-4.4-emscripten)symphony_0.1.1.tgz(r-4.3-emscripten)
symphony.pdf |symphony.html
symphony/json (API)

# Install 'symphony' in R:
install.packages('symphony', repos = c('https://joycekang.r-universe.dev', 'https://cloud.r-project.org'))

Peer review:

Uses libs:
  • openblas– Optimized BLAS
  • c++– GNU Standard C++ Library v3
Datasets:
  • pbmcs_exprs_small - Log(CP10k+1) normalized counts matrix (genes by cells) for 10x PBMCs dataset for vignette.
  • pbmcs_meta_small - Metadata for 10x PBMCs dataset for vignette.

On CRAN:

This package does not link to any Github/Gitlab/R-forge repository. No issue tracker or development information is available.

3.83 score 134 scripts 415 downloads 15 exports 54 dependencies

Last updated 2 years agofrom:28b2a1af71. Checks:OK: 1 NOTE: 8. Indexed: yes.

TargetResultDate
Doc / VignettesOKNov 20 2024
R-4.5-win-x86_64NOTENov 20 2024
R-4.5-linux-x86_64NOTENov 20 2024
R-4.4-win-x86_64NOTENov 20 2024
R-4.4-mac-x86_64NOTENov 20 2024
R-4.4-mac-aarch64NOTENov 20 2024
R-4.3-win-x86_64NOTENov 20 2024
R-4.3-mac-x86_64NOTENov 20 2024
R-4.3-mac-aarch64NOTENov 20 2024

Exports:buildReferencebuildReferenceFromHarmonyObjcalcknncorrcalcknncorrWithinQuerycalcPerCellMappingMetriccalcPerClusterMappingMetricevaluatefindVariableGenesknnPredictmapQueryplotReferencerowSDsrunPCAQueryAlonescaleDataWithStatsvargenes_vst

Dependencies:BHclassclicolorspacecowplotcpp11data.tabledplyrdqrngfansifarverFNNgenericsggplot2gluegtableharmonyirlbaisobandlabelinglatticelifecyclemagrittrMASSMatrixmgcvmunsellnlmepillarpkgconfigpurrrR6RANNRColorBrewerRcppRcppAnnoyRcppArmadilloRcppEigenRcppProgressRhpcBLASctlrlangRSpectrascalessitmostringistringrtibbletidyrtidyselectutf8uwotvctrsviridisLitewithr

Quickstart Tutorial

Rendered fromquickstart_tutorial.Rmdusingknitr::rmarkdownon Nov 20 2024.

Last update: 2021-08-05
Started: 2021-08-05

Readme and manuals

Help Manual

Help pageTopics
Function for building a Symphony reference starting from expression matrixbuildReference
Function for building a Symphony reference from a Harmony object. Useful if you would like your code to be more modular. Note that you must have saved vargenes_means_sds and PCA loadings.buildReferenceFromHarmonyObj
Calculates the k-NN correlation, which measures how well the sorted ordering of k nearest reference neighbors in a gold standard embedding correlate with the ordering for the same reference cells in an alternative embedding (i.e. from reference mapping). NOTE: it is very important for the order of reference cells (cols) in gold_ref matches that of alt_ref (same for matching columns of gold_query and alt_query).calcknncorr
Calculates the k-NN correlation within the query cells only, which measures how well the sorted ordering of k nearest query neighbors in a query de novo PCA embedding correlate with the ordering for the cells in the reference mapping embedding.calcknncorrWithinQuery
Per-cell Confidence Score: Calculates the weighted Mahalanobis distance for the query cells to reference clusters. Returns a vector of distance scores, one per query cell. Higher distance metric indicates less confidence.calcPerCellMappingMetric
Per-cluster Confidence Score: Calculates the Mahalanobis distance from user-defined query clusters to their nearest reference centroid after initial projection into reference PCA space. All query cells in a cluster get the same score. Higher distance indicates less confidence. Due to the instability of estimating covariance with small numbers of cells, we do not assign a score to clusters smaller than u * d, where d is the dimensionality of the embedding and u is specified.calcPerClusterMappingMetric
Function for evaluating F1 by cell type, adapted from automated cell type identifiaction benchmarking paper (Abdelaal et al. Genome Biology, 2019)evaluate
Function to find variable genes using mean variance relationship methodfindVariableGenes
Predict annotations of query cells from the reference using k-NN methodknnPredict
Function for mapping query cells to a Symphony referencemapQuery
Log(CP10k+1) normalized counts matrix (genes by cells) for 10x PBMCs dataset for vignette.pbmcs_exprs_small
Metadata for 10x PBMCs dataset for vignette.pbmcs_meta_small
Function to plot reference, colored by cell typeplotReference
Calculate standard deviations by rowrowSDs
Runs a standard PCA pipeline on query (1 batch). Assumes query_exp is already normalized.runPCAQueryAlone
Scale data with given mean and standard deviationsscaleDataWithStats
symphonysymphony
Function to find variable genes using variance stabilizing transform (vst) methodvargenes_vst