diff --git a/404.html b/404.html index a44a4bc..c47309d 100644 --- a/404.html +++ b/404.html @@ -24,7 +24,7 @@ SpotSweeper - 0.99.4 + 0.99.5 diff --git a/CODE_OF_CONDUCT.html b/CODE_OF_CONDUCT.html index 29fd91d..9127a44 100644 --- a/CODE_OF_CONDUCT.html +++ b/CODE_OF_CONDUCT.html @@ -10,7 +10,7 @@ SpotSweeper - 0.99.4 + 0.99.5 diff --git a/CONTRIBUTING.html b/CONTRIBUTING.html index 071a970..48e155f 100644 --- a/CONTRIBUTING.html +++ b/CONTRIBUTING.html @@ -10,7 +10,7 @@ SpotSweeper - 0.99.4 + 0.99.5 diff --git a/LICENSE-text.html b/LICENSE-text.html index ffe805d..3de0af7 100644 --- a/LICENSE-text.html +++ b/LICENSE-text.html @@ -10,7 +10,7 @@ SpotSweeper - 0.99.4 + 0.99.5 diff --git a/LICENSE.html b/LICENSE.html index 96fcf60..59e5791 100644 --- a/LICENSE.html +++ b/LICENSE.html @@ -10,7 +10,7 @@ SpotSweeper - 0.99.4 + 0.99.5 diff --git a/SUPPORT.html b/SUPPORT.html index 24c79d5..8c29650 100644 --- a/SUPPORT.html +++ b/SUPPORT.html @@ -10,7 +10,7 @@ SpotSweeper - 0.99.4 + 0.99.5 diff --git a/articles/getting_started.html b/articles/getting_started.html index 5f3fe66..4c48261 100644 --- a/articles/getting_started.html +++ b/articles/getting_started.html @@ -26,7 +26,7 @@ SpotSweeper - 0.99.4 + 0.99.5 @@ -427,7 +427,7 @@ Visualizing artifacts## [13] MatrixGenerics_1.14.0 matrixStats_1.3.0 ## [15] ExperimentHub_2.10.0 AnnotationHub_3.10.1 ## [17] BiocFileCache_2.10.2 dbplyr_2.5.0 -## [19] BiocGenerics_0.48.1 SpotSweeper_0.99.4 +## [19] BiocGenerics_0.48.1 SpotSweeper_0.99.5 ## [21] BiocStyle_2.30.0 ## ## loaded via a namespace (and not attached): diff --git a/articles/index.html b/articles/index.html index d35a79a..092eb32 100644 --- a/articles/index.html +++ b/articles/index.html @@ -10,7 +10,7 @@ SpotSweeper - 0.99.4 + 0.99.5 diff --git a/authors.html b/authors.html index bc9a3f4..19f7da6 100644 --- a/authors.html +++ b/authors.html @@ -10,7 +10,7 @@ SpotSweeper - 0.99.4 + 0.99.5 @@ -68,14 +68,14 @@ Citation MicTott (2024). SpotSweeper: Spot and artifact-level quality control for spatially-resolved transcriptomics data. -doi:10.18129/B9.bioc.SpotSweeper, https://github.com/MicTott/SpotSweeper/SpotSweeper - R package version 0.99.4, http://www.bioconductor.org/packages/SpotSweeper. +doi:10.18129/B9.bioc.SpotSweeper, https://github.com/MicTott/SpotSweeper/SpotSweeper - R package version 0.99.5, http://www.bioconductor.org/packages/SpotSweeper. @Manual{, title = {SpotSweeper: Spot and artifact-level quality control for spatially-resolved transcriptomics data}, author = {{MicTott}}, year = {2024}, url = {http://www.bioconductor.org/packages/SpotSweeper}, - note = {https://github.com/MicTott/SpotSweeper/SpotSweeper - R package version 0.99.4}, + note = {https://github.com/MicTott/SpotSweeper/SpotSweeper - R package version 0.99.5}, doi = {10.18129/B9.bioc.SpotSweeper}, } MicTott (2024). diff --git a/index.html b/index.html index c3e7436..b6eec24 100644 --- a/index.html +++ b/index.html @@ -26,7 +26,7 @@ SpotSweeper - 0.99.4 + 0.99.5 diff --git a/news/index.html b/news/index.html index 2f4b69a..eab5ba1 100644 --- a/news/index.html +++ b/news/index.html @@ -10,7 +10,7 @@ SpotSweeper - 0.99.4 + 0.99.5 diff --git a/pkgdown.yml b/pkgdown.yml index cad04c5..cb1a90c 100644 --- a/pkgdown.yml +++ b/pkgdown.yml @@ -3,7 +3,7 @@ pkgdown: 2.0.9 pkgdown_sha: ~ articles: getting_started: getting_started.html -last_built: 2024-04-19T17:49Z +last_built: 2024-04-19T19:29Z urls: reference: https://mictott.github.io/SpotSweeper/reference article: https://mictott.github.io/SpotSweeper/articles diff --git a/reference/DLPFC_artifact.html b/reference/DLPFC_artifact.html index cc6b50b..361ab13 100644 --- a/reference/DLPFC_artifact.html +++ b/reference/DLPFC_artifact.html @@ -20,7 +20,7 @@ SpotSweeper - 0.99.4 + 0.99.5 diff --git a/reference/findArtifacts.html b/reference/findArtifacts.html index f46ea84..3cb1536 100644 --- a/reference/findArtifacts.html +++ b/reference/findArtifacts.html @@ -16,7 +16,7 @@ SpotSweeper - 0.99.4 + 0.99.5 diff --git a/reference/index.html b/reference/index.html index 53c5b8e..bd650b6 100644 --- a/reference/index.html +++ b/reference/index.html @@ -10,7 +10,7 @@ SpotSweeper - 0.99.4 + 0.99.5 diff --git a/reference/localOutliers.html b/reference/localOutliers.html index 873cc39..f4de5b2 100644 --- a/reference/localOutliers.html +++ b/reference/localOutliers.html @@ -18,7 +18,7 @@ SpotSweeper - 0.99.4 + 0.99.5 diff --git a/reference/localVariance.html b/reference/localVariance.html index 8904839..a861961 100644 --- a/reference/localVariance.html +++ b/reference/localVariance.html @@ -10,7 +10,7 @@ SpotSweeper - 0.99.4 + 0.99.5 diff --git a/reference/plotQC.html b/reference/plotQC.html index 5ee14f1..68730c9 100644 --- a/reference/plotQC.html +++ b/reference/plotQC.html @@ -16,7 +16,7 @@ SpotSweeper - 0.99.4 + 0.99.5 diff --git a/reference/plotQCpdf.html b/reference/plotQCpdf.html index f888c38..0672f0b 100644 --- a/reference/plotQCpdf.html +++ b/reference/plotQCpdf.html @@ -16,7 +16,7 @@ SpotSweeper - 0.99.4 + 0.99.5 diff --git a/search.json b/search.json index d720f61..0689563 100644 --- a/search.json +++ b/search.json @@ -1 +1 @@ -[{"path":"https://mictott.github.io/SpotSweeper/CONTRIBUTING.html","id":null,"dir":"","previous_headings":"","what":"Contributing to SpotSweeper","title":"Contributing to SpotSweeper","text":"outlines propose change SpotSweeper. detailed discussion contributing tidyverse packages, please see development contributing guide code review principles.","code":""},{"path":"https://mictott.github.io/SpotSweeper/CONTRIBUTING.html","id":"fixing-typos","dir":"","previous_headings":"","what":"Fixing typos","title":"Contributing to SpotSweeper","text":"can fix typos, spelling mistakes, grammatical errors documentation directly using GitHub web interface, long changes made source file. generally means ’ll need edit roxygen2 comments .R, .Rd file. can find .R file generates .Rd reading comment first line.","code":""},{"path":"https://mictott.github.io/SpotSweeper/CONTRIBUTING.html","id":"bigger-changes","dir":"","previous_headings":"","what":"Bigger changes","title":"Contributing to SpotSweeper","text":"want make bigger change, ’s good idea first file issue make sure someone team agrees ’s needed. ’ve found bug, please file issue illustrates bug minimal reprex (also help write unit test, needed). See guide create great issue advice.","code":""},{"path":"https://mictott.github.io/SpotSweeper/CONTRIBUTING.html","id":"pull-request-process","dir":"","previous_headings":"Bigger changes","what":"Pull request process","title":"Contributing to SpotSweeper","text":"Fork package clone onto computer. haven’t done , recommend using usethis::create_from_github(\"MicTott/SpotSweeper\", fork = TRUE). Install development dependencies devtools::install_dev_deps(), make sure package passes R CMD check running devtools::check(). R CMD check doesn’t pass cleanly, ’s good idea ask help continuing. Create Git branch pull request (PR). recommend using usethis::pr_init(\"brief-description--change\"). Make changes, commit git, create PR running usethis::pr_push(), following prompts browser. title PR briefly describe change. body PR contain Fixes #issue-number. user-facing changes, add bullet top NEWS.md (.e. just first header). Follow style described https://style.tidyverse.org/news.html.","code":""},{"path":"https://mictott.github.io/SpotSweeper/CONTRIBUTING.html","id":"code-style","dir":"","previous_headings":"Bigger changes","what":"Code style","title":"Contributing to SpotSweeper","text":"New code follow tidyverse style guide. can use styler package apply styles, please don’t restyle code nothing PR. use roxygen2, Markdown syntax, documentation. use testthat unit tests. Contributions test cases included easier accept.","code":""},{"path":"https://mictott.github.io/SpotSweeper/CONTRIBUTING.html","id":"code-of-conduct","dir":"","previous_headings":"","what":"Code of Conduct","title":"Contributing to SpotSweeper","text":"Please note SpotSweeper project released Contributor Code Conduct. contributing project agree abide terms.","code":""},{"path":"https://mictott.github.io/SpotSweeper/LICENSE.html","id":null,"dir":"","previous_headings":"","what":"MIT License","title":"MIT License","text":"Copyright (c) 2024 SpotSweeper authors Permission hereby granted, free charge, person obtaining copy software associated documentation files (“Software”), deal Software without restriction, including without limitation rights use, copy, modify, merge, publish, distribute, sublicense, /sell copies Software, permit persons Software furnished , subject following conditions: copyright notice permission notice shall included copies substantial portions Software. SOFTWARE PROVIDED “”, WITHOUT WARRANTY KIND, EXPRESS IMPLIED, INCLUDING LIMITED WARRANTIES MERCHANTABILITY, FITNESS PARTICULAR PURPOSE NONINFRINGEMENT. EVENT SHALL AUTHORS COPYRIGHT HOLDERS LIABLE CLAIM, DAMAGES LIABILITY, WHETHER ACTION CONTRACT, TORT OTHERWISE, ARISING , CONNECTION SOFTWARE USE DEALINGS SOFTWARE.","code":""},{"path":"https://mictott.github.io/SpotSweeper/SUPPORT.html","id":null,"dir":"","previous_headings":"","what":"Getting help with SpotSweeper","title":"Getting help with SpotSweeper","text":"Thank using SpotSweeper! filing issue, things know make process smooth possible parties.","code":""},{"path":"https://mictott.github.io/SpotSweeper/SUPPORT.html","id":"make-a-reprex","dir":"","previous_headings":"","what":"Make a reprex","title":"Getting help with SpotSweeper","text":"Start making minimally reproducible example, also known ‘reprex’. may use reprex R package create one, though necessary help. make R-question-asking endeavors easier. Learning use takes 5 10 minutes. tips make minimally reproducible example, see StackOverflow link.","code":""},{"path":"https://mictott.github.io/SpotSweeper/SUPPORT.html","id":"where-to-post-it","dir":"","previous_headings":"","what":"Where to post it?","title":"Getting help with SpotSweeper","text":"Bioconductor help web page gives overview places may help answer question. Bioconductor software related questions, bug reports feature requests, addressed appropriate Bioconductor/SpotSweeper GitHub repository. Follow bug report feature request templates GitHub. package GitHub repository, see next bullet point. Bioconductor software usage questions addressed Bioconductor Support Website. Make sure use appropriate package tag, otherwise package authors get notification. General R questions can posed StackOverflow RStudio Community website especially pertain tidyverse RStudio GUI related products.","code":""},{"path":"https://mictott.github.io/SpotSweeper/SUPPORT.html","id":"issues-or-feature-requests","dir":"","previous_headings":"","what":"Issues or Feature Requests","title":"Getting help with SpotSweeper","text":"opening new issue feature request, sure search issues pull requests ensure one already exist implemented development version. Note. can remove :open search term issues page search open closed issues. See link learn modifying search.","code":""},{"path":"https://mictott.github.io/SpotSweeper/SUPPORT.html","id":"what-happens-next","dir":"","previous_headings":"","what":"What happens next?","title":"Getting help with SpotSweeper","text":"Bioconductor maintainers limited resources strive responsive possible. Please forget tag appropriate maintainer issue GitHub username (e.g., @username). order make easy possible Bioconductor core developers remediate issue. Provide accurate, brief, reproducible report outlined issue templates. Thank trusting Bioconductor.","code":""},{"path":"https://mictott.github.io/SpotSweeper/articles/getting_started.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"Getting started with 'SpotSweeper'","text":"SpotSweeper R package spatial transcriptomics data quality control (QC). provides functions detecting visualizing spot-level local outliers artifacts using spatially-aware methods. package designed work SpatialExperiment objects, compatible data 10X Genomics Visium spatial transcriptomics platforms.","code":""},{"path":"https://mictott.github.io/SpotSweeper/articles/getting_started.html","id":"installation","dir":"Articles","previous_headings":"","what":"Installation","title":"Getting started with 'SpotSweeper'","text":"Currently, way install SpotSweeper downloading development version can installed GitHub using following: accepted Bioconductor, SpotSweeper installable using:","code":"if (!require(\"devtools\")) install.packages(\"devtools\") remotes::install_github(\"MicTott/SpotSweeper\") if (!requireNamespace(\"BiocManager\", quietly = TRUE)) { install.packages(\"BiocManager\") } BiocManager::install(\"SpotSweeper\")"},{"path":[]},{"path":"https://mictott.github.io/SpotSweeper/articles/getting_started.html","id":"loading-example-data","dir":"Articles","previous_headings":"Spot-level local outlier detection","what":"Loading example data","title":"Getting started with 'SpotSweeper'","text":"’ll walk standard workflow using ‘SpotSweeper’ detect visualize local outliers spatial transcriptomics data. ’ll use Visium_humanDLPFC dataset STexampleData package, SpatialExperiment object. local outliers saved colData SpatialExperiment object, ’ll first view colData drop --tissue spots calculating quality control (QC) metrics running SpotSweeper.","code":"library(SpotSweeper) # load Maynard et al DLPFC daatset spe <- STexampleData::Visium_humanDLPFC() ## see ?STexampleData and browseVignettes('STexampleData') for documentation ## loading from cache # show column data before SpotSweeper colnames(colData(spe)) ## [1] \"barcode_id\" \"sample_id\" \"in_tissue\" \"array_row\" \"array_col\" ## [6] \"ground_truth\" \"cell_count\" # drop out-of-tissue spots spe <- spe[, spe$in_tissue == 1]"},{"path":"https://mictott.github.io/SpotSweeper/articles/getting_started.html","id":"calculating-qc-metrics-using-scuttle","dir":"Articles","previous_headings":"Spot-level local outlier detection","what":"Calculating QC metrics using scuttle","title":"Getting started with 'SpotSweeper'","text":"’ll use scuttle package calculate QC metrics. , ’ll need first change rownames gene id gene names. ’ll get mitochondrial transcripts calculate QC metrics spot using scuttle::addPerCellQCMetrics.","code":"# change from gene id to gene names rownames(spe) <- rowData(spe)$gene_name # identifying the mitochondrial transcripts is.mito <- rownames(spe)[grepl(\"^MT-\", rownames(spe))] # calculating QC metrics for each spot using scuttle spe <- scuttle::addPerCellQCMetrics(spe, subsets = list(Mito = is.mito)) colnames(colData(spe)) ## [1] \"barcode_id\" \"sample_id\" \"in_tissue\" ## [4] \"array_row\" \"array_col\" \"ground_truth\" ## [7] \"cell_count\" \"sum\" \"detected\" ## [10] \"subsets_Mito_sum\" \"subsets_Mito_detected\" \"subsets_Mito_percent\" ## [13] \"total\""},{"path":"https://mictott.github.io/SpotSweeper/articles/getting_started.html","id":"identifying-local-outliers-using-spotsweeper","dir":"Articles","previous_headings":"Spot-level local outlier detection","what":"Identifying local outliers using SpotSweeper","title":"Getting started with 'SpotSweeper'","text":"can now use SpotSweeper identify local outliers spatial transcriptomics data. ’ll use localOutliers function detect local outliers based unique detected genes, total library size, percent total reads mitochondrial. methods assume normal distribution, ’ll use log-transformed sum counts log-transformed number detected genes. mitochondrial percent, ’ll use raw mitochondrial percentage. localOutlier function automatically outputs results colData naming convention X_outliers, X name input colData. can combine outliers single column called local_outliers colData SpatialExperiment object.","code":"# library size spe <- localOutliers(spe, metric = \"sum\", direction = \"lower\", log = TRUE ) # unique genes spe <- localOutliers(spe, metric = \"detected\", direction = \"lower\", log = TRUE ) # mitochondrial percent spe <- localOutliers(spe, metric = \"subsets_Mito_percent\", direction = \"higher\", log = FALSE ) # combine all outliers into \"local_outliers\" column spe$local_outliers <- as.logical(spe$sum_outliers) | as.logical(spe$detected_outliers) | as.logical(spe$subsets_Mito_percent_outliers)"},{"path":"https://mictott.github.io/SpotSweeper/articles/getting_started.html","id":"visualizing-local-outliers","dir":"Articles","previous_headings":"Spot-level local outlier detection","what":"Visualizing local outliers","title":"Getting started with 'SpotSweeper'","text":"can visualize local outliers using plotQC function. function creates scatter plot specified metric highlights local outliers red using escheR package. , ’ll visualize local outliers library size, unique genes, mitochondrial percent, finally, local outliers. ’ll arrange plots grid using ggpubr::arrange.","code":"library(escheR) ## Loading required package: ggplot2 library(ggpubr) # library size p1 <- plotQC(spe, metric = \"sum_log\", outliers = \"sum_outliers\", point_size = 1.1 ) + ggtitle(\"Library Size\") # unique genes p2 <- plotQC(spe, metric = \"detected_log\", outliers = \"detected_outliers\", point_size = 1.1 ) + ggtitle(\"Unique Genes\") # mitochondrial percent p3 <- plotQC(spe, metric = \"subsets_Mito_percent\", outliers = \"subsets_Mito_percent_outliers\", point_size = 1.1 ) + ggtitle(\"Mitochondrial Percent\") # all local outliers p4 <- plotQC(spe, metric = \"sum_log\", outliers = \"local_outliers\", point_size = 1.1, stroke = 0.75 ) + ggtitle(\"All Local Outliers\") # plot plot_list <- list(p1, p2, p3, p4) ggarrange( plotlist = plot_list, ncol = 2, nrow = 2, common.legend = FALSE )"},{"path":[]},{"path":"https://mictott.github.io/SpotSweeper/articles/getting_started.html","id":"loading-example-data-1","dir":"Articles","previous_headings":"Removing technical artifacts using SpotSweeper","what":"Loading example data","title":"Getting started with 'SpotSweeper'","text":"","code":"# load in DLPFC sample with hangnail artifact data(DLPFC_artifact) spe <- DLPFC_artifact # inspect colData before artifact detection colnames(colData(spe)) ## [1] \"sample_id\" \"in_tissue\" \"array_row\" ## [4] \"array_col\" \"key\" \"sum_umi\" ## [7] \"sum_gene\" \"expr_chrM\" \"expr_chrM_ratio\" ## [10] \"ManualAnnotation\" \"subject\" \"region\" ## [13] \"sex\" \"age\" \"diagnosis\" ## [16] \"sample_id_complete\" \"count\" \"sizeFactor\""},{"path":"https://mictott.github.io/SpotSweeper/articles/getting_started.html","id":"visualizing-technical-artifacts","dir":"Articles","previous_headings":"Removing technical artifacts using SpotSweeper","what":"Visualizing technical artifacts","title":"Getting started with 'SpotSweeper'","text":"Technical artifacts can commonly visualized standard QC metrics, including library size, unique genes, mitochondrial percentage. can first visualize technical artifacts using plotQC function. function plots Visium spots specified QC metric.’ll arrange plots using ggpubr::arrange.","code":"# library size p1 <- plotQC(spe, metric = \"sum_umi\", outliers = NULL, point_size = 1.1 ) + ggtitle(\"Library Size\") # unique genes p2 <- plotQC(spe, metric = \"sum_gene\", outliers = NULL, point_size = 1.1 ) + ggtitle(\"Unique Genes\") # mitochondrial percent p3 <- plotQC(spe, metric = \"expr_chrM_ratio\", outliers = NULL, point_size = 1.1 ) + ggtitle(\"Mitochondrial Percent\") # plot plot_list <- list(p1, p2, p3) ggarrange( plotlist = plot_list, ncol = 3, nrow = 1, common.legend = FALSE )"},{"path":"https://mictott.github.io/SpotSweeper/articles/getting_started.html","id":"identifying-artifacts-using-spotsweeper","dir":"Articles","previous_headings":"Removing technical artifacts using SpotSweeper","what":"Identifying artifacts using SpotSweeper","title":"Getting started with 'SpotSweeper'","text":"can use findArtifacts function identify artifacts spatial transcriptomics (data. function identifies technical artifacts based first principle component local variance specified QC metric (mito_percent) numerous neighorhood sizes (n_rings=5). Currently, kmeans clustering used cluster technical artifact vs high-quality Visium spots. Similar localOutliers, findArtifacts function outputs results colData.","code":"# find artifacts using SpotSweeper spe <- findArtifacts(spe, mito_percent = \"expr_chrM_ratio\", mito_sum = \"expr_chrM\", n_rings = 5, name = \"artifact\" ) # check that \"artifact\" is now in colData colnames(colData(spe)) ## [1] \"sample_id\" \"in_tissue\" \"array_row\" ## [4] \"array_col\" \"key\" \"sum_umi\" ## [7] \"sum_gene\" \"expr_chrM\" \"expr_chrM_ratio\" ## [10] \"ManualAnnotation\" \"subject\" \"region\" ## [13] \"sex\" \"age\" \"diagnosis\" ## [16] \"sample_id_complete\" \"count\" \"sizeFactor\" ## [19] \"expr_chrM_ratio_log\" \"coords\" \"k6\" ## [22] \"k18\" \"k36\" \"k60\" ## [25] \"k90\" \"artifact\""},{"path":"https://mictott.github.io/SpotSweeper/articles/getting_started.html","id":"visualizing-artifacts","dir":"Articles","previous_headings":"Removing technical artifacts using SpotSweeper","what":"Visualizing artifacts","title":"Getting started with 'SpotSweeper'","text":"can visualize artifacts using escheR package. , ’ll visualize artifacts using plotQC function arrange plots using ggpubr::arrange. # Session information","code":"plotQC(spe, metric = \"expr_chrM_ratio\", outliers = \"artifact\", point_size = 1.1 ) + ggtitle(\"Hangnail artifact\") utils::sessionInfo() ## R version 4.3.3 (2024-02-29) ## Platform: x86_64-pc-linux-gnu (64-bit) ## Running under: Ubuntu 22.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.20.so; LAPACK version 3.10.0 ## ## locale: ## [1] LC_CTYPE=C.UTF-8 LC_NUMERIC=C LC_TIME=C.UTF-8 ## [4] LC_COLLATE=C.UTF-8 LC_MONETARY=C.UTF-8 LC_MESSAGES=C.UTF-8 ## [7] LC_PAPER=C.UTF-8 LC_NAME=C LC_ADDRESS=C ## [10] LC_TELEPHONE=C LC_MEASUREMENT=C.UTF-8 LC_IDENTIFICATION=C ## ## time zone: UTC ## tzcode source: system (glibc) ## ## attached base packages: ## [1] stats4 stats graphics grDevices utils datasets methods ## [8] base ## ## other attached packages: ## [1] ggpubr_0.6.0 escheR_1.2.0 ## [3] ggplot2_3.5.0 STexampleData_1.10.1 ## [5] SpatialExperiment_1.12.0 SingleCellExperiment_1.24.0 ## [7] SummarizedExperiment_1.32.0 Biobase_2.62.0 ## [9] GenomicRanges_1.54.1 GenomeInfoDb_1.38.8 ## [11] IRanges_2.36.0 S4Vectors_0.40.2 ## [13] MatrixGenerics_1.14.0 matrixStats_1.3.0 ## [15] ExperimentHub_2.10.0 AnnotationHub_3.10.1 ## [17] BiocFileCache_2.10.2 dbplyr_2.5.0 ## [19] BiocGenerics_0.48.1 SpotSweeper_0.99.4 ## [21] BiocStyle_2.30.0 ## ## loaded via a namespace (and not attached): ## [1] jsonlite_1.8.8 magrittr_2.0.3 ## [3] magick_2.8.3 farver_2.1.1 ## [5] rmarkdown_2.26 fs_1.6.3 ## [7] zlibbioc_1.48.2 ragg_1.3.0 ## [9] vctrs_0.6.5 memoise_2.0.1 ## [11] DelayedMatrixStats_1.24.0 RCurl_1.98-1.14 ## [13] terra_1.7-71 rstatix_0.7.2 ## [15] htmltools_0.5.8.1 S4Arrays_1.2.1 ## [17] curl_5.2.1 BiocNeighbors_1.20.2 ## [19] broom_1.0.5 SparseArray_1.2.4 ## [21] sass_0.4.9 bslib_0.7.0 ## [23] htmlwidgets_1.6.4 desc_1.4.3 ## [25] cachem_1.0.8 mime_0.12 ## [27] lifecycle_1.0.4 pkgconfig_2.0.3 ## [29] Matrix_1.6-5 R6_2.5.1 ## [31] fastmap_1.1.1 GenomeInfoDbData_1.2.11 ## [33] shiny_1.8.1.1 digest_0.6.35 ## [35] colorspace_2.1-0 AnnotationDbi_1.64.1 ## [37] textshaping_0.3.7 RSQLite_2.3.6 ## [39] beachmat_2.18.1 filelock_1.0.3 ## [41] labeling_0.4.3 fansi_1.0.6 ## [43] httr_1.4.7 abind_1.4-5 ## [45] compiler_4.3.3 bit64_4.0.5 ## [47] withr_3.0.0 backports_1.4.1 ## [49] BiocParallel_1.36.0 carData_3.0-5 ## [51] DBI_1.2.2 highr_0.10 ## [53] ggsignif_0.6.4 MASS_7.3-60.0.1 ## [55] rappdirs_0.3.3 DelayedArray_0.28.0 ## [57] rjson_0.2.21 tools_4.3.3 ## [59] interactiveDisplayBase_1.40.0 httpuv_1.6.15 ## [61] glue_1.7.0 promises_1.3.0 ## [63] grid_4.3.3 generics_0.1.3 ## [65] gtable_0.3.4 tidyr_1.3.1 ## [67] car_3.1-2 utf8_1.2.4 ## [69] XVector_0.42.0 BiocVersion_3.18.1 ## [71] pillar_1.9.0 later_1.3.2 ## [73] dplyr_1.1.4 lattice_0.22-5 ## [75] bit_4.0.5 tidyselect_1.2.1 ## [77] Biostrings_2.70.3 scuttle_1.12.0 ## [79] knitr_1.46 bookdown_0.39 ## [81] xfun_0.43 yaml_2.3.8 ## [83] evaluate_0.23 codetools_0.2-19 ## [85] spatialEco_2.0-2 tibble_3.2.1 ## [87] BiocManager_1.30.22 cli_3.6.2 ## [89] xtable_1.8-4 systemfonts_1.0.6 ## [91] munsell_0.5.1 jquerylib_0.1.4 ## [93] Rcpp_1.0.12 png_0.1-8 ## [95] parallel_4.3.3 pkgdown_2.0.9 ## [97] blob_1.2.4 sparseMatrixStats_1.14.0 ## [99] bitops_1.0-7 viridisLite_0.4.2 ## [101] scales_1.3.0 purrr_1.0.2 ## [103] crayon_1.5.2 rlang_1.1.3 ## [105] cowplot_1.1.3 KEGGREST_1.42.0"},{"path":"https://mictott.github.io/SpotSweeper/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Michael Totty. Author, maintainer. Boyi Guo. Author.","code":""},{"path":"https://mictott.github.io/SpotSweeper/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"MicTott (2024). SpotSweeper: Spot artifact-level quality control spatially-resolved transcriptomics data. doi:10.18129/B9.bioc.SpotSweeper, https://github.com/MicTott/SpotSweeper/SpotSweeper - R package version 0.99.4, http://www.bioconductor.org/packages/SpotSweeper. MicTott (2024). “SpotSweeper: Spot artifact-level quality control spatially-resolved transcriptomics data.” bioRxiv. doi:10.1101/TODO, https://www.biorxiv.org/content/10.1101/TODO.","code":"@Manual{, title = {SpotSweeper: Spot and artifact-level quality control for spatially-resolved transcriptomics data}, author = {{MicTott}}, year = {2024}, url = {http://www.bioconductor.org/packages/SpotSweeper}, note = {https://github.com/MicTott/SpotSweeper/SpotSweeper - R package version 0.99.4}, doi = {10.18129/B9.bioc.SpotSweeper}, } @Article{, title = {SpotSweeper: Spot and artifact-level quality control for spatially-resolved transcriptomics data}, author = {{MicTott}}, year = {2024}, journal = {bioRxiv}, doi = {10.1101/TODO}, url = {https://www.biorxiv.org/content/10.1101/TODO}, }"},{"path":"https://mictott.github.io/SpotSweeper/index.html","id":"spotsweeper","dir":"","previous_headings":"","what":"Spatially-aware quality control for spatial transcriptomics","title":"Spatially-aware quality control for spatial transcriptomics","text":"SpotSweeper package developed spatially-aware quality control (QC) methods detection, visualization, removal local outliers large artifacts spot-based spatial transcriptomics data, 10x Genomics Visium, using standard QC metrics. package currently development yet available Bioconductor. package currently experimental stage development. experience issues user package, please open issue GitHub repository. find information, please visit documentation website.","code":""},{"path":"https://mictott.github.io/SpotSweeper/index.html","id":"installation-instructions","dir":"","previous_headings":"","what":"Installation instructions","title":"Spatially-aware quality control for spatial transcriptomics","text":"can install latest version SpotSweeper Bioconductor following code: latest development version can installed GitHub using following:","code":"if (!requireNamespace(\"BiocManager\", quietly = TRUE)) { install.packages(\"BiocManager\") } BiocManager::install(\"SpotSweeper\") if (!require(\"devtools\")) install.packages(\"devtools\") remotes::install_github(\"MicTott/SpotSweeper\")"},{"path":"https://mictott.github.io/SpotSweeper/index.html","id":"input-data-format","dir":"","previous_headings":"","what":"Input data format","title":"Spatially-aware quality control for spatial transcriptomics","text":"examples , assume input data provided SpatialExperiment (SPE) object. outputs spot-level outliers artifacts stored colData SPE object.","code":""},{"path":"https://mictott.github.io/SpotSweeper/index.html","id":"tutorials","dir":"","previous_headings":"","what":"Tutorials","title":"Spatially-aware quality control for spatial transcriptomics","text":"detailed tutorial available package vignette Bioconductor. direct link tutorial / package vignette available .","code":""},{"path":"https://mictott.github.io/SpotSweeper/index.html","id":"development-tools","dir":"","previous_headings":"","what":"Development tools","title":"Spatially-aware quality control for spatial transcriptomics","text":"Continuous code testing possible thanks GitHub actions BiocStyle::Biocpkg('biocthis'). documentation website automatically updated thanks BiocStyle::CRANpkg('pkgdown'). code styled automatically thanks BiocStyle::CRANpkg('styler'). documentation formatted thanks BiocStyle::CRANpkg('devtools') BiocStyle::CRANpkg('roxygen2'). package developed using BiocStyle::Biocpkg('biocthis').","code":""},{"path":"https://mictott.github.io/SpotSweeper/reference/DLPFC_artifact.html","id":null,"dir":"Reference","previous_headings":"","what":"human DLPFC dataset with a technical artifact (hangnail). — DLPFC_artifact","title":"human DLPFC dataset with a technical artifact (hangnail). — DLPFC_artifact","text":"DLPFC_artifact dataset SpatialExperiment object containing single-sample subset human dorsolateral prefrontal cortex (DLPFC) dataset Hukki-Myers et al. 2023. particular sample ('Br2743_ant') included demonstrate identification removal technical artifacts within spatial transcriptomics data. dataset serves example artifact detection using 'SpotSweeper' workflow.","code":""},{"path":"https://mictott.github.io/SpotSweeper/reference/DLPFC_artifact.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"human DLPFC dataset with a technical artifact (hangnail). — DLPFC_artifact","text":"","code":"data(DLPFC_artifact)"},{"path":"https://mictott.github.io/SpotSweeper/reference/DLPFC_artifact.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"human DLPFC dataset with a technical artifact (hangnail). — DLPFC_artifact","text":"SpatialExperiment object.","code":""},{"path":"https://mictott.github.io/SpotSweeper/reference/DLPFC_artifact.html","id":"source","dir":"Reference","previous_headings":"","what":"Source","title":"human DLPFC dataset with a technical artifact (hangnail). — DLPFC_artifact","text":"spatialLIBD","code":""},{"path":"https://mictott.github.io/SpotSweeper/reference/DLPFC_artifact.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"human DLPFC dataset with a technical artifact (hangnail). — DLPFC_artifact","text":"Hukki-Myers et al. (2023) bioRxiv (bioRxiv)","code":""},{"path":"https://mictott.github.io/SpotSweeper/reference/DLPFC_artifact.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"human DLPFC dataset with a technical artifact (hangnail). — DLPFC_artifact","text":"","code":"data(DLPFC_artifact)"},{"path":"https://mictott.github.io/SpotSweeper/reference/findArtifacts.html","id":null,"dir":"Reference","previous_headings":"","what":"Identify and annotate artifacts in spatial transcriptomics data — findArtifacts","title":"Identify and annotate artifacts in spatial transcriptomics data — findArtifacts","text":"function identifies annotates potential artifacts spatial transcriptomics data. Artifacts detected based local mito variance, results added original SpatialExperiment (sce) object.","code":""},{"path":"https://mictott.github.io/SpotSweeper/reference/findArtifacts.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Identify and annotate artifacts in spatial transcriptomics data — findArtifacts","text":"","code":"findArtifacts( spe, mito_percent = \"expr_chrM_ratio\", mito_sum = \"expr_chrM\", samples = \"sample_id\", n_rings = 5, log = TRUE, name = \"artifact\", var_output = TRUE )"},{"path":"https://mictott.github.io/SpotSweeper/reference/findArtifacts.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Identify and annotate artifacts in spatial transcriptomics data — findArtifacts","text":"spe SingleCellExperiment object. mito_percent column name representing mitochondrial percent. Default 'expr_chrM_ratio'. mito_sum column name representing sum mitochondrial expression. Default 'expr_chrM'. samples column name representing sample IDs. Default 'sample_id'. n_rings number rings local mito variance calculation. Default 5. log Logical, indicating whether log1p transform mito_percent. Default TRUE. name Prefix local variance column names. Default 'artifact'. var_output Logical, indicating whether include local variances output. Default TRUE.","code":""},{"path":"https://mictott.github.io/SpotSweeper/reference/findArtifacts.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Identify and annotate artifacts in spatial transcriptomics data — findArtifacts","text":"Returns modified SingleCellExperiment object artifact annotations.","code":""},{"path":[]},{"path":"https://mictott.github.io/SpotSweeper/reference/findArtifacts.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Identify and annotate artifacts in spatial transcriptomics data — findArtifacts","text":"","code":"library(SpotSweeper) library(SpatialExperiment) #> Loading required package: SingleCellExperiment #> Loading required package: SummarizedExperiment #> Loading required package: MatrixGenerics #> Loading required package: matrixStats #> #> Attaching package: ‘MatrixGenerics’ #> The following objects are masked from ‘package:matrixStats’: #> #> colAlls, colAnyNAs, colAnys, colAvgsPerRowSet, colCollapse, #> colCounts, colCummaxs, colCummins, colCumprods, colCumsums, #> colDiffs, colIQRDiffs, colIQRs, colLogSumExps, colMadDiffs, #> colMads, colMaxs, colMeans2, colMedians, colMins, colOrderStats, #> colProds, colQuantiles, colRanges, colRanks, colSdDiffs, colSds, #> colSums2, colTabulates, colVarDiffs, colVars, colWeightedMads, #> colWeightedMeans, colWeightedMedians, colWeightedSds, #> colWeightedVars, rowAlls, rowAnyNAs, rowAnys, rowAvgsPerColSet, #> rowCollapse, rowCounts, rowCummaxs, rowCummins, rowCumprods, #> rowCumsums, rowDiffs, rowIQRDiffs, rowIQRs, rowLogSumExps, #> rowMadDiffs, rowMads, rowMaxs, rowMeans2, rowMedians, rowMins, #> rowOrderStats, rowProds, rowQuantiles, rowRanges, rowRanks, #> rowSdDiffs, rowSds, rowSums2, rowTabulates, rowVarDiffs, rowVars, #> rowWeightedMads, rowWeightedMeans, rowWeightedMedians, #> rowWeightedSds, rowWeightedVars #> Loading required package: GenomicRanges #> Loading required package: stats4 #> Loading required package: BiocGenerics #> #> Attaching package: ‘BiocGenerics’ #> The following objects are masked from ‘package:stats’: #> #> IQR, mad, sd, var, xtabs #> The following objects are masked from ‘package:base’: #> #> Filter, Find, Map, Position, Reduce, anyDuplicated, aperm, append, #> as.data.frame, basename, cbind, colnames, dirname, do.call, #> duplicated, eval, evalq, get, grep, grepl, intersect, is.unsorted, #> lapply, mapply, match, mget, order, paste, pmax, pmax.int, pmin, #> pmin.int, rank, rbind, rownames, sapply, setdiff, sort, table, #> tapply, union, unique, unsplit, which.max, which.min #> Loading required package: S4Vectors #> #> Attaching package: ‘S4Vectors’ #> The following object is masked from ‘package:utils’: #> #> findMatches #> The following objects are masked from ‘package:base’: #> #> I, expand.grid, unname #> Loading required package: IRanges #> Loading required package: GenomeInfoDb #> Loading required package: Biobase #> Welcome to Bioconductor #> #> Vignettes contain introductory material; view with #> 'browseVignettes()'. To cite Bioconductor, see #> 'citation(\"Biobase\")', and for packages 'citation(\"pkgname\")'. #> #> Attaching package: ‘Biobase’ #> The following object is masked from ‘package:MatrixGenerics’: #> #> rowMedians #> The following objects are masked from ‘package:matrixStats’: #> #> anyMissing, rowMedians library(escheR) #> Loading required package: ggplot2 data(DLPFC_artifact) spe <- DLPFC_artifact # find artifacts spe <- findArtifacts(spe, mito_percent = \"expr_chrM_ratio\", mito_sum = \"expr_chrM\", n_rings = 2, # 5 recommended, using 1 for time name = \"artifact\" )"},{"path":"https://mictott.github.io/SpotSweeper/reference/localOutliers.html","id":null,"dir":"Reference","previous_headings":"","what":"localOutliers Function — localOutliers","title":"localOutliers Function — localOutliers","text":"function detects local outliers spatial transcriptomics data based standard quality control metrics, library size, unique genes, mitochondrial ratio. Local outliers defined spots low/high quality metrics compared surrounding neighbors, based modified z-score statistic.","code":""},{"path":"https://mictott.github.io/SpotSweeper/reference/localOutliers.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"localOutliers Function — localOutliers","text":"","code":"localOutliers( spe, metric = \"detected\", direction = \"lower\", n_neighbors = 36, samples = \"sample_id\", log = TRUE, cutoff = 3 )"},{"path":"https://mictott.github.io/SpotSweeper/reference/localOutliers.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"localOutliers Function — localOutliers","text":"spe SpatialExperiment object metric colData QC metric use outlier detection direction Direction outlier detection (higher, lower, ) n_neighbors Number nearest neighbors use outlier detection samples Column name colData use sample IDs log Logical indicating whether log1p transform features (default TRUE) cutoff Cutoff outlier detection (default 3)","code":""},{"path":"https://mictott.github.io/SpotSweeper/reference/localOutliers.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"localOutliers Function — localOutliers","text":"SpatialExperiment object updated colData containing outputs","code":""},{"path":"https://mictott.github.io/SpotSweeper/reference/localOutliers.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"localOutliers Function — localOutliers","text":"","code":"library(SpotSweeper) library(SpatialExperiment) # load example data spe <- STexampleData::Visium_humanDLPFC() #> see ?STexampleData and browseVignettes('STexampleData') for documentation #> downloading 1 resources #> retrieving 1 resource #> loading from cache # change from gene id to gene names rownames(spe) <- rowData(spe)$gene_name # drop out-of-tissue spots spe <- spe[, spe$in_tissue == 1] spe <- spe[, !is.na(spe$ground_truth)] # Identifying the mitochondrial transcripts in our SpatialExperiment. is.mito <- rownames(spe)[grepl(\"^MT-\", rownames(spe))] # Calculating QC metrics for each spot using scuttle spe <- scuttle::addPerCellQCMetrics(spe, subsets = list(Mito = is.mito)) colnames(colData(spe)) #> [1] \"barcode_id\" \"sample_id\" \"in_tissue\" #> [4] \"array_row\" \"array_col\" \"ground_truth\" #> [7] \"cell_count\" \"sum\" \"detected\" #> [10] \"subsets_Mito_sum\" \"subsets_Mito_detected\" \"subsets_Mito_percent\" #> [13] \"total\" # Identifying local outliers using SpotSweeper spe <- localOutliers(spe, metric = \"sum\", direction = \"lower\", log = TRUE )"},{"path":"https://mictott.github.io/SpotSweeper/reference/localVariance.html","id":null,"dir":"Reference","previous_headings":"","what":"localVariance Function — localVariance","title":"localVariance Function — localVariance","text":"function calculates local variance based kNN.","code":""},{"path":"https://mictott.github.io/SpotSweeper/reference/localVariance.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"localVariance Function — localVariance","text":"","code":"localVariance( spe, n_neighbors = 36, metric = c(\"expr_chrM_ratio\"), samples = \"sample_id\", log = FALSE, name = NULL )"},{"path":"https://mictott.github.io/SpotSweeper/reference/localVariance.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"localVariance Function — localVariance","text":"spe SpatialExperiment object following columns colData: sample_id, sum_umi, sum_gene n_neighbors Number nearest neighbors use variance calculation metric metric use variance calculation samples Column colData use sample ID log Whether log1p transform metric name Name new column add colData","code":""},{"path":"https://mictott.github.io/SpotSweeper/reference/localVariance.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"localVariance Function — localVariance","text":"SpatialExperiment object metric variance added colData","code":""},{"path":"https://mictott.github.io/SpotSweeper/reference/localVariance.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"localVariance Function — localVariance","text":"","code":"# for more details see extended example in vignettes library(SpotSweeper) library(SpatialExperiment) library(escheR) # load example data spe <- STexampleData::Visium_humanDLPFC() #> see ?STexampleData and browseVignettes('STexampleData') for documentation #> loading from cache # change from gene id to gene names rownames(spe) <- rowData(spe)$gene_name # show column data before SpotSweepR colnames(colData(spe)) #> [1] \"barcode_id\" \"sample_id\" \"in_tissue\" \"array_row\" \"array_col\" #> [6] \"ground_truth\" \"cell_count\" # drop out-of-tissue spots spe <- spe[, spe$in_tissue == 1] spe <- spe[, !is.na(spe$ground_truth)] # Identifying the mitochondrial transcripts in our SpatialExperiment. is.mito <- rownames(spe)[grepl(\"^MT-\", rownames(spe))] # Calculating QC metric for each spot using scuttle spe <- scuttle::addPerCellQCMetrics(spe, subsets = list(Mito = is.mito)) colnames(colData(spe)) #> [1] \"barcode_id\" \"sample_id\" \"in_tissue\" #> [4] \"array_row\" \"array_col\" \"ground_truth\" #> [7] \"cell_count\" \"sum\" \"detected\" #> [10] \"subsets_Mito_sum\" \"subsets_Mito_detected\" \"subsets_Mito_percent\" #> [13] \"total\" spe <- localVariance(spe, metric = \"subsets_Mito_percent\", n_neighbors = 36, name = \"local_mito_variance_k36\" ) plotQC(spe, metric=\"local_mito_variance_k36\")"},{"path":"https://mictott.github.io/SpotSweeper/reference/plotQC.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot QC metrics for a Single Sample in a SpatialExperiment object — plotQC","title":"Plot QC metrics for a Single Sample in a SpatialExperiment object — plotQC","text":"function generates plot specified sample within SpatialExperiment object, highlighting outliers based specified metric. plot visualizes metric interest indicates outliers distinct color.","code":""},{"path":"https://mictott.github.io/SpotSweeper/reference/plotQC.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot QC metrics for a Single Sample in a SpatialExperiment object — plotQC","text":"","code":"plotQC( spe, sample_id = \"sample_id\", sample = unique(spe$sample_id)[1], metric = \"detected\", outliers = NULL, point_size = 2, colors = c(\"white\", \"black\"), stroke = 1 )"},{"path":"https://mictott.github.io/SpotSweeper/reference/plotQC.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot QC metrics for a Single Sample in a SpatialExperiment object — plotQC","text":"spe SpatialExperiment object containing data plotted. sample_id character string specifying column name colData(spe) contains unique sample identifiers. Default \"sample_id\". sample character string numeric value specifying sample plotted. default, plots first unique sample found spe$sample_id. metric character string specifying metric visualized plot. metric column name colData(spe). outliers character string specifying column name colData(spe) indicates whether data point considered outlier. Default NULL. point_size numeric value specifying size points plot. Default 2. colors character vector specifying colors used gradient scale. length 2, gradient single color gradient. stroke numeric value specifying border thickness outlier points. Default 1.","code":""},{"path":"https://mictott.github.io/SpotSweeper/reference/plotQC.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot QC metrics for a Single Sample in a SpatialExperiment object — plotQC","text":"function returns plot object created make_escheR modified additional layers visualizing specified metric outliers. plot explicitly printed function printed caller.","code":""},{"path":"https://mictott.github.io/SpotSweeper/reference/plotQC.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Plot QC metrics for a Single Sample in a SpatialExperiment object — plotQC","text":"","code":"library(SpotSweeper) library(SpatialExperiment) library(escheR) # load example data spe <- STexampleData::Visium_humanDLPFC() #> see ?STexampleData and browseVignettes('STexampleData') for documentation #> loading from cache # change from gene id to gene names rownames(spe) <- rowData(spe)$gene_name # drop out-of-tissue spots spe <- spe[, spe$in_tissue == 1] spe <- spe[, !is.na(spe$ground_truth)] # Identifying the mitochondrial transcripts in our SpatialExperiment. is.mito <- rownames(spe)[grepl(\"^MT-\", rownames(spe))] # Calculating QC metrics for each spot using scuttle spe <- scuttle::addPerCellQCMetrics(spe, subsets = list(Mito = is.mito)) colnames(colData(spe)) #> [1] \"barcode_id\" \"sample_id\" \"in_tissue\" #> [4] \"array_row\" \"array_col\" \"ground_truth\" #> [7] \"cell_count\" \"sum\" \"detected\" #> [10] \"subsets_Mito_sum\" \"subsets_Mito_detected\" \"subsets_Mito_percent\" #> [13] \"total\" # Identifying local outliers using SpotSweeper spe <- localOutliers(spe, metric = \"sum\", direction = \"lower\", log = TRUE ) plotQC(spe, metric=\"sum\", outliers=\"sum_outliers\")"},{"path":"https://mictott.github.io/SpotSweeper/reference/plotQCpdf.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot Outlier Metrics to PDF — plotQCpdf","title":"Plot Outlier Metrics to PDF — plotQCpdf","text":"function generates PDF file containing plots sample SpatialExperiment object, highlighting outliers based specified metrics. plot visualizes outlier metrics single sample, allowing easy comparison analysis across samples.","code":""},{"path":"https://mictott.github.io/SpotSweeper/reference/plotQCpdf.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot Outlier Metrics to PDF — plotQCpdf","text":"","code":"plotQCpdf( spe, sample_id = \"sample_id\", metric = \"detected\", outliers = \"local_outliers\", colors = c(\"white\", \"black\"), stroke = 1, point_size = 2, width = 5, height = 5, fname )"},{"path":"https://mictott.github.io/SpotSweeper/reference/plotQCpdf.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot Outlier Metrics to PDF — plotQCpdf","text":"spe SpatialExperiment object containing data plotted. sample_id character string specifying column name colData(spe) contains unique sample identifiers. Default 'sample_id'. metric character string specifying metric visualized plot. metric column name colData(spe). outliers character string specifying column name colData(spe) indicates whether data point considered outlier. Default local_outliers'. colors character vector specifying colors used gradient scale. length 2, gradient single color gradient stroke numeric value specifying border thickness outlier points. Default 1. point_size numeric value specifying size points plot. Default 2. width numeric value indicating width plot. Default 5. height numeric value indicating height plot. Default 5. fname character string specifying path name output PDF file.","code":""},{"path":"https://mictott.github.io/SpotSweeper/reference/plotQCpdf.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot Outlier Metrics to PDF — plotQCpdf","text":"ggplot object specified. Generates plot otherwise.","code":""},{"path":"https://mictott.github.io/SpotSweeper/reference/plotQCpdf.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Plot Outlier Metrics to PDF — plotQCpdf","text":"","code":"library(SpotSweeper) library(SpatialExperiment) library(escheR) # load example data spe <- STexampleData::Visium_humanDLPFC() #> see ?STexampleData and browseVignettes('STexampleData') for documentation #> loading from cache tempFilePath <- file.path(tempdir(), \"examplePlot.pdf\") # change from gene id to gene names rownames(spe) <- rowData(spe)$gene_name # drop out-of-tissue spots spe <- spe[, spe$in_tissue == 1] spe <- spe[, !is.na(spe$ground_truth)] # Identifying the mitochondrial transcripts in our SpatialExperiment. is.mito <- rownames(spe)[grepl(\"^MT-\", rownames(spe))] # Calculating QC metrics for each spot using scuttle spe <- scuttle::addPerCellQCMetrics(spe, subsets = list(Mito = is.mito)) colnames(colData(spe)) #> [1] \"barcode_id\" \"sample_id\" \"in_tissue\" #> [4] \"array_row\" \"array_col\" \"ground_truth\" #> [7] \"cell_count\" \"sum\" \"detected\" #> [10] \"subsets_Mito_sum\" \"subsets_Mito_detected\" \"subsets_Mito_percent\" #> [13] \"total\" # Identifying local outliers using SpotSweeper spe <- localOutliers(spe, metric = \"sum\", direction = \"lower\", log = TRUE ) plotQCpdf(spe, metric=\"sum\", outliers=\"sum_outliers\", fname=tempFilePath) #> agg_png #> 2"},{"path":"https://mictott.github.io/SpotSweeper/news/index.html","id":"spotsweeper-0991","dir":"Changelog","previous_headings":"","what":"SpotSweeper 0.99.1","title":"SpotSweeper 0.99.1","text":"Added NEWS.md file track changes package. First full version package submitted Bioconductor. See Bioconductor submission .","code":""}] +[{"path":"https://mictott.github.io/SpotSweeper/CONTRIBUTING.html","id":null,"dir":"","previous_headings":"","what":"Contributing to SpotSweeper","title":"Contributing to SpotSweeper","text":"outlines propose change SpotSweeper. detailed discussion contributing tidyverse packages, please see development contributing guide code review principles.","code":""},{"path":"https://mictott.github.io/SpotSweeper/CONTRIBUTING.html","id":"fixing-typos","dir":"","previous_headings":"","what":"Fixing typos","title":"Contributing to SpotSweeper","text":"can fix typos, spelling mistakes, grammatical errors documentation directly using GitHub web interface, long changes made source file. generally means ’ll need edit roxygen2 comments .R, .Rd file. can find .R file generates .Rd reading comment first line.","code":""},{"path":"https://mictott.github.io/SpotSweeper/CONTRIBUTING.html","id":"bigger-changes","dir":"","previous_headings":"","what":"Bigger changes","title":"Contributing to SpotSweeper","text":"want make bigger change, ’s good idea first file issue make sure someone team agrees ’s needed. ’ve found bug, please file issue illustrates bug minimal reprex (also help write unit test, needed). See guide create great issue advice.","code":""},{"path":"https://mictott.github.io/SpotSweeper/CONTRIBUTING.html","id":"pull-request-process","dir":"","previous_headings":"Bigger changes","what":"Pull request process","title":"Contributing to SpotSweeper","text":"Fork package clone onto computer. haven’t done , recommend using usethis::create_from_github(\"MicTott/SpotSweeper\", fork = TRUE). Install development dependencies devtools::install_dev_deps(), make sure package passes R CMD check running devtools::check(). R CMD check doesn’t pass cleanly, ’s good idea ask help continuing. Create Git branch pull request (PR). recommend using usethis::pr_init(\"brief-description--change\"). Make changes, commit git, create PR running usethis::pr_push(), following prompts browser. title PR briefly describe change. body PR contain Fixes #issue-number. user-facing changes, add bullet top NEWS.md (.e. just first header). Follow style described https://style.tidyverse.org/news.html.","code":""},{"path":"https://mictott.github.io/SpotSweeper/CONTRIBUTING.html","id":"code-style","dir":"","previous_headings":"Bigger changes","what":"Code style","title":"Contributing to SpotSweeper","text":"New code follow tidyverse style guide. can use styler package apply styles, please don’t restyle code nothing PR. use roxygen2, Markdown syntax, documentation. use testthat unit tests. Contributions test cases included easier accept.","code":""},{"path":"https://mictott.github.io/SpotSweeper/CONTRIBUTING.html","id":"code-of-conduct","dir":"","previous_headings":"","what":"Code of Conduct","title":"Contributing to SpotSweeper","text":"Please note SpotSweeper project released Contributor Code Conduct. contributing project agree abide terms.","code":""},{"path":"https://mictott.github.io/SpotSweeper/LICENSE.html","id":null,"dir":"","previous_headings":"","what":"MIT License","title":"MIT License","text":"Copyright (c) 2024 SpotSweeper authors Permission hereby granted, free charge, person obtaining copy software associated documentation files (“Software”), deal Software without restriction, including without limitation rights use, copy, modify, merge, publish, distribute, sublicense, /sell copies Software, permit persons Software furnished , subject following conditions: copyright notice permission notice shall included copies substantial portions Software. SOFTWARE PROVIDED “”, WITHOUT WARRANTY KIND, EXPRESS IMPLIED, INCLUDING LIMITED WARRANTIES MERCHANTABILITY, FITNESS PARTICULAR PURPOSE NONINFRINGEMENT. EVENT SHALL AUTHORS COPYRIGHT HOLDERS LIABLE CLAIM, DAMAGES LIABILITY, WHETHER ACTION CONTRACT, TORT OTHERWISE, ARISING , CONNECTION SOFTWARE USE DEALINGS SOFTWARE.","code":""},{"path":"https://mictott.github.io/SpotSweeper/SUPPORT.html","id":null,"dir":"","previous_headings":"","what":"Getting help with SpotSweeper","title":"Getting help with SpotSweeper","text":"Thank using SpotSweeper! filing issue, things know make process smooth possible parties.","code":""},{"path":"https://mictott.github.io/SpotSweeper/SUPPORT.html","id":"make-a-reprex","dir":"","previous_headings":"","what":"Make a reprex","title":"Getting help with SpotSweeper","text":"Start making minimally reproducible example, also known ‘reprex’. may use reprex R package create one, though necessary help. make R-question-asking endeavors easier. Learning use takes 5 10 minutes. tips make minimally reproducible example, see StackOverflow link.","code":""},{"path":"https://mictott.github.io/SpotSweeper/SUPPORT.html","id":"where-to-post-it","dir":"","previous_headings":"","what":"Where to post it?","title":"Getting help with SpotSweeper","text":"Bioconductor help web page gives overview places may help answer question. Bioconductor software related questions, bug reports feature requests, addressed appropriate Bioconductor/SpotSweeper GitHub repository. Follow bug report feature request templates GitHub. package GitHub repository, see next bullet point. Bioconductor software usage questions addressed Bioconductor Support Website. Make sure use appropriate package tag, otherwise package authors get notification. General R questions can posed StackOverflow RStudio Community website especially pertain tidyverse RStudio GUI related products.","code":""},{"path":"https://mictott.github.io/SpotSweeper/SUPPORT.html","id":"issues-or-feature-requests","dir":"","previous_headings":"","what":"Issues or Feature Requests","title":"Getting help with SpotSweeper","text":"opening new issue feature request, sure search issues pull requests ensure one already exist implemented development version. Note. can remove :open search term issues page search open closed issues. See link learn modifying search.","code":""},{"path":"https://mictott.github.io/SpotSweeper/SUPPORT.html","id":"what-happens-next","dir":"","previous_headings":"","what":"What happens next?","title":"Getting help with SpotSweeper","text":"Bioconductor maintainers limited resources strive responsive possible. Please forget tag appropriate maintainer issue GitHub username (e.g., @username). order make easy possible Bioconductor core developers remediate issue. Provide accurate, brief, reproducible report outlined issue templates. Thank trusting Bioconductor.","code":""},{"path":"https://mictott.github.io/SpotSweeper/articles/getting_started.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"Getting started with 'SpotSweeper'","text":"SpotSweeper R package spatial transcriptomics data quality control (QC). provides functions detecting visualizing spot-level local outliers artifacts using spatially-aware methods. package designed work SpatialExperiment objects, compatible data 10X Genomics Visium spatial transcriptomics platforms.","code":""},{"path":"https://mictott.github.io/SpotSweeper/articles/getting_started.html","id":"installation","dir":"Articles","previous_headings":"","what":"Installation","title":"Getting started with 'SpotSweeper'","text":"Currently, way install SpotSweeper downloading development version can installed GitHub using following: accepted Bioconductor, SpotSweeper installable using:","code":"if (!require(\"devtools\")) install.packages(\"devtools\") remotes::install_github(\"MicTott/SpotSweeper\") if (!requireNamespace(\"BiocManager\", quietly = TRUE)) { install.packages(\"BiocManager\") } BiocManager::install(\"SpotSweeper\")"},{"path":[]},{"path":"https://mictott.github.io/SpotSweeper/articles/getting_started.html","id":"loading-example-data","dir":"Articles","previous_headings":"Spot-level local outlier detection","what":"Loading example data","title":"Getting started with 'SpotSweeper'","text":"’ll walk standard workflow using ‘SpotSweeper’ detect visualize local outliers spatial transcriptomics data. ’ll use Visium_humanDLPFC dataset STexampleData package, SpatialExperiment object. local outliers saved colData SpatialExperiment object, ’ll first view colData drop --tissue spots calculating quality control (QC) metrics running SpotSweeper.","code":"library(SpotSweeper) # load Maynard et al DLPFC daatset spe <- STexampleData::Visium_humanDLPFC() ## see ?STexampleData and browseVignettes('STexampleData') for documentation ## loading from cache # show column data before SpotSweeper colnames(colData(spe)) ## [1] \"barcode_id\" \"sample_id\" \"in_tissue\" \"array_row\" \"array_col\" ## [6] \"ground_truth\" \"cell_count\" # drop out-of-tissue spots spe <- spe[, spe$in_tissue == 1]"},{"path":"https://mictott.github.io/SpotSweeper/articles/getting_started.html","id":"calculating-qc-metrics-using-scuttle","dir":"Articles","previous_headings":"Spot-level local outlier detection","what":"Calculating QC metrics using scuttle","title":"Getting started with 'SpotSweeper'","text":"’ll use scuttle package calculate QC metrics. , ’ll need first change rownames gene id gene names. ’ll get mitochondrial transcripts calculate QC metrics spot using scuttle::addPerCellQCMetrics.","code":"# change from gene id to gene names rownames(spe) <- rowData(spe)$gene_name # identifying the mitochondrial transcripts is.mito <- rownames(spe)[grepl(\"^MT-\", rownames(spe))] # calculating QC metrics for each spot using scuttle spe <- scuttle::addPerCellQCMetrics(spe, subsets = list(Mito = is.mito)) colnames(colData(spe)) ## [1] \"barcode_id\" \"sample_id\" \"in_tissue\" ## [4] \"array_row\" \"array_col\" \"ground_truth\" ## [7] \"cell_count\" \"sum\" \"detected\" ## [10] \"subsets_Mito_sum\" \"subsets_Mito_detected\" \"subsets_Mito_percent\" ## [13] \"total\""},{"path":"https://mictott.github.io/SpotSweeper/articles/getting_started.html","id":"identifying-local-outliers-using-spotsweeper","dir":"Articles","previous_headings":"Spot-level local outlier detection","what":"Identifying local outliers using SpotSweeper","title":"Getting started with 'SpotSweeper'","text":"can now use SpotSweeper identify local outliers spatial transcriptomics data. ’ll use localOutliers function detect local outliers based unique detected genes, total library size, percent total reads mitochondrial. methods assume normal distribution, ’ll use log-transformed sum counts log-transformed number detected genes. mitochondrial percent, ’ll use raw mitochondrial percentage. localOutlier function automatically outputs results colData naming convention X_outliers, X name input colData. can combine outliers single column called local_outliers colData SpatialExperiment object.","code":"# library size spe <- localOutliers(spe, metric = \"sum\", direction = \"lower\", log = TRUE ) # unique genes spe <- localOutliers(spe, metric = \"detected\", direction = \"lower\", log = TRUE ) # mitochondrial percent spe <- localOutliers(spe, metric = \"subsets_Mito_percent\", direction = \"higher\", log = FALSE ) # combine all outliers into \"local_outliers\" column spe$local_outliers <- as.logical(spe$sum_outliers) | as.logical(spe$detected_outliers) | as.logical(spe$subsets_Mito_percent_outliers)"},{"path":"https://mictott.github.io/SpotSweeper/articles/getting_started.html","id":"visualizing-local-outliers","dir":"Articles","previous_headings":"Spot-level local outlier detection","what":"Visualizing local outliers","title":"Getting started with 'SpotSweeper'","text":"can visualize local outliers using plotQC function. function creates scatter plot specified metric highlights local outliers red using escheR package. , ’ll visualize local outliers library size, unique genes, mitochondrial percent, finally, local outliers. ’ll arrange plots grid using ggpubr::arrange.","code":"library(escheR) ## Loading required package: ggplot2 library(ggpubr) # library size p1 <- plotQC(spe, metric = \"sum_log\", outliers = \"sum_outliers\", point_size = 1.1 ) + ggtitle(\"Library Size\") # unique genes p2 <- plotQC(spe, metric = \"detected_log\", outliers = \"detected_outliers\", point_size = 1.1 ) + ggtitle(\"Unique Genes\") # mitochondrial percent p3 <- plotQC(spe, metric = \"subsets_Mito_percent\", outliers = \"subsets_Mito_percent_outliers\", point_size = 1.1 ) + ggtitle(\"Mitochondrial Percent\") # all local outliers p4 <- plotQC(spe, metric = \"sum_log\", outliers = \"local_outliers\", point_size = 1.1, stroke = 0.75 ) + ggtitle(\"All Local Outliers\") # plot plot_list <- list(p1, p2, p3, p4) ggarrange( plotlist = plot_list, ncol = 2, nrow = 2, common.legend = FALSE )"},{"path":[]},{"path":"https://mictott.github.io/SpotSweeper/articles/getting_started.html","id":"loading-example-data-1","dir":"Articles","previous_headings":"Removing technical artifacts using SpotSweeper","what":"Loading example data","title":"Getting started with 'SpotSweeper'","text":"","code":"# load in DLPFC sample with hangnail artifact data(DLPFC_artifact) spe <- DLPFC_artifact # inspect colData before artifact detection colnames(colData(spe)) ## [1] \"sample_id\" \"in_tissue\" \"array_row\" ## [4] \"array_col\" \"key\" \"sum_umi\" ## [7] \"sum_gene\" \"expr_chrM\" \"expr_chrM_ratio\" ## [10] \"ManualAnnotation\" \"subject\" \"region\" ## [13] \"sex\" \"age\" \"diagnosis\" ## [16] \"sample_id_complete\" \"count\" \"sizeFactor\""},{"path":"https://mictott.github.io/SpotSweeper/articles/getting_started.html","id":"visualizing-technical-artifacts","dir":"Articles","previous_headings":"Removing technical artifacts using SpotSweeper","what":"Visualizing technical artifacts","title":"Getting started with 'SpotSweeper'","text":"Technical artifacts can commonly visualized standard QC metrics, including library size, unique genes, mitochondrial percentage. can first visualize technical artifacts using plotQC function. function plots Visium spots specified QC metric.’ll arrange plots using ggpubr::arrange.","code":"# library size p1 <- plotQC(spe, metric = \"sum_umi\", outliers = NULL, point_size = 1.1 ) + ggtitle(\"Library Size\") # unique genes p2 <- plotQC(spe, metric = \"sum_gene\", outliers = NULL, point_size = 1.1 ) + ggtitle(\"Unique Genes\") # mitochondrial percent p3 <- plotQC(spe, metric = \"expr_chrM_ratio\", outliers = NULL, point_size = 1.1 ) + ggtitle(\"Mitochondrial Percent\") # plot plot_list <- list(p1, p2, p3) ggarrange( plotlist = plot_list, ncol = 3, nrow = 1, common.legend = FALSE )"},{"path":"https://mictott.github.io/SpotSweeper/articles/getting_started.html","id":"identifying-artifacts-using-spotsweeper","dir":"Articles","previous_headings":"Removing technical artifacts using SpotSweeper","what":"Identifying artifacts using SpotSweeper","title":"Getting started with 'SpotSweeper'","text":"can use findArtifacts function identify artifacts spatial transcriptomics (data. function identifies technical artifacts based first principle component local variance specified QC metric (mito_percent) numerous neighorhood sizes (n_rings=5). Currently, kmeans clustering used cluster technical artifact vs high-quality Visium spots. Similar localOutliers, findArtifacts function outputs results colData.","code":"# find artifacts using SpotSweeper spe <- findArtifacts(spe, mito_percent = \"expr_chrM_ratio\", mito_sum = \"expr_chrM\", n_rings = 5, name = \"artifact\" ) # check that \"artifact\" is now in colData colnames(colData(spe)) ## [1] \"sample_id\" \"in_tissue\" \"array_row\" ## [4] \"array_col\" \"key\" \"sum_umi\" ## [7] \"sum_gene\" \"expr_chrM\" \"expr_chrM_ratio\" ## [10] \"ManualAnnotation\" \"subject\" \"region\" ## [13] \"sex\" \"age\" \"diagnosis\" ## [16] \"sample_id_complete\" \"count\" \"sizeFactor\" ## [19] \"expr_chrM_ratio_log\" \"coords\" \"k6\" ## [22] \"k18\" \"k36\" \"k60\" ## [25] \"k90\" \"artifact\""},{"path":"https://mictott.github.io/SpotSweeper/articles/getting_started.html","id":"visualizing-artifacts","dir":"Articles","previous_headings":"Removing technical artifacts using SpotSweeper","what":"Visualizing artifacts","title":"Getting started with 'SpotSweeper'","text":"can visualize artifacts using escheR package. , ’ll visualize artifacts using plotQC function arrange plots using ggpubr::arrange. # Session information","code":"plotQC(spe, metric = \"expr_chrM_ratio\", outliers = \"artifact\", point_size = 1.1 ) + ggtitle(\"Hangnail artifact\") utils::sessionInfo() ## R version 4.3.3 (2024-02-29) ## Platform: x86_64-pc-linux-gnu (64-bit) ## Running under: Ubuntu 22.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.20.so; LAPACK version 3.10.0 ## ## locale: ## [1] LC_CTYPE=C.UTF-8 LC_NUMERIC=C LC_TIME=C.UTF-8 ## [4] LC_COLLATE=C.UTF-8 LC_MONETARY=C.UTF-8 LC_MESSAGES=C.UTF-8 ## [7] LC_PAPER=C.UTF-8 LC_NAME=C LC_ADDRESS=C ## [10] LC_TELEPHONE=C LC_MEASUREMENT=C.UTF-8 LC_IDENTIFICATION=C ## ## time zone: UTC ## tzcode source: system (glibc) ## ## attached base packages: ## [1] stats4 stats graphics grDevices utils datasets methods ## [8] base ## ## other attached packages: ## [1] ggpubr_0.6.0 escheR_1.2.0 ## [3] ggplot2_3.5.0 STexampleData_1.10.1 ## [5] SpatialExperiment_1.12.0 SingleCellExperiment_1.24.0 ## [7] SummarizedExperiment_1.32.0 Biobase_2.62.0 ## [9] GenomicRanges_1.54.1 GenomeInfoDb_1.38.8 ## [11] IRanges_2.36.0 S4Vectors_0.40.2 ## [13] MatrixGenerics_1.14.0 matrixStats_1.3.0 ## [15] ExperimentHub_2.10.0 AnnotationHub_3.10.1 ## [17] BiocFileCache_2.10.2 dbplyr_2.5.0 ## [19] BiocGenerics_0.48.1 SpotSweeper_0.99.5 ## [21] BiocStyle_2.30.0 ## ## loaded via a namespace (and not attached): ## [1] jsonlite_1.8.8 magrittr_2.0.3 ## [3] magick_2.8.3 farver_2.1.1 ## [5] rmarkdown_2.26 fs_1.6.3 ## [7] zlibbioc_1.48.2 ragg_1.3.0 ## [9] vctrs_0.6.5 memoise_2.0.1 ## [11] DelayedMatrixStats_1.24.0 RCurl_1.98-1.14 ## [13] terra_1.7-71 rstatix_0.7.2 ## [15] htmltools_0.5.8.1 S4Arrays_1.2.1 ## [17] curl_5.2.1 BiocNeighbors_1.20.2 ## [19] broom_1.0.5 SparseArray_1.2.4 ## [21] sass_0.4.9 bslib_0.7.0 ## [23] htmlwidgets_1.6.4 desc_1.4.3 ## [25] cachem_1.0.8 mime_0.12 ## [27] lifecycle_1.0.4 pkgconfig_2.0.3 ## [29] Matrix_1.6-5 R6_2.5.1 ## [31] fastmap_1.1.1 GenomeInfoDbData_1.2.11 ## [33] shiny_1.8.1.1 digest_0.6.35 ## [35] colorspace_2.1-0 AnnotationDbi_1.64.1 ## [37] textshaping_0.3.7 RSQLite_2.3.6 ## [39] beachmat_2.18.1 filelock_1.0.3 ## [41] labeling_0.4.3 fansi_1.0.6 ## [43] httr_1.4.7 abind_1.4-5 ## [45] compiler_4.3.3 bit64_4.0.5 ## [47] withr_3.0.0 backports_1.4.1 ## [49] BiocParallel_1.36.0 carData_3.0-5 ## [51] DBI_1.2.2 highr_0.10 ## [53] ggsignif_0.6.4 MASS_7.3-60.0.1 ## [55] rappdirs_0.3.3 DelayedArray_0.28.0 ## [57] rjson_0.2.21 tools_4.3.3 ## [59] interactiveDisplayBase_1.40.0 httpuv_1.6.15 ## [61] glue_1.7.0 promises_1.3.0 ## [63] grid_4.3.3 generics_0.1.3 ## [65] gtable_0.3.4 tidyr_1.3.1 ## [67] car_3.1-2 utf8_1.2.4 ## [69] XVector_0.42.0 BiocVersion_3.18.1 ## [71] pillar_1.9.0 later_1.3.2 ## [73] dplyr_1.1.4 lattice_0.22-5 ## [75] bit_4.0.5 tidyselect_1.2.1 ## [77] Biostrings_2.70.3 scuttle_1.12.0 ## [79] knitr_1.46 bookdown_0.39 ## [81] xfun_0.43 yaml_2.3.8 ## [83] evaluate_0.23 codetools_0.2-19 ## [85] spatialEco_2.0-2 tibble_3.2.1 ## [87] BiocManager_1.30.22 cli_3.6.2 ## [89] xtable_1.8-4 systemfonts_1.0.6 ## [91] munsell_0.5.1 jquerylib_0.1.4 ## [93] Rcpp_1.0.12 png_0.1-8 ## [95] parallel_4.3.3 pkgdown_2.0.9 ## [97] blob_1.2.4 sparseMatrixStats_1.14.0 ## [99] bitops_1.0-7 viridisLite_0.4.2 ## [101] scales_1.3.0 purrr_1.0.2 ## [103] crayon_1.5.2 rlang_1.1.3 ## [105] cowplot_1.1.3 KEGGREST_1.42.0"},{"path":"https://mictott.github.io/SpotSweeper/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Michael Totty. Author, maintainer. Boyi Guo. Author.","code":""},{"path":"https://mictott.github.io/SpotSweeper/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"MicTott (2024). SpotSweeper: Spot artifact-level quality control spatially-resolved transcriptomics data. doi:10.18129/B9.bioc.SpotSweeper, https://github.com/MicTott/SpotSweeper/SpotSweeper - R package version 0.99.5, http://www.bioconductor.org/packages/SpotSweeper. MicTott (2024). “SpotSweeper: Spot artifact-level quality control spatially-resolved transcriptomics data.” bioRxiv. doi:10.1101/TODO, https://www.biorxiv.org/content/10.1101/TODO.","code":"@Manual{, title = {SpotSweeper: Spot and artifact-level quality control for spatially-resolved transcriptomics data}, author = {{MicTott}}, year = {2024}, url = {http://www.bioconductor.org/packages/SpotSweeper}, note = {https://github.com/MicTott/SpotSweeper/SpotSweeper - R package version 0.99.5}, doi = {10.18129/B9.bioc.SpotSweeper}, } @Article{, title = {SpotSweeper: Spot and artifact-level quality control for spatially-resolved transcriptomics data}, author = {{MicTott}}, year = {2024}, journal = {bioRxiv}, doi = {10.1101/TODO}, url = {https://www.biorxiv.org/content/10.1101/TODO}, }"},{"path":"https://mictott.github.io/SpotSweeper/index.html","id":"spotsweeper","dir":"","previous_headings":"","what":"Spatially-aware quality control for spatial transcriptomics","title":"Spatially-aware quality control for spatial transcriptomics","text":"SpotSweeper package developed spatially-aware quality control (QC) methods detection, visualization, removal local outliers large artifacts spot-based spatial transcriptomics data, 10x Genomics Visium, using standard QC metrics. package currently development yet available Bioconductor. package currently experimental stage development. experience issues user package, please open issue GitHub repository. find information, please visit documentation website.","code":""},{"path":"https://mictott.github.io/SpotSweeper/index.html","id":"installation-instructions","dir":"","previous_headings":"","what":"Installation instructions","title":"Spatially-aware quality control for spatial transcriptomics","text":"can install latest version SpotSweeper Bioconductor following code: latest development version can installed GitHub using following:","code":"if (!requireNamespace(\"BiocManager\", quietly = TRUE)) { install.packages(\"BiocManager\") } BiocManager::install(\"SpotSweeper\") if (!require(\"devtools\")) install.packages(\"devtools\") remotes::install_github(\"MicTott/SpotSweeper\")"},{"path":"https://mictott.github.io/SpotSweeper/index.html","id":"input-data-format","dir":"","previous_headings":"","what":"Input data format","title":"Spatially-aware quality control for spatial transcriptomics","text":"examples , assume input data provided SpatialExperiment (SPE) object. outputs spot-level outliers artifacts stored colData SPE object.","code":""},{"path":"https://mictott.github.io/SpotSweeper/index.html","id":"tutorials","dir":"","previous_headings":"","what":"Tutorials","title":"Spatially-aware quality control for spatial transcriptomics","text":"detailed tutorial available package vignette Bioconductor. direct link tutorial / package vignette available .","code":""},{"path":"https://mictott.github.io/SpotSweeper/index.html","id":"development-tools","dir":"","previous_headings":"","what":"Development tools","title":"Spatially-aware quality control for spatial transcriptomics","text":"Continuous code testing possible thanks GitHub actions BiocStyle::Biocpkg('biocthis'). documentation website automatically updated thanks BiocStyle::CRANpkg('pkgdown'). code styled automatically thanks BiocStyle::CRANpkg('styler'). documentation formatted thanks BiocStyle::CRANpkg('devtools') BiocStyle::CRANpkg('roxygen2'). package developed using BiocStyle::Biocpkg('biocthis').","code":""},{"path":"https://mictott.github.io/SpotSweeper/reference/DLPFC_artifact.html","id":null,"dir":"Reference","previous_headings":"","what":"human DLPFC dataset with a technical artifact (hangnail). — DLPFC_artifact","title":"human DLPFC dataset with a technical artifact (hangnail). — DLPFC_artifact","text":"DLPFC_artifact dataset SpatialExperiment object containing single-sample subset human dorsolateral prefrontal cortex (DLPFC) dataset Hukki-Myers et al. 2023. particular sample ('Br2743_ant') included demonstrate identification removal technical artifacts within spatial transcriptomics data. dataset serves example artifact detection using 'SpotSweeper' workflow.","code":""},{"path":"https://mictott.github.io/SpotSweeper/reference/DLPFC_artifact.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"human DLPFC dataset with a technical artifact (hangnail). — DLPFC_artifact","text":"","code":"data(DLPFC_artifact)"},{"path":"https://mictott.github.io/SpotSweeper/reference/DLPFC_artifact.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"human DLPFC dataset with a technical artifact (hangnail). — DLPFC_artifact","text":"SpatialExperiment object.","code":""},{"path":"https://mictott.github.io/SpotSweeper/reference/DLPFC_artifact.html","id":"source","dir":"Reference","previous_headings":"","what":"Source","title":"human DLPFC dataset with a technical artifact (hangnail). — DLPFC_artifact","text":"spatialLIBD","code":""},{"path":"https://mictott.github.io/SpotSweeper/reference/DLPFC_artifact.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"human DLPFC dataset with a technical artifact (hangnail). — DLPFC_artifact","text":"Hukki-Myers et al. (2023) bioRxiv (bioRxiv)","code":""},{"path":"https://mictott.github.io/SpotSweeper/reference/DLPFC_artifact.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"human DLPFC dataset with a technical artifact (hangnail). — DLPFC_artifact","text":"","code":"data(DLPFC_artifact)"},{"path":"https://mictott.github.io/SpotSweeper/reference/findArtifacts.html","id":null,"dir":"Reference","previous_headings":"","what":"Identify and annotate artifacts in spatial transcriptomics data — findArtifacts","title":"Identify and annotate artifacts in spatial transcriptomics data — findArtifacts","text":"function identifies annotates potential artifacts spatial transcriptomics data. Artifacts detected based local mito variance, results added original SpatialExperiment (sce) object.","code":""},{"path":"https://mictott.github.io/SpotSweeper/reference/findArtifacts.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Identify and annotate artifacts in spatial transcriptomics data — findArtifacts","text":"","code":"findArtifacts( spe, mito_percent = \"expr_chrM_ratio\", mito_sum = \"expr_chrM\", samples = \"sample_id\", n_rings = 5, log = TRUE, name = \"artifact\", var_output = TRUE )"},{"path":"https://mictott.github.io/SpotSweeper/reference/findArtifacts.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Identify and annotate artifacts in spatial transcriptomics data — findArtifacts","text":"spe SingleCellExperiment object. mito_percent column name representing mitochondrial percent. Default 'expr_chrM_ratio'. mito_sum column name representing sum mitochondrial expression. Default 'expr_chrM'. samples column name representing sample IDs. Default 'sample_id'. n_rings number rings local mito variance calculation. Default 5. log Logical, indicating whether log1p transform mito_percent. Default TRUE. name Prefix local variance column names. Default 'artifact'. var_output Logical, indicating whether include local variances output. Default TRUE.","code":""},{"path":"https://mictott.github.io/SpotSweeper/reference/findArtifacts.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Identify and annotate artifacts in spatial transcriptomics data — findArtifacts","text":"Returns modified SingleCellExperiment object artifact annotations.","code":""},{"path":[]},{"path":"https://mictott.github.io/SpotSweeper/reference/findArtifacts.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Identify and annotate artifacts in spatial transcriptomics data — findArtifacts","text":"","code":"library(SpotSweeper) library(SpatialExperiment) #> Loading required package: SingleCellExperiment #> Loading required package: SummarizedExperiment #> Loading required package: MatrixGenerics #> Loading required package: matrixStats #> #> Attaching package: ‘MatrixGenerics’ #> The following objects are masked from ‘package:matrixStats’: #> #> colAlls, colAnyNAs, colAnys, colAvgsPerRowSet, colCollapse, #> colCounts, colCummaxs, colCummins, colCumprods, colCumsums, #> colDiffs, colIQRDiffs, colIQRs, colLogSumExps, colMadDiffs, #> colMads, colMaxs, colMeans2, colMedians, colMins, colOrderStats, #> colProds, colQuantiles, colRanges, colRanks, colSdDiffs, colSds, #> colSums2, colTabulates, colVarDiffs, colVars, colWeightedMads, #> colWeightedMeans, colWeightedMedians, colWeightedSds, #> colWeightedVars, rowAlls, rowAnyNAs, rowAnys, rowAvgsPerColSet, #> rowCollapse, rowCounts, rowCummaxs, rowCummins, rowCumprods, #> rowCumsums, rowDiffs, rowIQRDiffs, rowIQRs, rowLogSumExps, #> rowMadDiffs, rowMads, rowMaxs, rowMeans2, rowMedians, rowMins, #> rowOrderStats, rowProds, rowQuantiles, rowRanges, rowRanks, #> rowSdDiffs, rowSds, rowSums2, rowTabulates, rowVarDiffs, rowVars, #> rowWeightedMads, rowWeightedMeans, rowWeightedMedians, #> rowWeightedSds, rowWeightedVars #> Loading required package: GenomicRanges #> Loading required package: stats4 #> Loading required package: BiocGenerics #> #> Attaching package: ‘BiocGenerics’ #> The following objects are masked from ‘package:stats’: #> #> IQR, mad, sd, var, xtabs #> The following objects are masked from ‘package:base’: #> #> Filter, Find, Map, Position, Reduce, anyDuplicated, aperm, append, #> as.data.frame, basename, cbind, colnames, dirname, do.call, #> duplicated, eval, evalq, get, grep, grepl, intersect, is.unsorted, #> lapply, mapply, match, mget, order, paste, pmax, pmax.int, pmin, #> pmin.int, rank, rbind, rownames, sapply, setdiff, sort, table, #> tapply, union, unique, unsplit, which.max, which.min #> Loading required package: S4Vectors #> #> Attaching package: ‘S4Vectors’ #> The following object is masked from ‘package:utils’: #> #> findMatches #> The following objects are masked from ‘package:base’: #> #> I, expand.grid, unname #> Loading required package: IRanges #> Loading required package: GenomeInfoDb #> Loading required package: Biobase #> Welcome to Bioconductor #> #> Vignettes contain introductory material; view with #> 'browseVignettes()'. To cite Bioconductor, see #> 'citation(\"Biobase\")', and for packages 'citation(\"pkgname\")'. #> #> Attaching package: ‘Biobase’ #> The following object is masked from ‘package:MatrixGenerics’: #> #> rowMedians #> The following objects are masked from ‘package:matrixStats’: #> #> anyMissing, rowMedians library(escheR) #> Loading required package: ggplot2 data(DLPFC_artifact) spe <- DLPFC_artifact # find artifacts spe <- findArtifacts(spe, mito_percent = \"expr_chrM_ratio\", mito_sum = \"expr_chrM\", n_rings = 2, # 5 recommended, using 1 for time name = \"artifact\" )"},{"path":"https://mictott.github.io/SpotSweeper/reference/localOutliers.html","id":null,"dir":"Reference","previous_headings":"","what":"localOutliers Function — localOutliers","title":"localOutliers Function — localOutliers","text":"function detects local outliers spatial transcriptomics data based standard quality control metrics, library size, unique genes, mitochondrial ratio. Local outliers defined spots low/high quality metrics compared surrounding neighbors, based modified z-score statistic.","code":""},{"path":"https://mictott.github.io/SpotSweeper/reference/localOutliers.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"localOutliers Function — localOutliers","text":"","code":"localOutliers( spe, metric = \"detected\", direction = \"lower\", n_neighbors = 36, samples = \"sample_id\", log = TRUE, cutoff = 3 )"},{"path":"https://mictott.github.io/SpotSweeper/reference/localOutliers.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"localOutliers Function — localOutliers","text":"spe SpatialExperiment object metric colData QC metric use outlier detection direction Direction outlier detection (higher, lower, ) n_neighbors Number nearest neighbors use outlier detection samples Column name colData use sample IDs log Logical indicating whether log1p transform features (default TRUE) cutoff Cutoff outlier detection (default 3)","code":""},{"path":"https://mictott.github.io/SpotSweeper/reference/localOutliers.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"localOutliers Function — localOutliers","text":"SpatialExperiment object updated colData containing outputs","code":""},{"path":"https://mictott.github.io/SpotSweeper/reference/localOutliers.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"localOutliers Function — localOutliers","text":"","code":"library(SpotSweeper) library(SpatialExperiment) # load example data spe <- STexampleData::Visium_humanDLPFC() #> see ?STexampleData and browseVignettes('STexampleData') for documentation #> downloading 1 resources #> retrieving 1 resource #> loading from cache # change from gene id to gene names rownames(spe) <- rowData(spe)$gene_name # drop out-of-tissue spots spe <- spe[, spe$in_tissue == 1] spe <- spe[, !is.na(spe$ground_truth)] # Identifying the mitochondrial transcripts in our SpatialExperiment. is.mito <- rownames(spe)[grepl(\"^MT-\", rownames(spe))] # Calculating QC metrics for each spot using scuttle spe <- scuttle::addPerCellQCMetrics(spe, subsets = list(Mito = is.mito)) colnames(colData(spe)) #> [1] \"barcode_id\" \"sample_id\" \"in_tissue\" #> [4] \"array_row\" \"array_col\" \"ground_truth\" #> [7] \"cell_count\" \"sum\" \"detected\" #> [10] \"subsets_Mito_sum\" \"subsets_Mito_detected\" \"subsets_Mito_percent\" #> [13] \"total\" # Identifying local outliers using SpotSweeper spe <- localOutliers(spe, metric = \"sum\", direction = \"lower\", log = TRUE )"},{"path":"https://mictott.github.io/SpotSweeper/reference/localVariance.html","id":null,"dir":"Reference","previous_headings":"","what":"localVariance Function — localVariance","title":"localVariance Function — localVariance","text":"function calculates local variance based kNN.","code":""},{"path":"https://mictott.github.io/SpotSweeper/reference/localVariance.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"localVariance Function — localVariance","text":"","code":"localVariance( spe, n_neighbors = 36, metric = c(\"expr_chrM_ratio\"), samples = \"sample_id\", log = FALSE, name = NULL )"},{"path":"https://mictott.github.io/SpotSweeper/reference/localVariance.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"localVariance Function — localVariance","text":"spe SpatialExperiment object following columns colData: sample_id, sum_umi, sum_gene n_neighbors Number nearest neighbors use variance calculation metric metric use variance calculation samples Column colData use sample ID log Whether log1p transform metric name Name new column add colData","code":""},{"path":"https://mictott.github.io/SpotSweeper/reference/localVariance.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"localVariance Function — localVariance","text":"SpatialExperiment object metric variance added colData","code":""},{"path":"https://mictott.github.io/SpotSweeper/reference/localVariance.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"localVariance Function — localVariance","text":"","code":"# for more details see extended example in vignettes library(SpotSweeper) library(SpatialExperiment) library(escheR) # load example data spe <- STexampleData::Visium_humanDLPFC() #> see ?STexampleData and browseVignettes('STexampleData') for documentation #> loading from cache # change from gene id to gene names rownames(spe) <- rowData(spe)$gene_name # show column data before SpotSweepR colnames(colData(spe)) #> [1] \"barcode_id\" \"sample_id\" \"in_tissue\" \"array_row\" \"array_col\" #> [6] \"ground_truth\" \"cell_count\" # drop out-of-tissue spots spe <- spe[, spe$in_tissue == 1] spe <- spe[, !is.na(spe$ground_truth)] # Identifying the mitochondrial transcripts in our SpatialExperiment. is.mito <- rownames(spe)[grepl(\"^MT-\", rownames(spe))] # Calculating QC metric for each spot using scuttle spe <- scuttle::addPerCellQCMetrics(spe, subsets = list(Mito = is.mito)) colnames(colData(spe)) #> [1] \"barcode_id\" \"sample_id\" \"in_tissue\" #> [4] \"array_row\" \"array_col\" \"ground_truth\" #> [7] \"cell_count\" \"sum\" \"detected\" #> [10] \"subsets_Mito_sum\" \"subsets_Mito_detected\" \"subsets_Mito_percent\" #> [13] \"total\" spe <- localVariance(spe, metric = \"subsets_Mito_percent\", n_neighbors = 36, name = \"local_mito_variance_k36\" ) plotQC(spe, metric=\"local_mito_variance_k36\")"},{"path":"https://mictott.github.io/SpotSweeper/reference/plotQC.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot QC metrics for a Single Sample in a SpatialExperiment object — plotQC","title":"Plot QC metrics for a Single Sample in a SpatialExperiment object — plotQC","text":"function generates plot specified sample within SpatialExperiment object, highlighting outliers based specified metric. plot visualizes metric interest indicates outliers distinct color.","code":""},{"path":"https://mictott.github.io/SpotSweeper/reference/plotQC.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot QC metrics for a Single Sample in a SpatialExperiment object — plotQC","text":"","code":"plotQC( spe, sample_id = \"sample_id\", sample = unique(spe$sample_id)[1], metric = \"detected\", outliers = NULL, point_size = 2, colors = c(\"white\", \"black\"), stroke = 1 )"},{"path":"https://mictott.github.io/SpotSweeper/reference/plotQC.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot QC metrics for a Single Sample in a SpatialExperiment object — plotQC","text":"spe SpatialExperiment object containing data plotted. sample_id character string specifying column name colData(spe) contains unique sample identifiers. Default \"sample_id\". sample character string numeric value specifying sample plotted. default, plots first unique sample found spe$sample_id. metric character string specifying metric visualized plot. metric column name colData(spe). outliers character string specifying column name colData(spe) indicates whether data point considered outlier. Default NULL. point_size numeric value specifying size points plot. Default 2. colors character vector specifying colors used gradient scale. length 2, gradient single color gradient. stroke numeric value specifying border thickness outlier points. Default 1.","code":""},{"path":"https://mictott.github.io/SpotSweeper/reference/plotQC.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot QC metrics for a Single Sample in a SpatialExperiment object — plotQC","text":"function returns plot object created make_escheR modified additional layers visualizing specified metric outliers. plot explicitly printed function printed caller.","code":""},{"path":"https://mictott.github.io/SpotSweeper/reference/plotQC.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Plot QC metrics for a Single Sample in a SpatialExperiment object — plotQC","text":"","code":"library(SpotSweeper) library(SpatialExperiment) library(escheR) # load example data spe <- STexampleData::Visium_humanDLPFC() #> see ?STexampleData and browseVignettes('STexampleData') for documentation #> loading from cache # change from gene id to gene names rownames(spe) <- rowData(spe)$gene_name # drop out-of-tissue spots spe <- spe[, spe$in_tissue == 1] spe <- spe[, !is.na(spe$ground_truth)] # Identifying the mitochondrial transcripts in our SpatialExperiment. is.mito <- rownames(spe)[grepl(\"^MT-\", rownames(spe))] # Calculating QC metrics for each spot using scuttle spe <- scuttle::addPerCellQCMetrics(spe, subsets = list(Mito = is.mito)) colnames(colData(spe)) #> [1] \"barcode_id\" \"sample_id\" \"in_tissue\" #> [4] \"array_row\" \"array_col\" \"ground_truth\" #> [7] \"cell_count\" \"sum\" \"detected\" #> [10] \"subsets_Mito_sum\" \"subsets_Mito_detected\" \"subsets_Mito_percent\" #> [13] \"total\" # Identifying local outliers using SpotSweeper spe <- localOutliers(spe, metric = \"sum\", direction = \"lower\", log = TRUE ) plotQC(spe, metric=\"sum\", outliers=\"sum_outliers\")"},{"path":"https://mictott.github.io/SpotSweeper/reference/plotQCpdf.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot Outlier Metrics to PDF — plotQCpdf","title":"Plot Outlier Metrics to PDF — plotQCpdf","text":"function generates PDF file containing plots sample SpatialExperiment object, highlighting outliers based specified metrics. plot visualizes outlier metrics single sample, allowing easy comparison analysis across samples.","code":""},{"path":"https://mictott.github.io/SpotSweeper/reference/plotQCpdf.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot Outlier Metrics to PDF — plotQCpdf","text":"","code":"plotQCpdf( spe, sample_id = \"sample_id\", metric = \"detected\", outliers = \"local_outliers\", colors = c(\"white\", \"black\"), stroke = 1, point_size = 2, width = 5, height = 5, fname )"},{"path":"https://mictott.github.io/SpotSweeper/reference/plotQCpdf.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot Outlier Metrics to PDF — plotQCpdf","text":"spe SpatialExperiment object containing data plotted. sample_id character string specifying column name colData(spe) contains unique sample identifiers. Default 'sample_id'. metric character string specifying metric visualized plot. metric column name colData(spe). outliers character string specifying column name colData(spe) indicates whether data point considered outlier. Default local_outliers'. colors character vector specifying colors used gradient scale. length 2, gradient single color gradient stroke numeric value specifying border thickness outlier points. Default 1. point_size numeric value specifying size points plot. Default 2. width numeric value indicating width plot. Default 5. height numeric value indicating height plot. Default 5. fname character string specifying path name output PDF file.","code":""},{"path":"https://mictott.github.io/SpotSweeper/reference/plotQCpdf.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot Outlier Metrics to PDF — plotQCpdf","text":"ggplot object specified. Generates plot otherwise.","code":""},{"path":"https://mictott.github.io/SpotSweeper/reference/plotQCpdf.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Plot Outlier Metrics to PDF — plotQCpdf","text":"","code":"library(SpotSweeper) library(SpatialExperiment) library(escheR) # load example data spe <- STexampleData::Visium_humanDLPFC() #> see ?STexampleData and browseVignettes('STexampleData') for documentation #> loading from cache tempFilePath <- file.path(tempdir(), \"examplePlot.pdf\") # change from gene id to gene names rownames(spe) <- rowData(spe)$gene_name # drop out-of-tissue spots spe <- spe[, spe$in_tissue == 1] spe <- spe[, !is.na(spe$ground_truth)] # Identifying the mitochondrial transcripts in our SpatialExperiment. is.mito <- rownames(spe)[grepl(\"^MT-\", rownames(spe))] # Calculating QC metrics for each spot using scuttle spe <- scuttle::addPerCellQCMetrics(spe, subsets = list(Mito = is.mito)) colnames(colData(spe)) #> [1] \"barcode_id\" \"sample_id\" \"in_tissue\" #> [4] \"array_row\" \"array_col\" \"ground_truth\" #> [7] \"cell_count\" \"sum\" \"detected\" #> [10] \"subsets_Mito_sum\" \"subsets_Mito_detected\" \"subsets_Mito_percent\" #> [13] \"total\" # Identifying local outliers using SpotSweeper spe <- localOutliers(spe, metric = \"sum\", direction = \"lower\", log = TRUE ) plotQCpdf(spe, metric=\"sum\", outliers=\"sum_outliers\", fname=tempFilePath) #> agg_png #> 2"},{"path":"https://mictott.github.io/SpotSweeper/news/index.html","id":"spotsweeper-0991","dir":"Changelog","previous_headings":"","what":"SpotSweeper 0.99.1","title":"SpotSweeper 0.99.1","text":"Added NEWS.md file track changes package. First full version package submitted Bioconductor. See Bioconductor submission .","code":""}]
MicTott (2024). SpotSweeper: Spot and artifact-level quality control for spatially-resolved transcriptomics data. -doi:10.18129/B9.bioc.SpotSweeper, https://github.com/MicTott/SpotSweeper/SpotSweeper - R package version 0.99.4, http://www.bioconductor.org/packages/SpotSweeper. +doi:10.18129/B9.bioc.SpotSweeper, https://github.com/MicTott/SpotSweeper/SpotSweeper - R package version 0.99.5, http://www.bioconductor.org/packages/SpotSweeper.
@Manual{, title = {SpotSweeper: Spot and artifact-level quality control for spatially-resolved transcriptomics data}, author = {{MicTott}}, year = {2024}, url = {http://www.bioconductor.org/packages/SpotSweeper}, - note = {https://github.com/MicTott/SpotSweeper/SpotSweeper - R package version 0.99.4}, + note = {https://github.com/MicTott/SpotSweeper/SpotSweeper - R package version 0.99.5}, doi = {10.18129/B9.bioc.SpotSweeper}, }
MicTott (2024). diff --git a/index.html b/index.html index c3e7436..b6eec24 100644 --- a/index.html +++ b/index.html @@ -26,7 +26,7 @@ SpotSweeper - 0.99.4 + 0.99.5 diff --git a/news/index.html b/news/index.html index 2f4b69a..eab5ba1 100644 --- a/news/index.html +++ b/news/index.html @@ -10,7 +10,7 @@ SpotSweeper - 0.99.4 + 0.99.5 diff --git a/pkgdown.yml b/pkgdown.yml index cad04c5..cb1a90c 100644 --- a/pkgdown.yml +++ b/pkgdown.yml @@ -3,7 +3,7 @@ pkgdown: 2.0.9 pkgdown_sha: ~ articles: getting_started: getting_started.html -last_built: 2024-04-19T17:49Z +last_built: 2024-04-19T19:29Z urls: reference: https://mictott.github.io/SpotSweeper/reference article: https://mictott.github.io/SpotSweeper/articles diff --git a/reference/DLPFC_artifact.html b/reference/DLPFC_artifact.html index cc6b50b..361ab13 100644 --- a/reference/DLPFC_artifact.html +++ b/reference/DLPFC_artifact.html @@ -20,7 +20,7 @@ SpotSweeper - 0.99.4 + 0.99.5 diff --git a/reference/findArtifacts.html b/reference/findArtifacts.html index f46ea84..3cb1536 100644 --- a/reference/findArtifacts.html +++ b/reference/findArtifacts.html @@ -16,7 +16,7 @@ SpotSweeper - 0.99.4 + 0.99.5 diff --git a/reference/index.html b/reference/index.html index 53c5b8e..bd650b6 100644 --- a/reference/index.html +++ b/reference/index.html @@ -10,7 +10,7 @@ SpotSweeper - 0.99.4 + 0.99.5 diff --git a/reference/localOutliers.html b/reference/localOutliers.html index 873cc39..f4de5b2 100644 --- a/reference/localOutliers.html +++ b/reference/localOutliers.html @@ -18,7 +18,7 @@ SpotSweeper - 0.99.4 + 0.99.5 diff --git a/reference/localVariance.html b/reference/localVariance.html index 8904839..a861961 100644 --- a/reference/localVariance.html +++ b/reference/localVariance.html @@ -10,7 +10,7 @@ SpotSweeper - 0.99.4 + 0.99.5 diff --git a/reference/plotQC.html b/reference/plotQC.html index 5ee14f1..68730c9 100644 --- a/reference/plotQC.html +++ b/reference/plotQC.html @@ -16,7 +16,7 @@ SpotSweeper - 0.99.4 + 0.99.5 diff --git a/reference/plotQCpdf.html b/reference/plotQCpdf.html index f888c38..0672f0b 100644 --- a/reference/plotQCpdf.html +++ b/reference/plotQCpdf.html @@ -16,7 +16,7 @@ SpotSweeper - 0.99.4 + 0.99.5 diff --git a/search.json b/search.json index d720f61..0689563 100644 --- a/search.json +++ b/search.json @@ -1 +1 @@ -[{"path":"https://mictott.github.io/SpotSweeper/CONTRIBUTING.html","id":null,"dir":"","previous_headings":"","what":"Contributing to SpotSweeper","title":"Contributing to SpotSweeper","text":"outlines propose change SpotSweeper. detailed discussion contributing tidyverse packages, please see development contributing guide code review principles.","code":""},{"path":"https://mictott.github.io/SpotSweeper/CONTRIBUTING.html","id":"fixing-typos","dir":"","previous_headings":"","what":"Fixing typos","title":"Contributing to SpotSweeper","text":"can fix typos, spelling mistakes, grammatical errors documentation directly using GitHub web interface, long changes made source file. generally means ’ll need edit roxygen2 comments .R, .Rd file. can find .R file generates .Rd reading comment first line.","code":""},{"path":"https://mictott.github.io/SpotSweeper/CONTRIBUTING.html","id":"bigger-changes","dir":"","previous_headings":"","what":"Bigger changes","title":"Contributing to SpotSweeper","text":"want make bigger change, ’s good idea first file issue make sure someone team agrees ’s needed. ’ve found bug, please file issue illustrates bug minimal reprex (also help write unit test, needed). See guide create great issue advice.","code":""},{"path":"https://mictott.github.io/SpotSweeper/CONTRIBUTING.html","id":"pull-request-process","dir":"","previous_headings":"Bigger changes","what":"Pull request process","title":"Contributing to SpotSweeper","text":"Fork package clone onto computer. haven’t done , recommend using usethis::create_from_github(\"MicTott/SpotSweeper\", fork = TRUE). Install development dependencies devtools::install_dev_deps(), make sure package passes R CMD check running devtools::check(). R CMD check doesn’t pass cleanly, ’s good idea ask help continuing. Create Git branch pull request (PR). recommend using usethis::pr_init(\"brief-description--change\"). Make changes, commit git, create PR running usethis::pr_push(), following prompts browser. title PR briefly describe change. body PR contain Fixes #issue-number. user-facing changes, add bullet top NEWS.md (.e. just first header). Follow style described https://style.tidyverse.org/news.html.","code":""},{"path":"https://mictott.github.io/SpotSweeper/CONTRIBUTING.html","id":"code-style","dir":"","previous_headings":"Bigger changes","what":"Code style","title":"Contributing to SpotSweeper","text":"New code follow tidyverse style guide. can use styler package apply styles, please don’t restyle code nothing PR. use roxygen2, Markdown syntax, documentation. use testthat unit tests. Contributions test cases included easier accept.","code":""},{"path":"https://mictott.github.io/SpotSweeper/CONTRIBUTING.html","id":"code-of-conduct","dir":"","previous_headings":"","what":"Code of Conduct","title":"Contributing to SpotSweeper","text":"Please note SpotSweeper project released Contributor Code Conduct. contributing project agree abide terms.","code":""},{"path":"https://mictott.github.io/SpotSweeper/LICENSE.html","id":null,"dir":"","previous_headings":"","what":"MIT License","title":"MIT License","text":"Copyright (c) 2024 SpotSweeper authors Permission hereby granted, free charge, person obtaining copy software associated documentation files (“Software”), deal Software without restriction, including without limitation rights use, copy, modify, merge, publish, distribute, sublicense, /sell copies Software, permit persons Software furnished , subject following conditions: copyright notice permission notice shall included copies substantial portions Software. SOFTWARE PROVIDED “”, WITHOUT WARRANTY KIND, EXPRESS IMPLIED, INCLUDING LIMITED WARRANTIES MERCHANTABILITY, FITNESS PARTICULAR PURPOSE NONINFRINGEMENT. EVENT SHALL AUTHORS COPYRIGHT HOLDERS LIABLE CLAIM, DAMAGES LIABILITY, WHETHER ACTION CONTRACT, TORT OTHERWISE, ARISING , CONNECTION SOFTWARE USE DEALINGS SOFTWARE.","code":""},{"path":"https://mictott.github.io/SpotSweeper/SUPPORT.html","id":null,"dir":"","previous_headings":"","what":"Getting help with SpotSweeper","title":"Getting help with SpotSweeper","text":"Thank using SpotSweeper! filing issue, things know make process smooth possible parties.","code":""},{"path":"https://mictott.github.io/SpotSweeper/SUPPORT.html","id":"make-a-reprex","dir":"","previous_headings":"","what":"Make a reprex","title":"Getting help with SpotSweeper","text":"Start making minimally reproducible example, also known ‘reprex’. may use reprex R package create one, though necessary help. make R-question-asking endeavors easier. Learning use takes 5 10 minutes. tips make minimally reproducible example, see StackOverflow link.","code":""},{"path":"https://mictott.github.io/SpotSweeper/SUPPORT.html","id":"where-to-post-it","dir":"","previous_headings":"","what":"Where to post it?","title":"Getting help with SpotSweeper","text":"Bioconductor help web page gives overview places may help answer question. Bioconductor software related questions, bug reports feature requests, addressed appropriate Bioconductor/SpotSweeper GitHub repository. Follow bug report feature request templates GitHub. package GitHub repository, see next bullet point. Bioconductor software usage questions addressed Bioconductor Support Website. Make sure use appropriate package tag, otherwise package authors get notification. General R questions can posed StackOverflow RStudio Community website especially pertain tidyverse RStudio GUI related products.","code":""},{"path":"https://mictott.github.io/SpotSweeper/SUPPORT.html","id":"issues-or-feature-requests","dir":"","previous_headings":"","what":"Issues or Feature Requests","title":"Getting help with SpotSweeper","text":"opening new issue feature request, sure search issues pull requests ensure one already exist implemented development version. Note. can remove :open search term issues page search open closed issues. See link learn modifying search.","code":""},{"path":"https://mictott.github.io/SpotSweeper/SUPPORT.html","id":"what-happens-next","dir":"","previous_headings":"","what":"What happens next?","title":"Getting help with SpotSweeper","text":"Bioconductor maintainers limited resources strive responsive possible. Please forget tag appropriate maintainer issue GitHub username (e.g., @username). order make easy possible Bioconductor core developers remediate issue. Provide accurate, brief, reproducible report outlined issue templates. Thank trusting Bioconductor.","code":""},{"path":"https://mictott.github.io/SpotSweeper/articles/getting_started.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"Getting started with 'SpotSweeper'","text":"SpotSweeper R package spatial transcriptomics data quality control (QC). provides functions detecting visualizing spot-level local outliers artifacts using spatially-aware methods. package designed work SpatialExperiment objects, compatible data 10X Genomics Visium spatial transcriptomics platforms.","code":""},{"path":"https://mictott.github.io/SpotSweeper/articles/getting_started.html","id":"installation","dir":"Articles","previous_headings":"","what":"Installation","title":"Getting started with 'SpotSweeper'","text":"Currently, way install SpotSweeper downloading development version can installed GitHub using following: accepted Bioconductor, SpotSweeper installable using:","code":"if (!require(\"devtools\")) install.packages(\"devtools\") remotes::install_github(\"MicTott/SpotSweeper\") if (!requireNamespace(\"BiocManager\", quietly = TRUE)) { install.packages(\"BiocManager\") } BiocManager::install(\"SpotSweeper\")"},{"path":[]},{"path":"https://mictott.github.io/SpotSweeper/articles/getting_started.html","id":"loading-example-data","dir":"Articles","previous_headings":"Spot-level local outlier detection","what":"Loading example data","title":"Getting started with 'SpotSweeper'","text":"’ll walk standard workflow using ‘SpotSweeper’ detect visualize local outliers spatial transcriptomics data. ’ll use Visium_humanDLPFC dataset STexampleData package, SpatialExperiment object. local outliers saved colData SpatialExperiment object, ’ll first view colData drop --tissue spots calculating quality control (QC) metrics running SpotSweeper.","code":"library(SpotSweeper) # load Maynard et al DLPFC daatset spe <- STexampleData::Visium_humanDLPFC() ## see ?STexampleData and browseVignettes('STexampleData') for documentation ## loading from cache # show column data before SpotSweeper colnames(colData(spe)) ## [1] \"barcode_id\" \"sample_id\" \"in_tissue\" \"array_row\" \"array_col\" ## [6] \"ground_truth\" \"cell_count\" # drop out-of-tissue spots spe <- spe[, spe$in_tissue == 1]"},{"path":"https://mictott.github.io/SpotSweeper/articles/getting_started.html","id":"calculating-qc-metrics-using-scuttle","dir":"Articles","previous_headings":"Spot-level local outlier detection","what":"Calculating QC metrics using scuttle","title":"Getting started with 'SpotSweeper'","text":"’ll use scuttle package calculate QC metrics. , ’ll need first change rownames gene id gene names. ’ll get mitochondrial transcripts calculate QC metrics spot using scuttle::addPerCellQCMetrics.","code":"# change from gene id to gene names rownames(spe) <- rowData(spe)$gene_name # identifying the mitochondrial transcripts is.mito <- rownames(spe)[grepl(\"^MT-\", rownames(spe))] # calculating QC metrics for each spot using scuttle spe <- scuttle::addPerCellQCMetrics(spe, subsets = list(Mito = is.mito)) colnames(colData(spe)) ## [1] \"barcode_id\" \"sample_id\" \"in_tissue\" ## [4] \"array_row\" \"array_col\" \"ground_truth\" ## [7] \"cell_count\" \"sum\" \"detected\" ## [10] \"subsets_Mito_sum\" \"subsets_Mito_detected\" \"subsets_Mito_percent\" ## [13] \"total\""},{"path":"https://mictott.github.io/SpotSweeper/articles/getting_started.html","id":"identifying-local-outliers-using-spotsweeper","dir":"Articles","previous_headings":"Spot-level local outlier detection","what":"Identifying local outliers using SpotSweeper","title":"Getting started with 'SpotSweeper'","text":"can now use SpotSweeper identify local outliers spatial transcriptomics data. ’ll use localOutliers function detect local outliers based unique detected genes, total library size, percent total reads mitochondrial. methods assume normal distribution, ’ll use log-transformed sum counts log-transformed number detected genes. mitochondrial percent, ’ll use raw mitochondrial percentage. localOutlier function automatically outputs results colData naming convention X_outliers, X name input colData. can combine outliers single column called local_outliers colData SpatialExperiment object.","code":"# library size spe <- localOutliers(spe, metric = \"sum\", direction = \"lower\", log = TRUE ) # unique genes spe <- localOutliers(spe, metric = \"detected\", direction = \"lower\", log = TRUE ) # mitochondrial percent spe <- localOutliers(spe, metric = \"subsets_Mito_percent\", direction = \"higher\", log = FALSE ) # combine all outliers into \"local_outliers\" column spe$local_outliers <- as.logical(spe$sum_outliers) | as.logical(spe$detected_outliers) | as.logical(spe$subsets_Mito_percent_outliers)"},{"path":"https://mictott.github.io/SpotSweeper/articles/getting_started.html","id":"visualizing-local-outliers","dir":"Articles","previous_headings":"Spot-level local outlier detection","what":"Visualizing local outliers","title":"Getting started with 'SpotSweeper'","text":"can visualize local outliers using plotQC function. function creates scatter plot specified metric highlights local outliers red using escheR package. , ’ll visualize local outliers library size, unique genes, mitochondrial percent, finally, local outliers. ’ll arrange plots grid using ggpubr::arrange.","code":"library(escheR) ## Loading required package: ggplot2 library(ggpubr) # library size p1 <- plotQC(spe, metric = \"sum_log\", outliers = \"sum_outliers\", point_size = 1.1 ) + ggtitle(\"Library Size\") # unique genes p2 <- plotQC(spe, metric = \"detected_log\", outliers = \"detected_outliers\", point_size = 1.1 ) + ggtitle(\"Unique Genes\") # mitochondrial percent p3 <- plotQC(spe, metric = \"subsets_Mito_percent\", outliers = \"subsets_Mito_percent_outliers\", point_size = 1.1 ) + ggtitle(\"Mitochondrial Percent\") # all local outliers p4 <- plotQC(spe, metric = \"sum_log\", outliers = \"local_outliers\", point_size = 1.1, stroke = 0.75 ) + ggtitle(\"All Local Outliers\") # plot plot_list <- list(p1, p2, p3, p4) ggarrange( plotlist = plot_list, ncol = 2, nrow = 2, common.legend = FALSE )"},{"path":[]},{"path":"https://mictott.github.io/SpotSweeper/articles/getting_started.html","id":"loading-example-data-1","dir":"Articles","previous_headings":"Removing technical artifacts using SpotSweeper","what":"Loading example data","title":"Getting started with 'SpotSweeper'","text":"","code":"# load in DLPFC sample with hangnail artifact data(DLPFC_artifact) spe <- DLPFC_artifact # inspect colData before artifact detection colnames(colData(spe)) ## [1] \"sample_id\" \"in_tissue\" \"array_row\" ## [4] \"array_col\" \"key\" \"sum_umi\" ## [7] \"sum_gene\" \"expr_chrM\" \"expr_chrM_ratio\" ## [10] \"ManualAnnotation\" \"subject\" \"region\" ## [13] \"sex\" \"age\" \"diagnosis\" ## [16] \"sample_id_complete\" \"count\" \"sizeFactor\""},{"path":"https://mictott.github.io/SpotSweeper/articles/getting_started.html","id":"visualizing-technical-artifacts","dir":"Articles","previous_headings":"Removing technical artifacts using SpotSweeper","what":"Visualizing technical artifacts","title":"Getting started with 'SpotSweeper'","text":"Technical artifacts can commonly visualized standard QC metrics, including library size, unique genes, mitochondrial percentage. can first visualize technical artifacts using plotQC function. function plots Visium spots specified QC metric.’ll arrange plots using ggpubr::arrange.","code":"# library size p1 <- plotQC(spe, metric = \"sum_umi\", outliers = NULL, point_size = 1.1 ) + ggtitle(\"Library Size\") # unique genes p2 <- plotQC(spe, metric = \"sum_gene\", outliers = NULL, point_size = 1.1 ) + ggtitle(\"Unique Genes\") # mitochondrial percent p3 <- plotQC(spe, metric = \"expr_chrM_ratio\", outliers = NULL, point_size = 1.1 ) + ggtitle(\"Mitochondrial Percent\") # plot plot_list <- list(p1, p2, p3) ggarrange( plotlist = plot_list, ncol = 3, nrow = 1, common.legend = FALSE )"},{"path":"https://mictott.github.io/SpotSweeper/articles/getting_started.html","id":"identifying-artifacts-using-spotsweeper","dir":"Articles","previous_headings":"Removing technical artifacts using SpotSweeper","what":"Identifying artifacts using SpotSweeper","title":"Getting started with 'SpotSweeper'","text":"can use findArtifacts function identify artifacts spatial transcriptomics (data. function identifies technical artifacts based first principle component local variance specified QC metric (mito_percent) numerous neighorhood sizes (n_rings=5). Currently, kmeans clustering used cluster technical artifact vs high-quality Visium spots. Similar localOutliers, findArtifacts function outputs results colData.","code":"# find artifacts using SpotSweeper spe <- findArtifacts(spe, mito_percent = \"expr_chrM_ratio\", mito_sum = \"expr_chrM\", n_rings = 5, name = \"artifact\" ) # check that \"artifact\" is now in colData colnames(colData(spe)) ## [1] \"sample_id\" \"in_tissue\" \"array_row\" ## [4] \"array_col\" \"key\" \"sum_umi\" ## [7] \"sum_gene\" \"expr_chrM\" \"expr_chrM_ratio\" ## [10] \"ManualAnnotation\" \"subject\" \"region\" ## [13] \"sex\" \"age\" \"diagnosis\" ## [16] \"sample_id_complete\" \"count\" \"sizeFactor\" ## [19] \"expr_chrM_ratio_log\" \"coords\" \"k6\" ## [22] \"k18\" \"k36\" \"k60\" ## [25] \"k90\" \"artifact\""},{"path":"https://mictott.github.io/SpotSweeper/articles/getting_started.html","id":"visualizing-artifacts","dir":"Articles","previous_headings":"Removing technical artifacts using SpotSweeper","what":"Visualizing artifacts","title":"Getting started with 'SpotSweeper'","text":"can visualize artifacts using escheR package. , ’ll visualize artifacts using plotQC function arrange plots using ggpubr::arrange. # Session information","code":"plotQC(spe, metric = \"expr_chrM_ratio\", outliers = \"artifact\", point_size = 1.1 ) + ggtitle(\"Hangnail artifact\") utils::sessionInfo() ## R version 4.3.3 (2024-02-29) ## Platform: x86_64-pc-linux-gnu (64-bit) ## Running under: Ubuntu 22.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.20.so; LAPACK version 3.10.0 ## ## locale: ## [1] LC_CTYPE=C.UTF-8 LC_NUMERIC=C LC_TIME=C.UTF-8 ## [4] LC_COLLATE=C.UTF-8 LC_MONETARY=C.UTF-8 LC_MESSAGES=C.UTF-8 ## [7] LC_PAPER=C.UTF-8 LC_NAME=C LC_ADDRESS=C ## [10] LC_TELEPHONE=C LC_MEASUREMENT=C.UTF-8 LC_IDENTIFICATION=C ## ## time zone: UTC ## tzcode source: system (glibc) ## ## attached base packages: ## [1] stats4 stats graphics grDevices utils datasets methods ## [8] base ## ## other attached packages: ## [1] ggpubr_0.6.0 escheR_1.2.0 ## [3] ggplot2_3.5.0 STexampleData_1.10.1 ## [5] SpatialExperiment_1.12.0 SingleCellExperiment_1.24.0 ## [7] SummarizedExperiment_1.32.0 Biobase_2.62.0 ## [9] GenomicRanges_1.54.1 GenomeInfoDb_1.38.8 ## [11] IRanges_2.36.0 S4Vectors_0.40.2 ## [13] MatrixGenerics_1.14.0 matrixStats_1.3.0 ## [15] ExperimentHub_2.10.0 AnnotationHub_3.10.1 ## [17] BiocFileCache_2.10.2 dbplyr_2.5.0 ## [19] BiocGenerics_0.48.1 SpotSweeper_0.99.4 ## [21] BiocStyle_2.30.0 ## ## loaded via a namespace (and not attached): ## [1] jsonlite_1.8.8 magrittr_2.0.3 ## [3] magick_2.8.3 farver_2.1.1 ## [5] rmarkdown_2.26 fs_1.6.3 ## [7] zlibbioc_1.48.2 ragg_1.3.0 ## [9] vctrs_0.6.5 memoise_2.0.1 ## [11] DelayedMatrixStats_1.24.0 RCurl_1.98-1.14 ## [13] terra_1.7-71 rstatix_0.7.2 ## [15] htmltools_0.5.8.1 S4Arrays_1.2.1 ## [17] curl_5.2.1 BiocNeighbors_1.20.2 ## [19] broom_1.0.5 SparseArray_1.2.4 ## [21] sass_0.4.9 bslib_0.7.0 ## [23] htmlwidgets_1.6.4 desc_1.4.3 ## [25] cachem_1.0.8 mime_0.12 ## [27] lifecycle_1.0.4 pkgconfig_2.0.3 ## [29] Matrix_1.6-5 R6_2.5.1 ## [31] fastmap_1.1.1 GenomeInfoDbData_1.2.11 ## [33] shiny_1.8.1.1 digest_0.6.35 ## [35] colorspace_2.1-0 AnnotationDbi_1.64.1 ## [37] textshaping_0.3.7 RSQLite_2.3.6 ## [39] beachmat_2.18.1 filelock_1.0.3 ## [41] labeling_0.4.3 fansi_1.0.6 ## [43] httr_1.4.7 abind_1.4-5 ## [45] compiler_4.3.3 bit64_4.0.5 ## [47] withr_3.0.0 backports_1.4.1 ## [49] BiocParallel_1.36.0 carData_3.0-5 ## [51] DBI_1.2.2 highr_0.10 ## [53] ggsignif_0.6.4 MASS_7.3-60.0.1 ## [55] rappdirs_0.3.3 DelayedArray_0.28.0 ## [57] rjson_0.2.21 tools_4.3.3 ## [59] interactiveDisplayBase_1.40.0 httpuv_1.6.15 ## [61] glue_1.7.0 promises_1.3.0 ## [63] grid_4.3.3 generics_0.1.3 ## [65] gtable_0.3.4 tidyr_1.3.1 ## [67] car_3.1-2 utf8_1.2.4 ## [69] XVector_0.42.0 BiocVersion_3.18.1 ## [71] pillar_1.9.0 later_1.3.2 ## [73] dplyr_1.1.4 lattice_0.22-5 ## [75] bit_4.0.5 tidyselect_1.2.1 ## [77] Biostrings_2.70.3 scuttle_1.12.0 ## [79] knitr_1.46 bookdown_0.39 ## [81] xfun_0.43 yaml_2.3.8 ## [83] evaluate_0.23 codetools_0.2-19 ## [85] spatialEco_2.0-2 tibble_3.2.1 ## [87] BiocManager_1.30.22 cli_3.6.2 ## [89] xtable_1.8-4 systemfonts_1.0.6 ## [91] munsell_0.5.1 jquerylib_0.1.4 ## [93] Rcpp_1.0.12 png_0.1-8 ## [95] parallel_4.3.3 pkgdown_2.0.9 ## [97] blob_1.2.4 sparseMatrixStats_1.14.0 ## [99] bitops_1.0-7 viridisLite_0.4.2 ## [101] scales_1.3.0 purrr_1.0.2 ## [103] crayon_1.5.2 rlang_1.1.3 ## [105] cowplot_1.1.3 KEGGREST_1.42.0"},{"path":"https://mictott.github.io/SpotSweeper/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Michael Totty. Author, maintainer. Boyi Guo. Author.","code":""},{"path":"https://mictott.github.io/SpotSweeper/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"MicTott (2024). SpotSweeper: Spot artifact-level quality control spatially-resolved transcriptomics data. doi:10.18129/B9.bioc.SpotSweeper, https://github.com/MicTott/SpotSweeper/SpotSweeper - R package version 0.99.4, http://www.bioconductor.org/packages/SpotSweeper. MicTott (2024). “SpotSweeper: Spot artifact-level quality control spatially-resolved transcriptomics data.” bioRxiv. doi:10.1101/TODO, https://www.biorxiv.org/content/10.1101/TODO.","code":"@Manual{, title = {SpotSweeper: Spot and artifact-level quality control for spatially-resolved transcriptomics data}, author = {{MicTott}}, year = {2024}, url = {http://www.bioconductor.org/packages/SpotSweeper}, note = {https://github.com/MicTott/SpotSweeper/SpotSweeper - R package version 0.99.4}, doi = {10.18129/B9.bioc.SpotSweeper}, } @Article{, title = {SpotSweeper: Spot and artifact-level quality control for spatially-resolved transcriptomics data}, author = {{MicTott}}, year = {2024}, journal = {bioRxiv}, doi = {10.1101/TODO}, url = {https://www.biorxiv.org/content/10.1101/TODO}, }"},{"path":"https://mictott.github.io/SpotSweeper/index.html","id":"spotsweeper","dir":"","previous_headings":"","what":"Spatially-aware quality control for spatial transcriptomics","title":"Spatially-aware quality control for spatial transcriptomics","text":"SpotSweeper package developed spatially-aware quality control (QC) methods detection, visualization, removal local outliers large artifacts spot-based spatial transcriptomics data, 10x Genomics Visium, using standard QC metrics. package currently development yet available Bioconductor. package currently experimental stage development. experience issues user package, please open issue GitHub repository. find information, please visit documentation website.","code":""},{"path":"https://mictott.github.io/SpotSweeper/index.html","id":"installation-instructions","dir":"","previous_headings":"","what":"Installation instructions","title":"Spatially-aware quality control for spatial transcriptomics","text":"can install latest version SpotSweeper Bioconductor following code: latest development version can installed GitHub using following:","code":"if (!requireNamespace(\"BiocManager\", quietly = TRUE)) { install.packages(\"BiocManager\") } BiocManager::install(\"SpotSweeper\") if (!require(\"devtools\")) install.packages(\"devtools\") remotes::install_github(\"MicTott/SpotSweeper\")"},{"path":"https://mictott.github.io/SpotSweeper/index.html","id":"input-data-format","dir":"","previous_headings":"","what":"Input data format","title":"Spatially-aware quality control for spatial transcriptomics","text":"examples , assume input data provided SpatialExperiment (SPE) object. outputs spot-level outliers artifacts stored colData SPE object.","code":""},{"path":"https://mictott.github.io/SpotSweeper/index.html","id":"tutorials","dir":"","previous_headings":"","what":"Tutorials","title":"Spatially-aware quality control for spatial transcriptomics","text":"detailed tutorial available package vignette Bioconductor. direct link tutorial / package vignette available .","code":""},{"path":"https://mictott.github.io/SpotSweeper/index.html","id":"development-tools","dir":"","previous_headings":"","what":"Development tools","title":"Spatially-aware quality control for spatial transcriptomics","text":"Continuous code testing possible thanks GitHub actions BiocStyle::Biocpkg('biocthis'). documentation website automatically updated thanks BiocStyle::CRANpkg('pkgdown'). code styled automatically thanks BiocStyle::CRANpkg('styler'). documentation formatted thanks BiocStyle::CRANpkg('devtools') BiocStyle::CRANpkg('roxygen2'). package developed using BiocStyle::Biocpkg('biocthis').","code":""},{"path":"https://mictott.github.io/SpotSweeper/reference/DLPFC_artifact.html","id":null,"dir":"Reference","previous_headings":"","what":"human DLPFC dataset with a technical artifact (hangnail). — DLPFC_artifact","title":"human DLPFC dataset with a technical artifact (hangnail). — DLPFC_artifact","text":"DLPFC_artifact dataset SpatialExperiment object containing single-sample subset human dorsolateral prefrontal cortex (DLPFC) dataset Hukki-Myers et al. 2023. particular sample ('Br2743_ant') included demonstrate identification removal technical artifacts within spatial transcriptomics data. dataset serves example artifact detection using 'SpotSweeper' workflow.","code":""},{"path":"https://mictott.github.io/SpotSweeper/reference/DLPFC_artifact.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"human DLPFC dataset with a technical artifact (hangnail). — DLPFC_artifact","text":"","code":"data(DLPFC_artifact)"},{"path":"https://mictott.github.io/SpotSweeper/reference/DLPFC_artifact.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"human DLPFC dataset with a technical artifact (hangnail). — DLPFC_artifact","text":"SpatialExperiment object.","code":""},{"path":"https://mictott.github.io/SpotSweeper/reference/DLPFC_artifact.html","id":"source","dir":"Reference","previous_headings":"","what":"Source","title":"human DLPFC dataset with a technical artifact (hangnail). — DLPFC_artifact","text":"spatialLIBD","code":""},{"path":"https://mictott.github.io/SpotSweeper/reference/DLPFC_artifact.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"human DLPFC dataset with a technical artifact (hangnail). — DLPFC_artifact","text":"Hukki-Myers et al. (2023) bioRxiv (bioRxiv)","code":""},{"path":"https://mictott.github.io/SpotSweeper/reference/DLPFC_artifact.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"human DLPFC dataset with a technical artifact (hangnail). — DLPFC_artifact","text":"","code":"data(DLPFC_artifact)"},{"path":"https://mictott.github.io/SpotSweeper/reference/findArtifacts.html","id":null,"dir":"Reference","previous_headings":"","what":"Identify and annotate artifacts in spatial transcriptomics data — findArtifacts","title":"Identify and annotate artifacts in spatial transcriptomics data — findArtifacts","text":"function identifies annotates potential artifacts spatial transcriptomics data. Artifacts detected based local mito variance, results added original SpatialExperiment (sce) object.","code":""},{"path":"https://mictott.github.io/SpotSweeper/reference/findArtifacts.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Identify and annotate artifacts in spatial transcriptomics data — findArtifacts","text":"","code":"findArtifacts( spe, mito_percent = \"expr_chrM_ratio\", mito_sum = \"expr_chrM\", samples = \"sample_id\", n_rings = 5, log = TRUE, name = \"artifact\", var_output = TRUE )"},{"path":"https://mictott.github.io/SpotSweeper/reference/findArtifacts.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Identify and annotate artifacts in spatial transcriptomics data — findArtifacts","text":"spe SingleCellExperiment object. mito_percent column name representing mitochondrial percent. Default 'expr_chrM_ratio'. mito_sum column name representing sum mitochondrial expression. Default 'expr_chrM'. samples column name representing sample IDs. Default 'sample_id'. n_rings number rings local mito variance calculation. Default 5. log Logical, indicating whether log1p transform mito_percent. Default TRUE. name Prefix local variance column names. Default 'artifact'. var_output Logical, indicating whether include local variances output. Default TRUE.","code":""},{"path":"https://mictott.github.io/SpotSweeper/reference/findArtifacts.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Identify and annotate artifacts in spatial transcriptomics data — findArtifacts","text":"Returns modified SingleCellExperiment object artifact annotations.","code":""},{"path":[]},{"path":"https://mictott.github.io/SpotSweeper/reference/findArtifacts.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Identify and annotate artifacts in spatial transcriptomics data — findArtifacts","text":"","code":"library(SpotSweeper) library(SpatialExperiment) #> Loading required package: SingleCellExperiment #> Loading required package: SummarizedExperiment #> Loading required package: MatrixGenerics #> Loading required package: matrixStats #> #> Attaching package: ‘MatrixGenerics’ #> The following objects are masked from ‘package:matrixStats’: #> #> colAlls, colAnyNAs, colAnys, colAvgsPerRowSet, colCollapse, #> colCounts, colCummaxs, colCummins, colCumprods, colCumsums, #> colDiffs, colIQRDiffs, colIQRs, colLogSumExps, colMadDiffs, #> colMads, colMaxs, colMeans2, colMedians, colMins, colOrderStats, #> colProds, colQuantiles, colRanges, colRanks, colSdDiffs, colSds, #> colSums2, colTabulates, colVarDiffs, colVars, colWeightedMads, #> colWeightedMeans, colWeightedMedians, colWeightedSds, #> colWeightedVars, rowAlls, rowAnyNAs, rowAnys, rowAvgsPerColSet, #> rowCollapse, rowCounts, rowCummaxs, rowCummins, rowCumprods, #> rowCumsums, rowDiffs, rowIQRDiffs, rowIQRs, rowLogSumExps, #> rowMadDiffs, rowMads, rowMaxs, rowMeans2, rowMedians, rowMins, #> rowOrderStats, rowProds, rowQuantiles, rowRanges, rowRanks, #> rowSdDiffs, rowSds, rowSums2, rowTabulates, rowVarDiffs, rowVars, #> rowWeightedMads, rowWeightedMeans, rowWeightedMedians, #> rowWeightedSds, rowWeightedVars #> Loading required package: GenomicRanges #> Loading required package: stats4 #> Loading required package: BiocGenerics #> #> Attaching package: ‘BiocGenerics’ #> The following objects are masked from ‘package:stats’: #> #> IQR, mad, sd, var, xtabs #> The following objects are masked from ‘package:base’: #> #> Filter, Find, Map, Position, Reduce, anyDuplicated, aperm, append, #> as.data.frame, basename, cbind, colnames, dirname, do.call, #> duplicated, eval, evalq, get, grep, grepl, intersect, is.unsorted, #> lapply, mapply, match, mget, order, paste, pmax, pmax.int, pmin, #> pmin.int, rank, rbind, rownames, sapply, setdiff, sort, table, #> tapply, union, unique, unsplit, which.max, which.min #> Loading required package: S4Vectors #> #> Attaching package: ‘S4Vectors’ #> The following object is masked from ‘package:utils’: #> #> findMatches #> The following objects are masked from ‘package:base’: #> #> I, expand.grid, unname #> Loading required package: IRanges #> Loading required package: GenomeInfoDb #> Loading required package: Biobase #> Welcome to Bioconductor #> #> Vignettes contain introductory material; view with #> 'browseVignettes()'. To cite Bioconductor, see #> 'citation(\"Biobase\")', and for packages 'citation(\"pkgname\")'. #> #> Attaching package: ‘Biobase’ #> The following object is masked from ‘package:MatrixGenerics’: #> #> rowMedians #> The following objects are masked from ‘package:matrixStats’: #> #> anyMissing, rowMedians library(escheR) #> Loading required package: ggplot2 data(DLPFC_artifact) spe <- DLPFC_artifact # find artifacts spe <- findArtifacts(spe, mito_percent = \"expr_chrM_ratio\", mito_sum = \"expr_chrM\", n_rings = 2, # 5 recommended, using 1 for time name = \"artifact\" )"},{"path":"https://mictott.github.io/SpotSweeper/reference/localOutliers.html","id":null,"dir":"Reference","previous_headings":"","what":"localOutliers Function — localOutliers","title":"localOutliers Function — localOutliers","text":"function detects local outliers spatial transcriptomics data based standard quality control metrics, library size, unique genes, mitochondrial ratio. Local outliers defined spots low/high quality metrics compared surrounding neighbors, based modified z-score statistic.","code":""},{"path":"https://mictott.github.io/SpotSweeper/reference/localOutliers.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"localOutliers Function — localOutliers","text":"","code":"localOutliers( spe, metric = \"detected\", direction = \"lower\", n_neighbors = 36, samples = \"sample_id\", log = TRUE, cutoff = 3 )"},{"path":"https://mictott.github.io/SpotSweeper/reference/localOutliers.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"localOutliers Function — localOutliers","text":"spe SpatialExperiment object metric colData QC metric use outlier detection direction Direction outlier detection (higher, lower, ) n_neighbors Number nearest neighbors use outlier detection samples Column name colData use sample IDs log Logical indicating whether log1p transform features (default TRUE) cutoff Cutoff outlier detection (default 3)","code":""},{"path":"https://mictott.github.io/SpotSweeper/reference/localOutliers.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"localOutliers Function — localOutliers","text":"SpatialExperiment object updated colData containing outputs","code":""},{"path":"https://mictott.github.io/SpotSweeper/reference/localOutliers.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"localOutliers Function — localOutliers","text":"","code":"library(SpotSweeper) library(SpatialExperiment) # load example data spe <- STexampleData::Visium_humanDLPFC() #> see ?STexampleData and browseVignettes('STexampleData') for documentation #> downloading 1 resources #> retrieving 1 resource #> loading from cache # change from gene id to gene names rownames(spe) <- rowData(spe)$gene_name # drop out-of-tissue spots spe <- spe[, spe$in_tissue == 1] spe <- spe[, !is.na(spe$ground_truth)] # Identifying the mitochondrial transcripts in our SpatialExperiment. is.mito <- rownames(spe)[grepl(\"^MT-\", rownames(spe))] # Calculating QC metrics for each spot using scuttle spe <- scuttle::addPerCellQCMetrics(spe, subsets = list(Mito = is.mito)) colnames(colData(spe)) #> [1] \"barcode_id\" \"sample_id\" \"in_tissue\" #> [4] \"array_row\" \"array_col\" \"ground_truth\" #> [7] \"cell_count\" \"sum\" \"detected\" #> [10] \"subsets_Mito_sum\" \"subsets_Mito_detected\" \"subsets_Mito_percent\" #> [13] \"total\" # Identifying local outliers using SpotSweeper spe <- localOutliers(spe, metric = \"sum\", direction = \"lower\", log = TRUE )"},{"path":"https://mictott.github.io/SpotSweeper/reference/localVariance.html","id":null,"dir":"Reference","previous_headings":"","what":"localVariance Function — localVariance","title":"localVariance Function — localVariance","text":"function calculates local variance based kNN.","code":""},{"path":"https://mictott.github.io/SpotSweeper/reference/localVariance.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"localVariance Function — localVariance","text":"","code":"localVariance( spe, n_neighbors = 36, metric = c(\"expr_chrM_ratio\"), samples = \"sample_id\", log = FALSE, name = NULL )"},{"path":"https://mictott.github.io/SpotSweeper/reference/localVariance.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"localVariance Function — localVariance","text":"spe SpatialExperiment object following columns colData: sample_id, sum_umi, sum_gene n_neighbors Number nearest neighbors use variance calculation metric metric use variance calculation samples Column colData use sample ID log Whether log1p transform metric name Name new column add colData","code":""},{"path":"https://mictott.github.io/SpotSweeper/reference/localVariance.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"localVariance Function — localVariance","text":"SpatialExperiment object metric variance added colData","code":""},{"path":"https://mictott.github.io/SpotSweeper/reference/localVariance.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"localVariance Function — localVariance","text":"","code":"# for more details see extended example in vignettes library(SpotSweeper) library(SpatialExperiment) library(escheR) # load example data spe <- STexampleData::Visium_humanDLPFC() #> see ?STexampleData and browseVignettes('STexampleData') for documentation #> loading from cache # change from gene id to gene names rownames(spe) <- rowData(spe)$gene_name # show column data before SpotSweepR colnames(colData(spe)) #> [1] \"barcode_id\" \"sample_id\" \"in_tissue\" \"array_row\" \"array_col\" #> [6] \"ground_truth\" \"cell_count\" # drop out-of-tissue spots spe <- spe[, spe$in_tissue == 1] spe <- spe[, !is.na(spe$ground_truth)] # Identifying the mitochondrial transcripts in our SpatialExperiment. is.mito <- rownames(spe)[grepl(\"^MT-\", rownames(spe))] # Calculating QC metric for each spot using scuttle spe <- scuttle::addPerCellQCMetrics(spe, subsets = list(Mito = is.mito)) colnames(colData(spe)) #> [1] \"barcode_id\" \"sample_id\" \"in_tissue\" #> [4] \"array_row\" \"array_col\" \"ground_truth\" #> [7] \"cell_count\" \"sum\" \"detected\" #> [10] \"subsets_Mito_sum\" \"subsets_Mito_detected\" \"subsets_Mito_percent\" #> [13] \"total\" spe <- localVariance(spe, metric = \"subsets_Mito_percent\", n_neighbors = 36, name = \"local_mito_variance_k36\" ) plotQC(spe, metric=\"local_mito_variance_k36\")"},{"path":"https://mictott.github.io/SpotSweeper/reference/plotQC.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot QC metrics for a Single Sample in a SpatialExperiment object — plotQC","title":"Plot QC metrics for a Single Sample in a SpatialExperiment object — plotQC","text":"function generates plot specified sample within SpatialExperiment object, highlighting outliers based specified metric. plot visualizes metric interest indicates outliers distinct color.","code":""},{"path":"https://mictott.github.io/SpotSweeper/reference/plotQC.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot QC metrics for a Single Sample in a SpatialExperiment object — plotQC","text":"","code":"plotQC( spe, sample_id = \"sample_id\", sample = unique(spe$sample_id)[1], metric = \"detected\", outliers = NULL, point_size = 2, colors = c(\"white\", \"black\"), stroke = 1 )"},{"path":"https://mictott.github.io/SpotSweeper/reference/plotQC.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot QC metrics for a Single Sample in a SpatialExperiment object — plotQC","text":"spe SpatialExperiment object containing data plotted. sample_id character string specifying column name colData(spe) contains unique sample identifiers. Default \"sample_id\". sample character string numeric value specifying sample plotted. default, plots first unique sample found spe$sample_id. metric character string specifying metric visualized plot. metric column name colData(spe). outliers character string specifying column name colData(spe) indicates whether data point considered outlier. Default NULL. point_size numeric value specifying size points plot. Default 2. colors character vector specifying colors used gradient scale. length 2, gradient single color gradient. stroke numeric value specifying border thickness outlier points. Default 1.","code":""},{"path":"https://mictott.github.io/SpotSweeper/reference/plotQC.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot QC metrics for a Single Sample in a SpatialExperiment object — plotQC","text":"function returns plot object created make_escheR modified additional layers visualizing specified metric outliers. plot explicitly printed function printed caller.","code":""},{"path":"https://mictott.github.io/SpotSweeper/reference/plotQC.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Plot QC metrics for a Single Sample in a SpatialExperiment object — plotQC","text":"","code":"library(SpotSweeper) library(SpatialExperiment) library(escheR) # load example data spe <- STexampleData::Visium_humanDLPFC() #> see ?STexampleData and browseVignettes('STexampleData') for documentation #> loading from cache # change from gene id to gene names rownames(spe) <- rowData(spe)$gene_name # drop out-of-tissue spots spe <- spe[, spe$in_tissue == 1] spe <- spe[, !is.na(spe$ground_truth)] # Identifying the mitochondrial transcripts in our SpatialExperiment. is.mito <- rownames(spe)[grepl(\"^MT-\", rownames(spe))] # Calculating QC metrics for each spot using scuttle spe <- scuttle::addPerCellQCMetrics(spe, subsets = list(Mito = is.mito)) colnames(colData(spe)) #> [1] \"barcode_id\" \"sample_id\" \"in_tissue\" #> [4] \"array_row\" \"array_col\" \"ground_truth\" #> [7] \"cell_count\" \"sum\" \"detected\" #> [10] \"subsets_Mito_sum\" \"subsets_Mito_detected\" \"subsets_Mito_percent\" #> [13] \"total\" # Identifying local outliers using SpotSweeper spe <- localOutliers(spe, metric = \"sum\", direction = \"lower\", log = TRUE ) plotQC(spe, metric=\"sum\", outliers=\"sum_outliers\")"},{"path":"https://mictott.github.io/SpotSweeper/reference/plotQCpdf.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot Outlier Metrics to PDF — plotQCpdf","title":"Plot Outlier Metrics to PDF — plotQCpdf","text":"function generates PDF file containing plots sample SpatialExperiment object, highlighting outliers based specified metrics. plot visualizes outlier metrics single sample, allowing easy comparison analysis across samples.","code":""},{"path":"https://mictott.github.io/SpotSweeper/reference/plotQCpdf.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot Outlier Metrics to PDF — plotQCpdf","text":"","code":"plotQCpdf( spe, sample_id = \"sample_id\", metric = \"detected\", outliers = \"local_outliers\", colors = c(\"white\", \"black\"), stroke = 1, point_size = 2, width = 5, height = 5, fname )"},{"path":"https://mictott.github.io/SpotSweeper/reference/plotQCpdf.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot Outlier Metrics to PDF — plotQCpdf","text":"spe SpatialExperiment object containing data plotted. sample_id character string specifying column name colData(spe) contains unique sample identifiers. Default 'sample_id'. metric character string specifying metric visualized plot. metric column name colData(spe). outliers character string specifying column name colData(spe) indicates whether data point considered outlier. Default local_outliers'. colors character vector specifying colors used gradient scale. length 2, gradient single color gradient stroke numeric value specifying border thickness outlier points. Default 1. point_size numeric value specifying size points plot. Default 2. width numeric value indicating width plot. Default 5. height numeric value indicating height plot. Default 5. fname character string specifying path name output PDF file.","code":""},{"path":"https://mictott.github.io/SpotSweeper/reference/plotQCpdf.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot Outlier Metrics to PDF — plotQCpdf","text":"ggplot object specified. Generates plot otherwise.","code":""},{"path":"https://mictott.github.io/SpotSweeper/reference/plotQCpdf.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Plot Outlier Metrics to PDF — plotQCpdf","text":"","code":"library(SpotSweeper) library(SpatialExperiment) library(escheR) # load example data spe <- STexampleData::Visium_humanDLPFC() #> see ?STexampleData and browseVignettes('STexampleData') for documentation #> loading from cache tempFilePath <- file.path(tempdir(), \"examplePlot.pdf\") # change from gene id to gene names rownames(spe) <- rowData(spe)$gene_name # drop out-of-tissue spots spe <- spe[, spe$in_tissue == 1] spe <- spe[, !is.na(spe$ground_truth)] # Identifying the mitochondrial transcripts in our SpatialExperiment. is.mito <- rownames(spe)[grepl(\"^MT-\", rownames(spe))] # Calculating QC metrics for each spot using scuttle spe <- scuttle::addPerCellQCMetrics(spe, subsets = list(Mito = is.mito)) colnames(colData(spe)) #> [1] \"barcode_id\" \"sample_id\" \"in_tissue\" #> [4] \"array_row\" \"array_col\" \"ground_truth\" #> [7] \"cell_count\" \"sum\" \"detected\" #> [10] \"subsets_Mito_sum\" \"subsets_Mito_detected\" \"subsets_Mito_percent\" #> [13] \"total\" # Identifying local outliers using SpotSweeper spe <- localOutliers(spe, metric = \"sum\", direction = \"lower\", log = TRUE ) plotQCpdf(spe, metric=\"sum\", outliers=\"sum_outliers\", fname=tempFilePath) #> agg_png #> 2"},{"path":"https://mictott.github.io/SpotSweeper/news/index.html","id":"spotsweeper-0991","dir":"Changelog","previous_headings":"","what":"SpotSweeper 0.99.1","title":"SpotSweeper 0.99.1","text":"Added NEWS.md file track changes package. First full version package submitted Bioconductor. See Bioconductor submission .","code":""}] +[{"path":"https://mictott.github.io/SpotSweeper/CONTRIBUTING.html","id":null,"dir":"","previous_headings":"","what":"Contributing to SpotSweeper","title":"Contributing to SpotSweeper","text":"outlines propose change SpotSweeper. detailed discussion contributing tidyverse packages, please see development contributing guide code review principles.","code":""},{"path":"https://mictott.github.io/SpotSweeper/CONTRIBUTING.html","id":"fixing-typos","dir":"","previous_headings":"","what":"Fixing typos","title":"Contributing to SpotSweeper","text":"can fix typos, spelling mistakes, grammatical errors documentation directly using GitHub web interface, long changes made source file. generally means ’ll need edit roxygen2 comments .R, .Rd file. can find .R file generates .Rd reading comment first line.","code":""},{"path":"https://mictott.github.io/SpotSweeper/CONTRIBUTING.html","id":"bigger-changes","dir":"","previous_headings":"","what":"Bigger changes","title":"Contributing to SpotSweeper","text":"want make bigger change, ’s good idea first file issue make sure someone team agrees ’s needed. ’ve found bug, please file issue illustrates bug minimal reprex (also help write unit test, needed). See guide create great issue advice.","code":""},{"path":"https://mictott.github.io/SpotSweeper/CONTRIBUTING.html","id":"pull-request-process","dir":"","previous_headings":"Bigger changes","what":"Pull request process","title":"Contributing to SpotSweeper","text":"Fork package clone onto computer. haven’t done , recommend using usethis::create_from_github(\"MicTott/SpotSweeper\", fork = TRUE). Install development dependencies devtools::install_dev_deps(), make sure package passes R CMD check running devtools::check(). R CMD check doesn’t pass cleanly, ’s good idea ask help continuing. Create Git branch pull request (PR). recommend using usethis::pr_init(\"brief-description--change\"). Make changes, commit git, create PR running usethis::pr_push(), following prompts browser. title PR briefly describe change. body PR contain Fixes #issue-number. user-facing changes, add bullet top NEWS.md (.e. just first header). Follow style described https://style.tidyverse.org/news.html.","code":""},{"path":"https://mictott.github.io/SpotSweeper/CONTRIBUTING.html","id":"code-style","dir":"","previous_headings":"Bigger changes","what":"Code style","title":"Contributing to SpotSweeper","text":"New code follow tidyverse style guide. can use styler package apply styles, please don’t restyle code nothing PR. use roxygen2, Markdown syntax, documentation. use testthat unit tests. Contributions test cases included easier accept.","code":""},{"path":"https://mictott.github.io/SpotSweeper/CONTRIBUTING.html","id":"code-of-conduct","dir":"","previous_headings":"","what":"Code of Conduct","title":"Contributing to SpotSweeper","text":"Please note SpotSweeper project released Contributor Code Conduct. contributing project agree abide terms.","code":""},{"path":"https://mictott.github.io/SpotSweeper/LICENSE.html","id":null,"dir":"","previous_headings":"","what":"MIT License","title":"MIT License","text":"Copyright (c) 2024 SpotSweeper authors Permission hereby granted, free charge, person obtaining copy software associated documentation files (“Software”), deal Software without restriction, including without limitation rights use, copy, modify, merge, publish, distribute, sublicense, /sell copies Software, permit persons Software furnished , subject following conditions: copyright notice permission notice shall included copies substantial portions Software. SOFTWARE PROVIDED “”, WITHOUT WARRANTY KIND, EXPRESS IMPLIED, INCLUDING LIMITED WARRANTIES MERCHANTABILITY, FITNESS PARTICULAR PURPOSE NONINFRINGEMENT. EVENT SHALL AUTHORS COPYRIGHT HOLDERS LIABLE CLAIM, DAMAGES LIABILITY, WHETHER ACTION CONTRACT, TORT OTHERWISE, ARISING , CONNECTION SOFTWARE USE DEALINGS SOFTWARE.","code":""},{"path":"https://mictott.github.io/SpotSweeper/SUPPORT.html","id":null,"dir":"","previous_headings":"","what":"Getting help with SpotSweeper","title":"Getting help with SpotSweeper","text":"Thank using SpotSweeper! filing issue, things know make process smooth possible parties.","code":""},{"path":"https://mictott.github.io/SpotSweeper/SUPPORT.html","id":"make-a-reprex","dir":"","previous_headings":"","what":"Make a reprex","title":"Getting help with SpotSweeper","text":"Start making minimally reproducible example, also known ‘reprex’. may use reprex R package create one, though necessary help. make R-question-asking endeavors easier. Learning use takes 5 10 minutes. tips make minimally reproducible example, see StackOverflow link.","code":""},{"path":"https://mictott.github.io/SpotSweeper/SUPPORT.html","id":"where-to-post-it","dir":"","previous_headings":"","what":"Where to post it?","title":"Getting help with SpotSweeper","text":"Bioconductor help web page gives overview places may help answer question. Bioconductor software related questions, bug reports feature requests, addressed appropriate Bioconductor/SpotSweeper GitHub repository. Follow bug report feature request templates GitHub. package GitHub repository, see next bullet point. Bioconductor software usage questions addressed Bioconductor Support Website. Make sure use appropriate package tag, otherwise package authors get notification. General R questions can posed StackOverflow RStudio Community website especially pertain tidyverse RStudio GUI related products.","code":""},{"path":"https://mictott.github.io/SpotSweeper/SUPPORT.html","id":"issues-or-feature-requests","dir":"","previous_headings":"","what":"Issues or Feature Requests","title":"Getting help with SpotSweeper","text":"opening new issue feature request, sure search issues pull requests ensure one already exist implemented development version. Note. can remove :open search term issues page search open closed issues. See link learn modifying search.","code":""},{"path":"https://mictott.github.io/SpotSweeper/SUPPORT.html","id":"what-happens-next","dir":"","previous_headings":"","what":"What happens next?","title":"Getting help with SpotSweeper","text":"Bioconductor maintainers limited resources strive responsive possible. Please forget tag appropriate maintainer issue GitHub username (e.g., @username). order make easy possible Bioconductor core developers remediate issue. Provide accurate, brief, reproducible report outlined issue templates. Thank trusting Bioconductor.","code":""},{"path":"https://mictott.github.io/SpotSweeper/articles/getting_started.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"Getting started with 'SpotSweeper'","text":"SpotSweeper R package spatial transcriptomics data quality control (QC). provides functions detecting visualizing spot-level local outliers artifacts using spatially-aware methods. package designed work SpatialExperiment objects, compatible data 10X Genomics Visium spatial transcriptomics platforms.","code":""},{"path":"https://mictott.github.io/SpotSweeper/articles/getting_started.html","id":"installation","dir":"Articles","previous_headings":"","what":"Installation","title":"Getting started with 'SpotSweeper'","text":"Currently, way install SpotSweeper downloading development version can installed GitHub using following: accepted Bioconductor, SpotSweeper installable using:","code":"if (!require(\"devtools\")) install.packages(\"devtools\") remotes::install_github(\"MicTott/SpotSweeper\") if (!requireNamespace(\"BiocManager\", quietly = TRUE)) { install.packages(\"BiocManager\") } BiocManager::install(\"SpotSweeper\")"},{"path":[]},{"path":"https://mictott.github.io/SpotSweeper/articles/getting_started.html","id":"loading-example-data","dir":"Articles","previous_headings":"Spot-level local outlier detection","what":"Loading example data","title":"Getting started with 'SpotSweeper'","text":"’ll walk standard workflow using ‘SpotSweeper’ detect visualize local outliers spatial transcriptomics data. ’ll use Visium_humanDLPFC dataset STexampleData package, SpatialExperiment object. local outliers saved colData SpatialExperiment object, ’ll first view colData drop --tissue spots calculating quality control (QC) metrics running SpotSweeper.","code":"library(SpotSweeper) # load Maynard et al DLPFC daatset spe <- STexampleData::Visium_humanDLPFC() ## see ?STexampleData and browseVignettes('STexampleData') for documentation ## loading from cache # show column data before SpotSweeper colnames(colData(spe)) ## [1] \"barcode_id\" \"sample_id\" \"in_tissue\" \"array_row\" \"array_col\" ## [6] \"ground_truth\" \"cell_count\" # drop out-of-tissue spots spe <- spe[, spe$in_tissue == 1]"},{"path":"https://mictott.github.io/SpotSweeper/articles/getting_started.html","id":"calculating-qc-metrics-using-scuttle","dir":"Articles","previous_headings":"Spot-level local outlier detection","what":"Calculating QC metrics using scuttle","title":"Getting started with 'SpotSweeper'","text":"’ll use scuttle package calculate QC metrics. , ’ll need first change rownames gene id gene names. ’ll get mitochondrial transcripts calculate QC metrics spot using scuttle::addPerCellQCMetrics.","code":"# change from gene id to gene names rownames(spe) <- rowData(spe)$gene_name # identifying the mitochondrial transcripts is.mito <- rownames(spe)[grepl(\"^MT-\", rownames(spe))] # calculating QC metrics for each spot using scuttle spe <- scuttle::addPerCellQCMetrics(spe, subsets = list(Mito = is.mito)) colnames(colData(spe)) ## [1] \"barcode_id\" \"sample_id\" \"in_tissue\" ## [4] \"array_row\" \"array_col\" \"ground_truth\" ## [7] \"cell_count\" \"sum\" \"detected\" ## [10] \"subsets_Mito_sum\" \"subsets_Mito_detected\" \"subsets_Mito_percent\" ## [13] \"total\""},{"path":"https://mictott.github.io/SpotSweeper/articles/getting_started.html","id":"identifying-local-outliers-using-spotsweeper","dir":"Articles","previous_headings":"Spot-level local outlier detection","what":"Identifying local outliers using SpotSweeper","title":"Getting started with 'SpotSweeper'","text":"can now use SpotSweeper identify local outliers spatial transcriptomics data. ’ll use localOutliers function detect local outliers based unique detected genes, total library size, percent total reads mitochondrial. methods assume normal distribution, ’ll use log-transformed sum counts log-transformed number detected genes. mitochondrial percent, ’ll use raw mitochondrial percentage. localOutlier function automatically outputs results colData naming convention X_outliers, X name input colData. can combine outliers single column called local_outliers colData SpatialExperiment object.","code":"# library size spe <- localOutliers(spe, metric = \"sum\", direction = \"lower\", log = TRUE ) # unique genes spe <- localOutliers(spe, metric = \"detected\", direction = \"lower\", log = TRUE ) # mitochondrial percent spe <- localOutliers(spe, metric = \"subsets_Mito_percent\", direction = \"higher\", log = FALSE ) # combine all outliers into \"local_outliers\" column spe$local_outliers <- as.logical(spe$sum_outliers) | as.logical(spe$detected_outliers) | as.logical(spe$subsets_Mito_percent_outliers)"},{"path":"https://mictott.github.io/SpotSweeper/articles/getting_started.html","id":"visualizing-local-outliers","dir":"Articles","previous_headings":"Spot-level local outlier detection","what":"Visualizing local outliers","title":"Getting started with 'SpotSweeper'","text":"can visualize local outliers using plotQC function. function creates scatter plot specified metric highlights local outliers red using escheR package. , ’ll visualize local outliers library size, unique genes, mitochondrial percent, finally, local outliers. ’ll arrange plots grid using ggpubr::arrange.","code":"library(escheR) ## Loading required package: ggplot2 library(ggpubr) # library size p1 <- plotQC(spe, metric = \"sum_log\", outliers = \"sum_outliers\", point_size = 1.1 ) + ggtitle(\"Library Size\") # unique genes p2 <- plotQC(spe, metric = \"detected_log\", outliers = \"detected_outliers\", point_size = 1.1 ) + ggtitle(\"Unique Genes\") # mitochondrial percent p3 <- plotQC(spe, metric = \"subsets_Mito_percent\", outliers = \"subsets_Mito_percent_outliers\", point_size = 1.1 ) + ggtitle(\"Mitochondrial Percent\") # all local outliers p4 <- plotQC(spe, metric = \"sum_log\", outliers = \"local_outliers\", point_size = 1.1, stroke = 0.75 ) + ggtitle(\"All Local Outliers\") # plot plot_list <- list(p1, p2, p3, p4) ggarrange( plotlist = plot_list, ncol = 2, nrow = 2, common.legend = FALSE )"},{"path":[]},{"path":"https://mictott.github.io/SpotSweeper/articles/getting_started.html","id":"loading-example-data-1","dir":"Articles","previous_headings":"Removing technical artifacts using SpotSweeper","what":"Loading example data","title":"Getting started with 'SpotSweeper'","text":"","code":"# load in DLPFC sample with hangnail artifact data(DLPFC_artifact) spe <- DLPFC_artifact # inspect colData before artifact detection colnames(colData(spe)) ## [1] \"sample_id\" \"in_tissue\" \"array_row\" ## [4] \"array_col\" \"key\" \"sum_umi\" ## [7] \"sum_gene\" \"expr_chrM\" \"expr_chrM_ratio\" ## [10] \"ManualAnnotation\" \"subject\" \"region\" ## [13] \"sex\" \"age\" \"diagnosis\" ## [16] \"sample_id_complete\" \"count\" \"sizeFactor\""},{"path":"https://mictott.github.io/SpotSweeper/articles/getting_started.html","id":"visualizing-technical-artifacts","dir":"Articles","previous_headings":"Removing technical artifacts using SpotSweeper","what":"Visualizing technical artifacts","title":"Getting started with 'SpotSweeper'","text":"Technical artifacts can commonly visualized standard QC metrics, including library size, unique genes, mitochondrial percentage. can first visualize technical artifacts using plotQC function. function plots Visium spots specified QC metric.’ll arrange plots using ggpubr::arrange.","code":"# library size p1 <- plotQC(spe, metric = \"sum_umi\", outliers = NULL, point_size = 1.1 ) + ggtitle(\"Library Size\") # unique genes p2 <- plotQC(spe, metric = \"sum_gene\", outliers = NULL, point_size = 1.1 ) + ggtitle(\"Unique Genes\") # mitochondrial percent p3 <- plotQC(spe, metric = \"expr_chrM_ratio\", outliers = NULL, point_size = 1.1 ) + ggtitle(\"Mitochondrial Percent\") # plot plot_list <- list(p1, p2, p3) ggarrange( plotlist = plot_list, ncol = 3, nrow = 1, common.legend = FALSE )"},{"path":"https://mictott.github.io/SpotSweeper/articles/getting_started.html","id":"identifying-artifacts-using-spotsweeper","dir":"Articles","previous_headings":"Removing technical artifacts using SpotSweeper","what":"Identifying artifacts using SpotSweeper","title":"Getting started with 'SpotSweeper'","text":"can use findArtifacts function identify artifacts spatial transcriptomics (data. function identifies technical artifacts based first principle component local variance specified QC metric (mito_percent) numerous neighorhood sizes (n_rings=5). Currently, kmeans clustering used cluster technical artifact vs high-quality Visium spots. Similar localOutliers, findArtifacts function outputs results colData.","code":"# find artifacts using SpotSweeper spe <- findArtifacts(spe, mito_percent = \"expr_chrM_ratio\", mito_sum = \"expr_chrM\", n_rings = 5, name = \"artifact\" ) # check that \"artifact\" is now in colData colnames(colData(spe)) ## [1] \"sample_id\" \"in_tissue\" \"array_row\" ## [4] \"array_col\" \"key\" \"sum_umi\" ## [7] \"sum_gene\" \"expr_chrM\" \"expr_chrM_ratio\" ## [10] \"ManualAnnotation\" \"subject\" \"region\" ## [13] \"sex\" \"age\" \"diagnosis\" ## [16] \"sample_id_complete\" \"count\" \"sizeFactor\" ## [19] \"expr_chrM_ratio_log\" \"coords\" \"k6\" ## [22] \"k18\" \"k36\" \"k60\" ## [25] \"k90\" \"artifact\""},{"path":"https://mictott.github.io/SpotSweeper/articles/getting_started.html","id":"visualizing-artifacts","dir":"Articles","previous_headings":"Removing technical artifacts using SpotSweeper","what":"Visualizing artifacts","title":"Getting started with 'SpotSweeper'","text":"can visualize artifacts using escheR package. , ’ll visualize artifacts using plotQC function arrange plots using ggpubr::arrange. # Session information","code":"plotQC(spe, metric = \"expr_chrM_ratio\", outliers = \"artifact\", point_size = 1.1 ) + ggtitle(\"Hangnail artifact\") utils::sessionInfo() ## R version 4.3.3 (2024-02-29) ## Platform: x86_64-pc-linux-gnu (64-bit) ## Running under: Ubuntu 22.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.20.so; LAPACK version 3.10.0 ## ## locale: ## [1] LC_CTYPE=C.UTF-8 LC_NUMERIC=C LC_TIME=C.UTF-8 ## [4] LC_COLLATE=C.UTF-8 LC_MONETARY=C.UTF-8 LC_MESSAGES=C.UTF-8 ## [7] LC_PAPER=C.UTF-8 LC_NAME=C LC_ADDRESS=C ## [10] LC_TELEPHONE=C LC_MEASUREMENT=C.UTF-8 LC_IDENTIFICATION=C ## ## time zone: UTC ## tzcode source: system (glibc) ## ## attached base packages: ## [1] stats4 stats graphics grDevices utils datasets methods ## [8] base ## ## other attached packages: ## [1] ggpubr_0.6.0 escheR_1.2.0 ## [3] ggplot2_3.5.0 STexampleData_1.10.1 ## [5] SpatialExperiment_1.12.0 SingleCellExperiment_1.24.0 ## [7] SummarizedExperiment_1.32.0 Biobase_2.62.0 ## [9] GenomicRanges_1.54.1 GenomeInfoDb_1.38.8 ## [11] IRanges_2.36.0 S4Vectors_0.40.2 ## [13] MatrixGenerics_1.14.0 matrixStats_1.3.0 ## [15] ExperimentHub_2.10.0 AnnotationHub_3.10.1 ## [17] BiocFileCache_2.10.2 dbplyr_2.5.0 ## [19] BiocGenerics_0.48.1 SpotSweeper_0.99.5 ## [21] BiocStyle_2.30.0 ## ## loaded via a namespace (and not attached): ## [1] jsonlite_1.8.8 magrittr_2.0.3 ## [3] magick_2.8.3 farver_2.1.1 ## [5] rmarkdown_2.26 fs_1.6.3 ## [7] zlibbioc_1.48.2 ragg_1.3.0 ## [9] vctrs_0.6.5 memoise_2.0.1 ## [11] DelayedMatrixStats_1.24.0 RCurl_1.98-1.14 ## [13] terra_1.7-71 rstatix_0.7.2 ## [15] htmltools_0.5.8.1 S4Arrays_1.2.1 ## [17] curl_5.2.1 BiocNeighbors_1.20.2 ## [19] broom_1.0.5 SparseArray_1.2.4 ## [21] sass_0.4.9 bslib_0.7.0 ## [23] htmlwidgets_1.6.4 desc_1.4.3 ## [25] cachem_1.0.8 mime_0.12 ## [27] lifecycle_1.0.4 pkgconfig_2.0.3 ## [29] Matrix_1.6-5 R6_2.5.1 ## [31] fastmap_1.1.1 GenomeInfoDbData_1.2.11 ## [33] shiny_1.8.1.1 digest_0.6.35 ## [35] colorspace_2.1-0 AnnotationDbi_1.64.1 ## [37] textshaping_0.3.7 RSQLite_2.3.6 ## [39] beachmat_2.18.1 filelock_1.0.3 ## [41] labeling_0.4.3 fansi_1.0.6 ## [43] httr_1.4.7 abind_1.4-5 ## [45] compiler_4.3.3 bit64_4.0.5 ## [47] withr_3.0.0 backports_1.4.1 ## [49] BiocParallel_1.36.0 carData_3.0-5 ## [51] DBI_1.2.2 highr_0.10 ## [53] ggsignif_0.6.4 MASS_7.3-60.0.1 ## [55] rappdirs_0.3.3 DelayedArray_0.28.0 ## [57] rjson_0.2.21 tools_4.3.3 ## [59] interactiveDisplayBase_1.40.0 httpuv_1.6.15 ## [61] glue_1.7.0 promises_1.3.0 ## [63] grid_4.3.3 generics_0.1.3 ## [65] gtable_0.3.4 tidyr_1.3.1 ## [67] car_3.1-2 utf8_1.2.4 ## [69] XVector_0.42.0 BiocVersion_3.18.1 ## [71] pillar_1.9.0 later_1.3.2 ## [73] dplyr_1.1.4 lattice_0.22-5 ## [75] bit_4.0.5 tidyselect_1.2.1 ## [77] Biostrings_2.70.3 scuttle_1.12.0 ## [79] knitr_1.46 bookdown_0.39 ## [81] xfun_0.43 yaml_2.3.8 ## [83] evaluate_0.23 codetools_0.2-19 ## [85] spatialEco_2.0-2 tibble_3.2.1 ## [87] BiocManager_1.30.22 cli_3.6.2 ## [89] xtable_1.8-4 systemfonts_1.0.6 ## [91] munsell_0.5.1 jquerylib_0.1.4 ## [93] Rcpp_1.0.12 png_0.1-8 ## [95] parallel_4.3.3 pkgdown_2.0.9 ## [97] blob_1.2.4 sparseMatrixStats_1.14.0 ## [99] bitops_1.0-7 viridisLite_0.4.2 ## [101] scales_1.3.0 purrr_1.0.2 ## [103] crayon_1.5.2 rlang_1.1.3 ## [105] cowplot_1.1.3 KEGGREST_1.42.0"},{"path":"https://mictott.github.io/SpotSweeper/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Michael Totty. Author, maintainer. Boyi Guo. Author.","code":""},{"path":"https://mictott.github.io/SpotSweeper/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"MicTott (2024). SpotSweeper: Spot artifact-level quality control spatially-resolved transcriptomics data. doi:10.18129/B9.bioc.SpotSweeper, https://github.com/MicTott/SpotSweeper/SpotSweeper - R package version 0.99.5, http://www.bioconductor.org/packages/SpotSweeper. MicTott (2024). “SpotSweeper: Spot artifact-level quality control spatially-resolved transcriptomics data.” bioRxiv. doi:10.1101/TODO, https://www.biorxiv.org/content/10.1101/TODO.","code":"@Manual{, title = {SpotSweeper: Spot and artifact-level quality control for spatially-resolved transcriptomics data}, author = {{MicTott}}, year = {2024}, url = {http://www.bioconductor.org/packages/SpotSweeper}, note = {https://github.com/MicTott/SpotSweeper/SpotSweeper - R package version 0.99.5}, doi = {10.18129/B9.bioc.SpotSweeper}, } @Article{, title = {SpotSweeper: Spot and artifact-level quality control for spatially-resolved transcriptomics data}, author = {{MicTott}}, year = {2024}, journal = {bioRxiv}, doi = {10.1101/TODO}, url = {https://www.biorxiv.org/content/10.1101/TODO}, }"},{"path":"https://mictott.github.io/SpotSweeper/index.html","id":"spotsweeper","dir":"","previous_headings":"","what":"Spatially-aware quality control for spatial transcriptomics","title":"Spatially-aware quality control for spatial transcriptomics","text":"SpotSweeper package developed spatially-aware quality control (QC) methods detection, visualization, removal local outliers large artifacts spot-based spatial transcriptomics data, 10x Genomics Visium, using standard QC metrics. package currently development yet available Bioconductor. package currently experimental stage development. experience issues user package, please open issue GitHub repository. find information, please visit documentation website.","code":""},{"path":"https://mictott.github.io/SpotSweeper/index.html","id":"installation-instructions","dir":"","previous_headings":"","what":"Installation instructions","title":"Spatially-aware quality control for spatial transcriptomics","text":"can install latest version SpotSweeper Bioconductor following code: latest development version can installed GitHub using following:","code":"if (!requireNamespace(\"BiocManager\", quietly = TRUE)) { install.packages(\"BiocManager\") } BiocManager::install(\"SpotSweeper\") if (!require(\"devtools\")) install.packages(\"devtools\") remotes::install_github(\"MicTott/SpotSweeper\")"},{"path":"https://mictott.github.io/SpotSweeper/index.html","id":"input-data-format","dir":"","previous_headings":"","what":"Input data format","title":"Spatially-aware quality control for spatial transcriptomics","text":"examples , assume input data provided SpatialExperiment (SPE) object. outputs spot-level outliers artifacts stored colData SPE object.","code":""},{"path":"https://mictott.github.io/SpotSweeper/index.html","id":"tutorials","dir":"","previous_headings":"","what":"Tutorials","title":"Spatially-aware quality control for spatial transcriptomics","text":"detailed tutorial available package vignette Bioconductor. direct link tutorial / package vignette available .","code":""},{"path":"https://mictott.github.io/SpotSweeper/index.html","id":"development-tools","dir":"","previous_headings":"","what":"Development tools","title":"Spatially-aware quality control for spatial transcriptomics","text":"Continuous code testing possible thanks GitHub actions BiocStyle::Biocpkg('biocthis'). documentation website automatically updated thanks BiocStyle::CRANpkg('pkgdown'). code styled automatically thanks BiocStyle::CRANpkg('styler'). documentation formatted thanks BiocStyle::CRANpkg('devtools') BiocStyle::CRANpkg('roxygen2'). package developed using BiocStyle::Biocpkg('biocthis').","code":""},{"path":"https://mictott.github.io/SpotSweeper/reference/DLPFC_artifact.html","id":null,"dir":"Reference","previous_headings":"","what":"human DLPFC dataset with a technical artifact (hangnail). — DLPFC_artifact","title":"human DLPFC dataset with a technical artifact (hangnail). — DLPFC_artifact","text":"DLPFC_artifact dataset SpatialExperiment object containing single-sample subset human dorsolateral prefrontal cortex (DLPFC) dataset Hukki-Myers et al. 2023. particular sample ('Br2743_ant') included demonstrate identification removal technical artifacts within spatial transcriptomics data. dataset serves example artifact detection using 'SpotSweeper' workflow.","code":""},{"path":"https://mictott.github.io/SpotSweeper/reference/DLPFC_artifact.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"human DLPFC dataset with a technical artifact (hangnail). — DLPFC_artifact","text":"","code":"data(DLPFC_artifact)"},{"path":"https://mictott.github.io/SpotSweeper/reference/DLPFC_artifact.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"human DLPFC dataset with a technical artifact (hangnail). — DLPFC_artifact","text":"SpatialExperiment object.","code":""},{"path":"https://mictott.github.io/SpotSweeper/reference/DLPFC_artifact.html","id":"source","dir":"Reference","previous_headings":"","what":"Source","title":"human DLPFC dataset with a technical artifact (hangnail). — DLPFC_artifact","text":"spatialLIBD","code":""},{"path":"https://mictott.github.io/SpotSweeper/reference/DLPFC_artifact.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"human DLPFC dataset with a technical artifact (hangnail). — DLPFC_artifact","text":"Hukki-Myers et al. (2023) bioRxiv (bioRxiv)","code":""},{"path":"https://mictott.github.io/SpotSweeper/reference/DLPFC_artifact.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"human DLPFC dataset with a technical artifact (hangnail). — DLPFC_artifact","text":"","code":"data(DLPFC_artifact)"},{"path":"https://mictott.github.io/SpotSweeper/reference/findArtifacts.html","id":null,"dir":"Reference","previous_headings":"","what":"Identify and annotate artifacts in spatial transcriptomics data — findArtifacts","title":"Identify and annotate artifacts in spatial transcriptomics data — findArtifacts","text":"function identifies annotates potential artifacts spatial transcriptomics data. Artifacts detected based local mito variance, results added original SpatialExperiment (sce) object.","code":""},{"path":"https://mictott.github.io/SpotSweeper/reference/findArtifacts.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Identify and annotate artifacts in spatial transcriptomics data — findArtifacts","text":"","code":"findArtifacts( spe, mito_percent = \"expr_chrM_ratio\", mito_sum = \"expr_chrM\", samples = \"sample_id\", n_rings = 5, log = TRUE, name = \"artifact\", var_output = TRUE )"},{"path":"https://mictott.github.io/SpotSweeper/reference/findArtifacts.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Identify and annotate artifacts in spatial transcriptomics data — findArtifacts","text":"spe SingleCellExperiment object. mito_percent column name representing mitochondrial percent. Default 'expr_chrM_ratio'. mito_sum column name representing sum mitochondrial expression. Default 'expr_chrM'. samples column name representing sample IDs. Default 'sample_id'. n_rings number rings local mito variance calculation. Default 5. log Logical, indicating whether log1p transform mito_percent. Default TRUE. name Prefix local variance column names. Default 'artifact'. var_output Logical, indicating whether include local variances output. Default TRUE.","code":""},{"path":"https://mictott.github.io/SpotSweeper/reference/findArtifacts.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Identify and annotate artifacts in spatial transcriptomics data — findArtifacts","text":"Returns modified SingleCellExperiment object artifact annotations.","code":""},{"path":[]},{"path":"https://mictott.github.io/SpotSweeper/reference/findArtifacts.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Identify and annotate artifacts in spatial transcriptomics data — findArtifacts","text":"","code":"library(SpotSweeper) library(SpatialExperiment) #> Loading required package: SingleCellExperiment #> Loading required package: SummarizedExperiment #> Loading required package: MatrixGenerics #> Loading required package: matrixStats #> #> Attaching package: ‘MatrixGenerics’ #> The following objects are masked from ‘package:matrixStats’: #> #> colAlls, colAnyNAs, colAnys, colAvgsPerRowSet, colCollapse, #> colCounts, colCummaxs, colCummins, colCumprods, colCumsums, #> colDiffs, colIQRDiffs, colIQRs, colLogSumExps, colMadDiffs, #> colMads, colMaxs, colMeans2, colMedians, colMins, colOrderStats, #> colProds, colQuantiles, colRanges, colRanks, colSdDiffs, colSds, #> colSums2, colTabulates, colVarDiffs, colVars, colWeightedMads, #> colWeightedMeans, colWeightedMedians, colWeightedSds, #> colWeightedVars, rowAlls, rowAnyNAs, rowAnys, rowAvgsPerColSet, #> rowCollapse, rowCounts, rowCummaxs, rowCummins, rowCumprods, #> rowCumsums, rowDiffs, rowIQRDiffs, rowIQRs, rowLogSumExps, #> rowMadDiffs, rowMads, rowMaxs, rowMeans2, rowMedians, rowMins, #> rowOrderStats, rowProds, rowQuantiles, rowRanges, rowRanks, #> rowSdDiffs, rowSds, rowSums2, rowTabulates, rowVarDiffs, rowVars, #> rowWeightedMads, rowWeightedMeans, rowWeightedMedians, #> rowWeightedSds, rowWeightedVars #> Loading required package: GenomicRanges #> Loading required package: stats4 #> Loading required package: BiocGenerics #> #> Attaching package: ‘BiocGenerics’ #> The following objects are masked from ‘package:stats’: #> #> IQR, mad, sd, var, xtabs #> The following objects are masked from ‘package:base’: #> #> Filter, Find, Map, Position, Reduce, anyDuplicated, aperm, append, #> as.data.frame, basename, cbind, colnames, dirname, do.call, #> duplicated, eval, evalq, get, grep, grepl, intersect, is.unsorted, #> lapply, mapply, match, mget, order, paste, pmax, pmax.int, pmin, #> pmin.int, rank, rbind, rownames, sapply, setdiff, sort, table, #> tapply, union, unique, unsplit, which.max, which.min #> Loading required package: S4Vectors #> #> Attaching package: ‘S4Vectors’ #> The following object is masked from ‘package:utils’: #> #> findMatches #> The following objects are masked from ‘package:base’: #> #> I, expand.grid, unname #> Loading required package: IRanges #> Loading required package: GenomeInfoDb #> Loading required package: Biobase #> Welcome to Bioconductor #> #> Vignettes contain introductory material; view with #> 'browseVignettes()'. To cite Bioconductor, see #> 'citation(\"Biobase\")', and for packages 'citation(\"pkgname\")'. #> #> Attaching package: ‘Biobase’ #> The following object is masked from ‘package:MatrixGenerics’: #> #> rowMedians #> The following objects are masked from ‘package:matrixStats’: #> #> anyMissing, rowMedians library(escheR) #> Loading required package: ggplot2 data(DLPFC_artifact) spe <- DLPFC_artifact # find artifacts spe <- findArtifacts(spe, mito_percent = \"expr_chrM_ratio\", mito_sum = \"expr_chrM\", n_rings = 2, # 5 recommended, using 1 for time name = \"artifact\" )"},{"path":"https://mictott.github.io/SpotSweeper/reference/localOutliers.html","id":null,"dir":"Reference","previous_headings":"","what":"localOutliers Function — localOutliers","title":"localOutliers Function — localOutliers","text":"function detects local outliers spatial transcriptomics data based standard quality control metrics, library size, unique genes, mitochondrial ratio. Local outliers defined spots low/high quality metrics compared surrounding neighbors, based modified z-score statistic.","code":""},{"path":"https://mictott.github.io/SpotSweeper/reference/localOutliers.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"localOutliers Function — localOutliers","text":"","code":"localOutliers( spe, metric = \"detected\", direction = \"lower\", n_neighbors = 36, samples = \"sample_id\", log = TRUE, cutoff = 3 )"},{"path":"https://mictott.github.io/SpotSweeper/reference/localOutliers.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"localOutliers Function — localOutliers","text":"spe SpatialExperiment object metric colData QC metric use outlier detection direction Direction outlier detection (higher, lower, ) n_neighbors Number nearest neighbors use outlier detection samples Column name colData use sample IDs log Logical indicating whether log1p transform features (default TRUE) cutoff Cutoff outlier detection (default 3)","code":""},{"path":"https://mictott.github.io/SpotSweeper/reference/localOutliers.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"localOutliers Function — localOutliers","text":"SpatialExperiment object updated colData containing outputs","code":""},{"path":"https://mictott.github.io/SpotSweeper/reference/localOutliers.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"localOutliers Function — localOutliers","text":"","code":"library(SpotSweeper) library(SpatialExperiment) # load example data spe <- STexampleData::Visium_humanDLPFC() #> see ?STexampleData and browseVignettes('STexampleData') for documentation #> downloading 1 resources #> retrieving 1 resource #> loading from cache # change from gene id to gene names rownames(spe) <- rowData(spe)$gene_name # drop out-of-tissue spots spe <- spe[, spe$in_tissue == 1] spe <- spe[, !is.na(spe$ground_truth)] # Identifying the mitochondrial transcripts in our SpatialExperiment. is.mito <- rownames(spe)[grepl(\"^MT-\", rownames(spe))] # Calculating QC metrics for each spot using scuttle spe <- scuttle::addPerCellQCMetrics(spe, subsets = list(Mito = is.mito)) colnames(colData(spe)) #> [1] \"barcode_id\" \"sample_id\" \"in_tissue\" #> [4] \"array_row\" \"array_col\" \"ground_truth\" #> [7] \"cell_count\" \"sum\" \"detected\" #> [10] \"subsets_Mito_sum\" \"subsets_Mito_detected\" \"subsets_Mito_percent\" #> [13] \"total\" # Identifying local outliers using SpotSweeper spe <- localOutliers(spe, metric = \"sum\", direction = \"lower\", log = TRUE )"},{"path":"https://mictott.github.io/SpotSweeper/reference/localVariance.html","id":null,"dir":"Reference","previous_headings":"","what":"localVariance Function — localVariance","title":"localVariance Function — localVariance","text":"function calculates local variance based kNN.","code":""},{"path":"https://mictott.github.io/SpotSweeper/reference/localVariance.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"localVariance Function — localVariance","text":"","code":"localVariance( spe, n_neighbors = 36, metric = c(\"expr_chrM_ratio\"), samples = \"sample_id\", log = FALSE, name = NULL )"},{"path":"https://mictott.github.io/SpotSweeper/reference/localVariance.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"localVariance Function — localVariance","text":"spe SpatialExperiment object following columns colData: sample_id, sum_umi, sum_gene n_neighbors Number nearest neighbors use variance calculation metric metric use variance calculation samples Column colData use sample ID log Whether log1p transform metric name Name new column add colData","code":""},{"path":"https://mictott.github.io/SpotSweeper/reference/localVariance.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"localVariance Function — localVariance","text":"SpatialExperiment object metric variance added colData","code":""},{"path":"https://mictott.github.io/SpotSweeper/reference/localVariance.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"localVariance Function — localVariance","text":"","code":"# for more details see extended example in vignettes library(SpotSweeper) library(SpatialExperiment) library(escheR) # load example data spe <- STexampleData::Visium_humanDLPFC() #> see ?STexampleData and browseVignettes('STexampleData') for documentation #> loading from cache # change from gene id to gene names rownames(spe) <- rowData(spe)$gene_name # show column data before SpotSweepR colnames(colData(spe)) #> [1] \"barcode_id\" \"sample_id\" \"in_tissue\" \"array_row\" \"array_col\" #> [6] \"ground_truth\" \"cell_count\" # drop out-of-tissue spots spe <- spe[, spe$in_tissue == 1] spe <- spe[, !is.na(spe$ground_truth)] # Identifying the mitochondrial transcripts in our SpatialExperiment. is.mito <- rownames(spe)[grepl(\"^MT-\", rownames(spe))] # Calculating QC metric for each spot using scuttle spe <- scuttle::addPerCellQCMetrics(spe, subsets = list(Mito = is.mito)) colnames(colData(spe)) #> [1] \"barcode_id\" \"sample_id\" \"in_tissue\" #> [4] \"array_row\" \"array_col\" \"ground_truth\" #> [7] \"cell_count\" \"sum\" \"detected\" #> [10] \"subsets_Mito_sum\" \"subsets_Mito_detected\" \"subsets_Mito_percent\" #> [13] \"total\" spe <- localVariance(spe, metric = \"subsets_Mito_percent\", n_neighbors = 36, name = \"local_mito_variance_k36\" ) plotQC(spe, metric=\"local_mito_variance_k36\")"},{"path":"https://mictott.github.io/SpotSweeper/reference/plotQC.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot QC metrics for a Single Sample in a SpatialExperiment object — plotQC","title":"Plot QC metrics for a Single Sample in a SpatialExperiment object — plotQC","text":"function generates plot specified sample within SpatialExperiment object, highlighting outliers based specified metric. plot visualizes metric interest indicates outliers distinct color.","code":""},{"path":"https://mictott.github.io/SpotSweeper/reference/plotQC.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot QC metrics for a Single Sample in a SpatialExperiment object — plotQC","text":"","code":"plotQC( spe, sample_id = \"sample_id\", sample = unique(spe$sample_id)[1], metric = \"detected\", outliers = NULL, point_size = 2, colors = c(\"white\", \"black\"), stroke = 1 )"},{"path":"https://mictott.github.io/SpotSweeper/reference/plotQC.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot QC metrics for a Single Sample in a SpatialExperiment object — plotQC","text":"spe SpatialExperiment object containing data plotted. sample_id character string specifying column name colData(spe) contains unique sample identifiers. Default \"sample_id\". sample character string numeric value specifying sample plotted. default, plots first unique sample found spe$sample_id. metric character string specifying metric visualized plot. metric column name colData(spe). outliers character string specifying column name colData(spe) indicates whether data point considered outlier. Default NULL. point_size numeric value specifying size points plot. Default 2. colors character vector specifying colors used gradient scale. length 2, gradient single color gradient. stroke numeric value specifying border thickness outlier points. Default 1.","code":""},{"path":"https://mictott.github.io/SpotSweeper/reference/plotQC.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot QC metrics for a Single Sample in a SpatialExperiment object — plotQC","text":"function returns plot object created make_escheR modified additional layers visualizing specified metric outliers. plot explicitly printed function printed caller.","code":""},{"path":"https://mictott.github.io/SpotSweeper/reference/plotQC.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Plot QC metrics for a Single Sample in a SpatialExperiment object — plotQC","text":"","code":"library(SpotSweeper) library(SpatialExperiment) library(escheR) # load example data spe <- STexampleData::Visium_humanDLPFC() #> see ?STexampleData and browseVignettes('STexampleData') for documentation #> loading from cache # change from gene id to gene names rownames(spe) <- rowData(spe)$gene_name # drop out-of-tissue spots spe <- spe[, spe$in_tissue == 1] spe <- spe[, !is.na(spe$ground_truth)] # Identifying the mitochondrial transcripts in our SpatialExperiment. is.mito <- rownames(spe)[grepl(\"^MT-\", rownames(spe))] # Calculating QC metrics for each spot using scuttle spe <- scuttle::addPerCellQCMetrics(spe, subsets = list(Mito = is.mito)) colnames(colData(spe)) #> [1] \"barcode_id\" \"sample_id\" \"in_tissue\" #> [4] \"array_row\" \"array_col\" \"ground_truth\" #> [7] \"cell_count\" \"sum\" \"detected\" #> [10] \"subsets_Mito_sum\" \"subsets_Mito_detected\" \"subsets_Mito_percent\" #> [13] \"total\" # Identifying local outliers using SpotSweeper spe <- localOutliers(spe, metric = \"sum\", direction = \"lower\", log = TRUE ) plotQC(spe, metric=\"sum\", outliers=\"sum_outliers\")"},{"path":"https://mictott.github.io/SpotSweeper/reference/plotQCpdf.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot Outlier Metrics to PDF — plotQCpdf","title":"Plot Outlier Metrics to PDF — plotQCpdf","text":"function generates PDF file containing plots sample SpatialExperiment object, highlighting outliers based specified metrics. plot visualizes outlier metrics single sample, allowing easy comparison analysis across samples.","code":""},{"path":"https://mictott.github.io/SpotSweeper/reference/plotQCpdf.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot Outlier Metrics to PDF — plotQCpdf","text":"","code":"plotQCpdf( spe, sample_id = \"sample_id\", metric = \"detected\", outliers = \"local_outliers\", colors = c(\"white\", \"black\"), stroke = 1, point_size = 2, width = 5, height = 5, fname )"},{"path":"https://mictott.github.io/SpotSweeper/reference/plotQCpdf.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot Outlier Metrics to PDF — plotQCpdf","text":"spe SpatialExperiment object containing data plotted. sample_id character string specifying column name colData(spe) contains unique sample identifiers. Default 'sample_id'. metric character string specifying metric visualized plot. metric column name colData(spe). outliers character string specifying column name colData(spe) indicates whether data point considered outlier. Default local_outliers'. colors character vector specifying colors used gradient scale. length 2, gradient single color gradient stroke numeric value specifying border thickness outlier points. Default 1. point_size numeric value specifying size points plot. Default 2. width numeric value indicating width plot. Default 5. height numeric value indicating height plot. Default 5. fname character string specifying path name output PDF file.","code":""},{"path":"https://mictott.github.io/SpotSweeper/reference/plotQCpdf.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot Outlier Metrics to PDF — plotQCpdf","text":"ggplot object specified. Generates plot otherwise.","code":""},{"path":"https://mictott.github.io/SpotSweeper/reference/plotQCpdf.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Plot Outlier Metrics to PDF — plotQCpdf","text":"","code":"library(SpotSweeper) library(SpatialExperiment) library(escheR) # load example data spe <- STexampleData::Visium_humanDLPFC() #> see ?STexampleData and browseVignettes('STexampleData') for documentation #> loading from cache tempFilePath <- file.path(tempdir(), \"examplePlot.pdf\") # change from gene id to gene names rownames(spe) <- rowData(spe)$gene_name # drop out-of-tissue spots spe <- spe[, spe$in_tissue == 1] spe <- spe[, !is.na(spe$ground_truth)] # Identifying the mitochondrial transcripts in our SpatialExperiment. is.mito <- rownames(spe)[grepl(\"^MT-\", rownames(spe))] # Calculating QC metrics for each spot using scuttle spe <- scuttle::addPerCellQCMetrics(spe, subsets = list(Mito = is.mito)) colnames(colData(spe)) #> [1] \"barcode_id\" \"sample_id\" \"in_tissue\" #> [4] \"array_row\" \"array_col\" \"ground_truth\" #> [7] \"cell_count\" \"sum\" \"detected\" #> [10] \"subsets_Mito_sum\" \"subsets_Mito_detected\" \"subsets_Mito_percent\" #> [13] \"total\" # Identifying local outliers using SpotSweeper spe <- localOutliers(spe, metric = \"sum\", direction = \"lower\", log = TRUE ) plotQCpdf(spe, metric=\"sum\", outliers=\"sum_outliers\", fname=tempFilePath) #> agg_png #> 2"},{"path":"https://mictott.github.io/SpotSweeper/news/index.html","id":"spotsweeper-0991","dir":"Changelog","previous_headings":"","what":"SpotSweeper 0.99.1","title":"SpotSweeper 0.99.1","text":"Added NEWS.md file track changes package. First full version package submitted Bioconductor. See Bioconductor submission .","code":""}]