Last updated: 2026-07-31

Checks: 7 0

Knit directory: muse/

This reproducible R Markdown analysis was created with workflowr (version 1.7.2). The Checks tab describes the reproducibility checks that were applied when the results were created. The Past versions tab lists the development history.


Great! Since the R Markdown file has been committed to the Git repository, you know the exact version of the code that produced these results.

Great job! The global environment was empty. Objects defined in the global environment can affect the analysis in your R Markdown file in unknown ways. For reproduciblity it’s best to always run the code in an empty environment.

The command set.seed(20200712) was run prior to running the code in the R Markdown file. Setting a seed ensures that any results that rely on randomness, e.g. subsampling or permutations, are reproducible.

Great job! Recording the operating system, R version, and package versions is critical for reproducibility.

Nice! There were no cached chunks for this analysis, so you can be confident that you successfully produced the results during this run.

Great job! Using relative paths to the files within your workflowr project makes it easier to run your code on other machines.

Great! You are using Git for version control. Tracking code development and connecting the code version to the results is critical for reproducibility.

The results in this page were generated with repository version 43ca580. See the Past versions tab to see a history of the changes made to the R Markdown and HTML files.

Note that you need to be careful to ensure that all relevant files for the analysis have been committed to Git prior to generating the results (you can use wflow_publish or wflow_git_commit). workflowr only checks the R Markdown file, but you know if there are other scripts or data files that it depends on. Below is the status of the Git repository when the results were generated:


Ignored files:
    Ignored:    .Rproj.user/
    Ignored:    data/1M_neurons_filtered_gene_bc_matrices_h5.h5
    Ignored:    data/293t/
    Ignored:    data/293t_3t3_filtered_gene_bc_matrices.tar.gz
    Ignored:    data/293t_filtered_gene_bc_matrices.tar.gz
    Ignored:    data/5k_Human_Donor1_PBMC_3p_gem-x_5k_Human_Donor1_PBMC_3p_gem-x_count_sample_filtered_feature_bc_matrix.h5
    Ignored:    data/5k_Human_Donor2_PBMC_3p_gem-x_5k_Human_Donor2_PBMC_3p_gem-x_count_sample_filtered_feature_bc_matrix.h5
    Ignored:    data/5k_Human_Donor3_PBMC_3p_gem-x_5k_Human_Donor3_PBMC_3p_gem-x_count_sample_filtered_feature_bc_matrix.h5
    Ignored:    data/5k_Human_Donor4_PBMC_3p_gem-x_5k_Human_Donor4_PBMC_3p_gem-x_count_sample_filtered_feature_bc_matrix.h5
    Ignored:    data/97516b79-8d08-46a6-b329-5d0a25b0be98.h5ad
    Ignored:    data/Parent_SC3v3_Human_Glioblastoma_filtered_feature_bc_matrix.tar.gz
    Ignored:    data/brain_counts/
    Ignored:    data/cl.obo
    Ignored:    data/cl.owl
    Ignored:    data/jurkat/
    Ignored:    data/jurkat:293t_50:50_filtered_gene_bc_matrices.tar.gz
    Ignored:    data/jurkat_293t/
    Ignored:    data/jurkat_filtered_gene_bc_matrices.tar.gz
    Ignored:    data/pbmc20k/
    Ignored:    data/pbmc20k_seurat/
    Ignored:    data/pbmc3k.csv
    Ignored:    data/pbmc3k.csv.gz
    Ignored:    data/pbmc3k.h5ad
    Ignored:    data/pbmc3k/
    Ignored:    data/pbmc3k_bpcells_mat/
    Ignored:    data/pbmc3k_export.mtx
    Ignored:    data/pbmc3k_matrix.mtx
    Ignored:    data/pbmc3k_seurat.rds
    Ignored:    data/pbmc4k_filtered_gene_bc_matrices.tar.gz
    Ignored:    data/pbmc_1k_v3_filtered_feature_bc_matrix.h5
    Ignored:    data/pbmc_1k_v3_raw_feature_bc_matrix.h5
    Ignored:    data/refdata-gex-GRCh38-2020-A.tar.gz
    Ignored:    data/seurat_1m_neuron.rds
    Ignored:    data/t_3k_filtered_gene_bc_matrices.tar.gz
    Ignored:    r_packages_4.5.2/

Untracked files:
    Untracked:  .claude/
    Untracked:  CLAUDE.md
    Untracked:  analysis/.claude/
    Untracked:  analysis/aucc.Rmd
    Untracked:  analysis/bimodal.Rmd
    Untracked:  analysis/bioc.Rmd
    Untracked:  analysis/bioc_scrnaseq.Rmd
    Untracked:  analysis/chick_weight.Rmd
    Untracked:  analysis/likelihood.Rmd
    Untracked:  analysis/modelling.Rmd
    Untracked:  analysis/sampleqc.Rmd
    Untracked:  analysis/wordpress_readability.Rmd
    Untracked:  bpcells_matrix/
    Untracked:  data/Caenorhabditis_elegans.WBcel235.113.gtf.gz
    Untracked:  data/GCF_043380555.1-RS_2024_12_gene_ontology.gaf.gz
    Untracked:  data/SC3pv3_GEX_Human_PBMC_filtered_feature_bc_matrix.h5
    Untracked:  data/SC3pv3_GEX_Human_PBMC_raw_feature_bc_matrix.h5
    Untracked:  data/SeuratObj.rds
    Untracked:  data/arab.rds
    Untracked:  data/astronomicalunit.csv
    Untracked:  data/azimuth_pbmc/
    Untracked:  data/davetang039sblog.WordPress.2026-02-12.xml
    Untracked:  data/femaleMiceWeights.csv
    Untracked:  data/lung_bcell.rds
    Untracked:  data/tmp/
    Untracked:  m3/
    Untracked:  output/decontx_corrected.rds
    Untracked:  output/dropletutils_cells.rds
    Untracked:  output/soupx_corrected.rds
    Untracked:  posts/
    Untracked:  women.json

Unstaged changes:
    Modified:   analysis/isoform_switch_analyzer.Rmd

Note that any generated files, e.g. HTML, png, CSS, etc., are not included in this status report because it is ok for generated content to have uncommitted changes.


These are the previous versions of the repository in which changes were made to the R Markdown (analysis/azimuth.Rmd) and HTML (docs/azimuth.html) files. If you’ve configured a remote Git repository (see ?wflow_git_remote), click on the hyperlinks in the table below to view the files as they were in that past version.

File Version Author Date Message
Rmd 43ca580 Dave Tang 2026-07-31 Checking out an Azimuth model

Background

Azimuth provides a reference and a query cell is placed individually on this reference, and then labelled by a weighted vote using the reference cells it lands near.

Installation

Install as per the official instructions.

if (!requireNamespace('remotes', quietly = TRUE)) {
  install.packages('remotes')
}
remotes::install_github('satijalab/azimuth', ref = 'master')

Azimuth reference

We will examine the Human PBMC reference that has been downloaded using zenodo_get.

zenodo_get -r 4546839

An Azimuth model holds two files:

  • ref.Rds, a Seurat object carrying the reference cells, their labels and a precomputed dimensional reduction
  • idx.annoy, an approximate nearest neighbor index over that reduction.
azimuth_model <- paste0("data/azimuth_pbmc/")
stopifnot(dir.exists(azimuth_model))

RunAzimuth() calls Azimuth:::LoadReference() internally; we will call the same function directly. It accepts a local directory or a URL, and returns a list of two Seurat objects:

  • $map used for the annotation, and
  • $plot a lighter copy used only for drawing the reference UMAP.
azimuth_obj <- Azimuth:::LoadReference(path = azimuth_model)
azimuth_obj
$map
An object of class Seurat 
5228 features across 36433 samples within 2 assays 
Active assay: refAssay (5000 features, 0 variable features)
 1 layer present: data
 1 other assay present: ADT
 2 dimensional reductions calculated: refUMAP, refDR

$plot
An object of class Seurat 
1 features across 24760 samples within 1 assay 
Active assay: RNA (1 features, 0 variable features)
 2 layers present: counts, data
 1 dimensional reduction calculated: refUMAP

refAssay is the default assay.

ref_assay_name <- SeuratObject::DefaultAssay(azimuth_obj$map)
ref_assay_name
[1] "refAssay"

We already saw above that there are 5,000 features.

all_features <- rownames(azimuth_obj$map)
length(all_features)
[1] 5000

refDR is the reduction the reference was built with. Its feature loadings define the coordinate system query cells are projected into, so its rownames are the genes that can influence where a query cell lands.

refdr_loadings <- SeuratObject::Loadings(azimuth_obj$map[["refDR"]])
refdr_features <- rownames(refdr_loadings)
dim(refdr_loadings)
[1] 5000   50

SCTAssay.

assay_obj <- azimuth_obj$map[[ref_assay_name]]
assay_obj
SCTAssay data with 5000 features for 36433 cells, and 1 SCTModel(s) 
First 10 features:
 S100A9, GNLY, S100A8, LYZ, IGKC, NKG7, IGLC2, IGHM, PPBP, CCL5 
all(row.names(assay_obj) == all_features)
[1] TRUE

The labels Azimuth can transfer are simply the reference’s metadata columns.

head(azimuth_obj$map@meta.data)
                    celltype.l1    celltype.l2           celltype.l3 ori.index
L1_AAACGAATCCTCACCA     other T            gdT                 gdT_3        27
L1_AAACGCTAGAGCATTA       CD8 T        CD8 TEM             CD8 TEM_2        30
L1_AAACGCTCAACGATCT       CD8 T        CD8 TCM             CD8 TCM_1        35
L1_AAACGCTGTGCTCGTG     other T            dnT                 dnT_2        40
L1_AAACGCTTCTTGGTCC           B B intermediate B intermediate lambda        42
L1_AAAGAACCAAGCGGAT       CD4 T        CD4 TCM             CD4 TCM_3        46
                    nCount_refAssay nFeature_refAssay
L1_AAACGAATCCTCACCA               0                 0
L1_AAACGCTAGAGCATTA               0                 0
L1_AAACGCTCAACGATCT               0                 0
L1_AAACGCTGTGCTCGTG               0                 0
L1_AAACGCTTCTTGGTCC               0                 0
L1_AAAGAACCAAGCGGAT               0                 0

Neighbour names.

neighbour_names <- names(methods::slot(azimuth_obj$map, "neighbors"))
neighbour_names
[1] "refdr.annoy.neighbors"

sessionInfo()
R version 4.5.2 (2025-10-31)
Platform: x86_64-pc-linux-gnu
Running under: Ubuntu 24.04.4 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3 
LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.26.so;  LAPACK version 3.12.0

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

time zone: Etc/UTC
tzcode source: system (glibc)

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] Azimuth_0.5.1      shinyBS_0.65.0     Seurat_5.5.1       SeuratObject_5.4.0
 [5] sp_2.2-3           lubridate_1.9.5    forcats_1.0.1      stringr_1.6.0     
 [9] dplyr_1.2.1        purrr_1.2.2        readr_2.1.6        tidyr_1.3.2       
[13] tibble_3.3.1       ggplot2_4.0.3      tidyverse_2.0.0    workflowr_1.7.2   

loaded via a namespace (and not attached):
  [1] fs_2.1.0                          ProtGenerics_1.42.0              
  [3] matrixStats_1.5.0                 spatstat.sparse_3.2-0            
  [5] bitops_1.0-9                      DirichletMultinomial_1.52.0      
  [7] TFBSTools_1.48.0                  httr_1.4.8                       
  [9] RColorBrewer_1.1-3                tools_4.5.2                      
 [11] sctransform_0.4.3                 R6_2.6.1                         
 [13] DT_0.34.0                         lazyeval_0.2.3                   
 [15] uwot_0.2.4                        rhdf5filters_1.22.0              
 [17] withr_3.0.3                       gridExtra_2.3.1                  
 [19] progressr_1.0.0                   cli_3.6.6                        
 [21] Biobase_2.70.0                    spatstat.explore_3.8-2           
 [23] fastDummies_1.7.6                 EnsDb.Hsapiens.v86_2.99.0        
 [25] shinyjs_2.1.1                     sass_0.4.10                      
 [27] S7_0.2.2                          spatstat.data_3.1-9              
 [29] ggridges_0.5.7                    pbapply_1.7-4                    
 [31] Rsamtools_2.26.0                  parallelly_1.48.0                
 [33] BSgenome_1.78.0                   rstudioapi_0.18.0                
 [35] RSQLite_3.53.3                    generics_0.1.4                   
 [37] BiocIO_1.20.0                     gtools_3.9.5                     
 [39] ica_1.0-3                         spatstat.random_3.5-1            
 [41] googlesheets4_1.1.2               Matrix_1.7-4                     
 [43] S4Vectors_0.48.1                  abind_1.4-8                      
 [45] lifecycle_1.0.5                   whisker_0.4.1                    
 [47] yaml_2.3.12                       SummarizedExperiment_1.40.0      
 [49] rhdf5_2.54.1                      SparseArray_1.10.10              
 [51] Rtsne_0.17                        grid_4.5.2                       
 [53] blob_1.3.0                        promises_1.5.0                   
 [55] shinydashboard_0.7.3              crayon_1.5.3                     
 [57] pwalign_1.6.0                     miniUI_0.1.2                     
 [59] lattice_0.22-7                    cowplot_1.2.0                    
 [61] GenomicFeatures_1.62.0            cigarillo_1.0.0                  
 [63] KEGGREST_1.50.0                   pillar_1.11.1                    
 [65] knitr_1.51                        GenomicRanges_1.62.1             
 [67] rjson_0.2.23                      future.apply_1.20.2              
 [69] codetools_0.2-20                  fastmatch_1.1-8                  
 [71] glue_1.8.1                        getPass_0.2-4                    
 [73] spatstat.univar_3.2-0             data.table_1.18.4                
 [75] vctrs_0.7.3                       png_0.1-9                        
 [77] spam_2.11-4                       cellranger_1.1.0                 
 [79] gtable_0.3.6                      cachem_1.1.0                     
 [81] xfun_0.60                         Signac_1.17.1                    
 [83] S4Arrays_1.10.1                   mime_0.13                        
 [85] Seqinfo_1.0.0                     survival_3.8-3                   
 [87] gargle_1.6.1                      RcppRoll_0.3.2                   
 [89] fitdistrplus_1.2-6                ROCR_1.0-12                      
 [91] nlme_3.1-168                      bit64_4.8.2                      
 [93] RcppAnnoy_0.0.23                  GenomeInfoDb_1.46.2              
 [95] rprojroot_2.1.1                   bslib_0.11.0                     
 [97] irlba_2.3.7                       KernSmooth_2.23-26               
 [99] otel_0.2.0                        SeuratDisk_0.0.0.9021            
[101] seqLogo_1.76.0                    BiocGenerics_0.56.0              
[103] DBI_1.3.0                         tidyselect_1.2.1                 
[105] processx_3.8.6                    bit_4.6.0                        
[107] compiler_4.5.2                    curl_7.1.0                       
[109] git2r_0.36.2                      hdf5r_1.3.12                     
[111] DelayedArray_0.36.1               plotly_4.12.1                    
[113] rtracklayer_1.70.1                scales_1.4.0                     
[115] caTools_1.18.4                    lmtest_0.9-40                    
[117] callr_3.7.6                       rappdirs_0.3.4                   
[119] digest_0.6.39                     goftest_1.2-3                    
[121] presto_1.0.0                      spatstat.utils_3.2-4             
[123] rmarkdown_2.31                    XVector_0.50.0                   
[125] htmltools_0.5.9                   pkgconfig_2.0.3                  
[127] sparseMatrixStats_1.22.0          MatrixGenerics_1.22.0            
[129] fastmap_1.2.0                     ensembldb_2.34.0                 
[131] rlang_1.3.0                       htmlwidgets_1.6.4                
[133] UCSC.utils_1.6.1                  shiny_1.14.0                     
[135] farver_2.1.2                      jquerylib_0.1.4                  
[137] zoo_1.8-15                        jsonlite_2.0.0                   
[139] BiocParallel_1.44.0               RCurl_1.98-1.19                  
[141] magrittr_2.0.5                    dotCall64_1.2                    
[143] patchwork_1.3.2                   Rhdf5lib_1.32.0                  
[145] Rcpp_1.1.2                        reticulate_1.46.0                
[147] stringi_1.8.7                     MASS_7.3-65                      
[149] plyr_1.8.9                        parallel_4.5.2                   
[151] listenv_1.0.0                     ggrepel_0.9.8                    
[153] deldir_2.0-4                      Biostrings_2.78.0                
[155] splines_4.5.2                     tensor_1.5.1                     
[157] hms_1.1.4                         BSgenome.Hsapiens.UCSC.hg38_1.4.5
[159] ps_1.9.1                          igraph_2.3.3                     
[161] spatstat.geom_3.8-2               RcppHNSW_0.7.0                   
[163] reshape2_1.4.5                    stats4_4.5.2                     
[165] TFMPvalue_1.0.0                   XML_3.99-0.23                    
[167] evaluate_1.0.5                    JASPAR2020_0.99.10               
[169] tzdb_0.5.0                        httpuv_1.6.17                    
[171] RANN_2.6.2                        polyclip_1.10-7                  
[173] future_1.75.0                     SeuratData_0.2.2.9002            
[175] scattermore_1.2                   xtable_1.8-8                     
[177] restfulr_0.0.17                   AnnotationFilter_1.34.0          
[179] RSpectra_0.16-2                   later_1.4.8                      
[181] googledrive_2.1.2                 viridisLite_0.4.3                
[183] memoise_2.0.1                     AnnotationDbi_1.72.0             
[185] GenomicAlignments_1.46.0          IRanges_2.44.0                   
[187] cluster_2.1.8.1                   timechange_0.4.0                 
[189] globals_0.19.1