├── .Rbuildignore ├── .dockerignore ├── .gitattributes ├── .github ├── CODE_OF_CONDUCT.md ├── ISSUE_TEMPLATE │ ├── --documentation.md │ ├── bug_report.md │ └── feature-request.md └── workflows │ └── cmd-check.yml ├── .gitignore ├── CONTRIBUTING.md ├── DESCRIPTION ├── Dockerfile ├── LICENSE ├── LICENSE.md ├── NAMESPACE ├── NEWS.md ├── R ├── RcppExports.R ├── data.R ├── differential_accessibility.R ├── dimension_reduction.R ├── footprinting.R ├── fragments.R ├── generics.R ├── genomeinfodb-methods.R ├── granges-methods.R ├── heatmaps.R ├── iranges-methods.R ├── links.R ├── mito.R ├── motifs.R ├── objects.R ├── peaks.R ├── preprocessing.R ├── quantification.R ├── region-enrichment.R ├── utilities.R ├── visualization.R └── zzz.R ├── README.md ├── _pkgdown.yml ├── data ├── atac_small.rda ├── blacklist_ce10.rda ├── blacklist_ce11.rda ├── blacklist_dm3.rda ├── blacklist_dm6.rda ├── blacklist_hg19.rda ├── blacklist_hg38.rda ├── blacklist_hg38_unified.rda └── blacklist_mm10.rda ├── index.md ├── inst ├── CITATION └── extdata │ ├── fragments.tsv.gz │ ├── fragments.tsv.gz.tbi │ ├── fragments_header.tsv.gz │ ├── fragments_header.tsv.gz.tbi │ └── test_mgatk │ ├── chrM_refAllele.txt.gz │ ├── test.A.txt.gz │ ├── test.C.txt.gz │ ├── test.G.txt.gz │ ├── test.T.txt.gz │ └── test.depthTable.txt ├── man ├── AccessiblePeaks.Rd ├── AddChromatinModule.Rd ├── AddMotifs.Rd ├── AggregateTiles.Rd ├── AlleleFreq.Rd ├── Annotation.Rd ├── AnnotationPlot.Rd ├── AverageCounts.Rd ├── BigwigTrack.Rd ├── BinarizeCounts.Rd ├── CallPeaks.Rd ├── Cells-set.Rd ├── Cells.Rd ├── CellsPerGroup.Rd ├── ChromatinAssay-class.Rd ├── ClosestFeature.Rd ├── ClusterClonotypes.Rd ├── CombineTracks.Rd ├── ConnectionsToLinks.Rd ├── ConvertMotifID.Rd ├── CountFragments.Rd ├── CountsInRegion.Rd ├── CoverageBrowser.Rd ├── CoveragePlot.Rd ├── CreateChromatinAssay.Rd ├── CreateFragmentObject.Rd ├── CreateMotifMatrix.Rd ├── CreateMotifObject.Rd ├── DensityScatter.Rd ├── DepthCor.Rd ├── DownsampleFeatures.Rd ├── ExpressionPlot.Rd ├── Extend.Rd ├── FRiP.Rd ├── FeatureMatrix.Rd ├── FilterCells.Rd ├── FindClonotypes.Rd ├── FindMotifs.Rd ├── FindTopFeatures.Rd ├── Footprint.Rd ├── FractionCountsInRegion.Rd ├── Fragment-class.Rd ├── FragmentHistogram.Rd ├── Fragments.Rd ├── GRangesToString.Rd ├── GeneActivity.Rd ├── GenomeBinMatrix.Rd ├── GetCellsInRegion.Rd ├── GetFootprintData.Rd ├── GetFragmentData.Rd ├── GetGRangesFromEnsDb.Rd ├── GetIntersectingFeatures.Rd ├── GetLinkedGenes.Rd ├── GetLinkedPeaks.Rd ├── GetMotifData.Rd ├── GetTSSPositions.Rd ├── IdentifyVariants.Rd ├── InsertionBias.Rd ├── IntersectMatrix.Rd ├── Jaccard.Rd ├── LinkPeaks.Rd ├── LinkPlot.Rd ├── Links.Rd ├── LookupGeneCoords.Rd ├── MatchRegionStats.Rd ├── Motif-class.Rd ├── MotifCounts.Rd ├── MotifPlot.Rd ├── Motifs.Rd ├── NucleosomeSignal.Rd ├── PeakPlot.Rd ├── PlotFootprint.Rd ├── ReadMGATK.Rd ├── RegionHeatmap.Rd ├── RegionMatrix.Rd ├── RegionPlot.Rd ├── RegionStats.Rd ├── RunChromVAR.Rd ├── RunSVD.Rd ├── RunTFIDF.Rd ├── SetMotifData.Rd ├── Signac-package.Rd ├── SortIdents.Rd ├── SplitFragments.Rd ├── StringToGRanges.Rd ├── SubsetMatrix.Rd ├── TSSEnrichment.Rd ├── TSSPlot.Rd ├── TilePlot.Rd ├── UnifyPeaks.Rd ├── UpdatePath.Rd ├── ValidateCells.Rd ├── ValidateFragments.Rd ├── ValidateHash.Rd ├── VariantPlot.Rd ├── as.ChromatinAssay.Rd ├── atac_small.Rd ├── blacklist_ce10.Rd ├── blacklist_ce11.Rd ├── blacklist_dm3.Rd ├── blacklist_dm6.Rd ├── blacklist_hg19.Rd ├── blacklist_hg38.Rd ├── blacklist_hg38_unified.Rd ├── blacklist_mm10.Rd ├── corSparse.Rd ├── coverage-ChromatinAssay-method.Rd ├── figures │ ├── icon.png │ ├── icon.svg │ ├── icon_grey.png │ ├── icon_grey.svg │ ├── logo.png │ └── logo.svg ├── findOverlaps-methods.Rd ├── granges-methods.Rd ├── head.Fragment.Rd ├── inter-range-methods.Rd ├── nearest-methods.Rd ├── reexports.Rd ├── seqinfo-methods.Rd ├── subset.Fragment.Rd ├── subset.Motif.Rd └── theme_browser.Rd ├── pkgdown ├── extra.css └── favicon │ ├── android-chrome-192x192.png │ ├── android-chrome-512x512.png │ ├── apple-touch-icon.png │ ├── browserconfig.xml │ ├── favicon-16x16.png │ ├── favicon-32x32.png │ ├── favicon.ico │ ├── mstile-150x150.png │ ├── safari-pinned-tab.svg │ └── site.webmanifest ├── src ├── Makevars ├── RcppExports.cpp ├── filter.cpp ├── group.cpp ├── group.h ├── split.cpp └── validate.cpp ├── tests ├── testdata │ └── featurematrix.rds ├── testthat.R └── testthat │ ├── test-dimreduc.R │ ├── test-mito.R │ ├── test-preprocessing.R │ ├── test-utilities.R │ └── test_fragments.R └── vignettes ├── archive.Rmd ├── assets ├── cicero.png ├── footprint.png ├── integration.png ├── merge.png ├── merging.png ├── mito.png ├── monocle.png ├── motifs.png ├── mouse.png ├── multiomic.png ├── pbmc.png ├── peaks.png ├── snareseq.png └── viz.png ├── cicero.Rmd ├── data_structures.Rmd ├── faq.Rmd ├── footprint.Rmd ├── future.Rmd ├── install.Rmd ├── integrate_atac.Rmd ├── merging.Rmd ├── mito.Rmd ├── monocle.Rmd ├── motif_vignette.Rmd ├── mouse_brain_vignette.Rmd ├── overview.Rmd ├── pbmc_multiomic.Rmd ├── pbmc_vignette.Rmd ├── peak_calling.Rmd ├── snareseq.Rmd └── visualization.Rmd /.Rbuildignore: -------------------------------------------------------------------------------- 1 | ^chrom\.Rproj$ 2 | ^signac\.Rproj$ 3 | ^\.Rproj\.user$ 4 | ^LICENSE\.md$ 5 | .travis.yml 6 | appveyor.yml 7 | vignettes/ 8 | vignette_data/ 9 | _pkgdown.yml 10 | pkgdown/ 11 | index.Rmd 12 | bldignore/ 13 | docs/ 14 | azure-pipelines.yml 15 | cran-comments.md 16 | index.* 17 | .github/ 18 | Dockerfile 19 | ^CRAN-RELEASE$ 20 | benchmark/ 21 | .dockerignore 22 | CONTRIBUTING.md 23 | .ipynb_checkpoints/ 24 | build.sh 25 | ^.*\\.err$ 26 | ^.*\\.out$ 27 | -------------------------------------------------------------------------------- /.dockerignore: -------------------------------------------------------------------------------- 1 | * 2 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | data/* binary 3 | src/* text=lf 4 | R/* text=lf 5 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/--documentation.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: "\U0001F4DADocumentation" 3 | about: An issue related to Signac documentation 4 | title: '' 5 | labels: documentation 6 | assignees: '' 7 | 8 | --- 9 | 10 | 11 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: "\U0001F41BBug report" 3 | about: Describe a bug you've seen with a reproducible example 4 | title: '' 5 | labels: bug 6 | assignees: '' 7 | 8 | --- 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | ```r 19 | # insert reproducible example here 20 | ``` 21 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature-request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: "\U0001F680Feature request" 3 | about: Request a new feature 4 | title: '' 5 | labels: enhancement 6 | assignees: '' 7 | 8 | --- 9 | 10 | 11 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .Rproj.user 2 | .Rhistory 3 | .RData 4 | .RDataTmp 5 | src/*.o 6 | src/*.so 7 | .DS_Store 8 | *.pdf 9 | *.Rproj 10 | testcode/* 11 | *.old 12 | *.tar.gz 13 | Signac.Rcheck/* 14 | bldignore/* 15 | docs/* 16 | index.md 17 | vignette_data/* 18 | cran-comments.md 19 | vignettes/*_cache/* 20 | benchmark/* 21 | .ipynb_checkpoints 22 | *.err 23 | *.out 24 | build.sh 25 | *.ipynb 26 | -------------------------------------------------------------------------------- /DESCRIPTION: -------------------------------------------------------------------------------- 1 | Package: Signac 2 | Title: Analysis of Single-Cell Chromatin Data 3 | Version: 1.14.0 4 | Date: 2024-08-21 5 | Authors@R: c( 6 | person(given = 'Tim', family = 'Stuart', email = 'stuartt@gis.a-star.edu.sg', role = c('aut', 'cre'), comment = c(ORCID = '0000-0002-3044-0897')), 7 | person(given = 'Avi', family = 'Srivastava', email = 'asrivastava@nygenome.org', role = 'aut', comment = c(ORCID = '0000-0001-9798-2079')), 8 | person(given = 'Paul', family = 'Hoffman', email = 'phoffman@nygenome.org', role = 'ctb', comment = c(ORCID = '0000-0002-7693-8957')), 9 | person(given = 'Rahul', family = 'Satija', email = 'rsatija@nygenome.org', role = 'ctb', comment = c(ORCID = '0000-0001-9448-8833')) 10 | ) 11 | Description: A framework for the analysis and exploration of single-cell chromatin data. 12 | The 'Signac' package contains functions for quantifying single-cell chromatin data, 13 | computing per-cell quality control metrics, dimension reduction 14 | and normalization, visualization, and DNA sequence motif analysis. 15 | Reference: Stuart et al. (2021) . 16 | Depends: 17 | R (>= 4.1.0), 18 | methods 19 | License: MIT + file LICENSE 20 | Encoding: UTF-8 21 | LazyData: true 22 | RoxygenNote: 7.3.2 23 | URL: https://github.com/stuart-lab/signac, https://stuartlab.org/signac 24 | BugReports: https://github.com/stuart-lab/signac/issues 25 | LinkingTo: Rcpp 26 | Imports: 27 | GenomeInfoDb (>= 1.29.3), 28 | GenomicRanges, 29 | IRanges, 30 | Matrix, 31 | Rsamtools, 32 | S4Vectors, 33 | SeuratObject (>= 5.0.2), 34 | data.table, 35 | dplyr (>= 1.0.0), 36 | future, 37 | future.apply, 38 | ggplot2, 39 | rlang, 40 | irlba, 41 | pbapply, 42 | tidyr, 43 | patchwork, 44 | stats, 45 | utils, 46 | BiocGenerics, 47 | stringi, 48 | fastmatch, 49 | RcppRoll, 50 | scales, 51 | Rcpp, 52 | grid, 53 | tidyselect, 54 | vctrs, 55 | lifecycle 56 | Collate: 57 | 'RcppExports.R' 58 | 'data.R' 59 | 'differential_accessibility.R' 60 | 'generics.R' 61 | 'dimension_reduction.R' 62 | 'footprinting.R' 63 | 'fragments.R' 64 | 'genomeinfodb-methods.R' 65 | 'granges-methods.R' 66 | 'heatmaps.R' 67 | 'iranges-methods.R' 68 | 'links.R' 69 | 'mito.R' 70 | 'motifs.R' 71 | 'objects.R' 72 | 'peaks.R' 73 | 'preprocessing.R' 74 | 'quantification.R' 75 | 'region-enrichment.R' 76 | 'utilities.R' 77 | 'visualization.R' 78 | 'zzz.R' 79 | Suggests: 80 | Seurat (>= 5.0.2), 81 | ggforce, 82 | ggrepel, 83 | ggseqlogo, 84 | testthat (>= 2.1.0), 85 | chromVAR, 86 | SummarizedExperiment, 87 | TFBSTools, 88 | motifmatchr, 89 | BSgenome, 90 | shiny, 91 | miniUI, 92 | rtracklayer, 93 | biovizBase, 94 | Biostrings, 95 | lsa, 96 | MASS 97 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM satijalab/seurat:5.0.0 2 | 3 | RUN apt-get update --fix-missing \ 4 | && apt-get install -y libbz2-dev liblzma-dev \ 5 | && R --slave --no-restore --no-save -e "options(repos=c(CRAN='https://cloud.r-project.org')); setRepositories(ind=1:3); install.packages('Signac', dependencies = TRUE)" 6 | 7 | CMD [ "R" ] 8 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | YEAR: 2021 2 | COPYRIGHT HOLDER: Tim Stuart 3 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | # MIT License 2 | 3 | Copyright (c) 2021 Tim Stuart 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /R/RcppExports.R: -------------------------------------------------------------------------------- 1 | # Generated by using Rcpp::compileAttributes() -> do not edit by hand 2 | # Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393 3 | 4 | filterCells <- function(fragments, outfile, keep_cells, buffer_length, verbose = TRUE) { 5 | .Call('_Signac_filterCells', PACKAGE = 'Signac', fragments, outfile, keep_cells, buffer_length, verbose) 6 | } 7 | 8 | groupCommand <- function(fragments, some_whitelist_cells = NULL, max_lines = 0L, verbose = TRUE) { 9 | .Call('_Signac_groupCommand', PACKAGE = 'Signac', fragments, some_whitelist_cells, max_lines, verbose) 10 | } 11 | 12 | splitFragments <- function(fragments, cells, idents, unique_idents, outdir, suffix, buffer_length, append = FALSE, verbose = TRUE) { 13 | .Call('_Signac_splitFragments', PACKAGE = 'Signac', fragments, cells, idents, unique_idents, outdir, suffix, buffer_length, append, verbose) 14 | } 15 | 16 | validateCells <- function(fragments, cells, find_n, max_lines = 0L, verbose = TRUE) { 17 | .Call('_Signac_validateCells', PACKAGE = 'Signac', fragments, cells, find_n, max_lines, verbose) 18 | } 19 | 20 | -------------------------------------------------------------------------------- /R/data.R: -------------------------------------------------------------------------------- 1 | #' A small example scATAC-seq dataset 2 | #' 3 | #' A subsetted version of 10x Genomics 10k human (hg19) PBMC scATAC-seq dataset 4 | #' 5 | #' @format A Seurat object with the following assays 6 | #' \describe{ 7 | #' \item{peaks}{A peak x cell dataset} 8 | #' \item{bins}{A 5 kb genome bin x cell dataset} 9 | #' \item{RNA}{A gene x cell dataset} 10 | #' } 11 | #' 12 | #' @concept data 13 | #' @source \url{https://support.10xgenomics.com/single-cell-atac/datasets/1.1.0/atac_v1_pbmc_10k} 14 | "atac_small" 15 | 16 | #' Genomic blacklist regions for Human GRCh38 17 | #' @concept data 18 | #' @format A GRanges object 19 | #' @source \url{https://github.com/Boyle-Lab/Blacklist} 20 | #' @source \doi{10.1038/s41598-019-45839-z} 21 | "blacklist_hg38" 22 | 23 | #' Unified genomic blacklist regions for Human GRCh38 24 | #' 25 | #' Manually curated genomic blacklist regions for the hg38 genome by Anshul 26 | #' Kundaje and Anna Shcherbina. See 27 | #' \url{https://www.encodeproject.org/files/ENCFF356LFX/} for a description of 28 | #' how this blacklist was curated. 29 | #' 30 | #' @concept data 31 | #' @author Anshul Kundaje 32 | #' @author Anna Shcherbina 33 | #' @format A GRanges object 34 | #' @source \url{https://www.encodeproject.org/files/ENCFF356LFX/} 35 | #' @source \doi{10.1038/s41598-019-45839-z} 36 | "blacklist_hg38_unified" 37 | 38 | #' Genomic blacklist regions for Human hg19 (0-based) 39 | #' @concept data 40 | #' @format A GRanges object 41 | #' @source \url{https://github.com/Boyle-Lab/Blacklist} 42 | #' @source \doi{10.1038/s41598-019-45839-z} 43 | "blacklist_hg19" 44 | 45 | #' Genomic blacklist regions for Mouse mm10 (0-based) 46 | #' @concept data 47 | #' @format A GRanges object 48 | #' @source \url{https://github.com/Boyle-Lab/Blacklist} 49 | #' @source \doi{10.1038/s41598-019-45839-z} 50 | "blacklist_mm10" 51 | 52 | #' Genomic blacklist regions for Drosophila dm3 (0-based) 53 | #' @concept data 54 | #' @format A GRanges object 55 | #' @source \url{https://github.com/Boyle-Lab/Blacklist} 56 | #' @source \doi{10.1038/s41598-019-45839-z} 57 | "blacklist_dm3" 58 | 59 | #' Genomic blacklist regions for Drosophila dm6 (0-based) 60 | #' @concept data 61 | #' @format A GRanges object 62 | #' @source \url{https://github.com/Boyle-Lab/Blacklist} 63 | #' @source \doi{10.1038/s41598-019-45839-z} 64 | "blacklist_dm6" 65 | 66 | #' Genomic blacklist regions for C. elegans ce10 (0-based) 67 | #' @concept data 68 | #' @format A GRanges object 69 | #' @source \url{https://github.com/Boyle-Lab/Blacklist} 70 | #' @source \doi{10.1038/s41598-019-45839-z} 71 | "blacklist_ce10" 72 | 73 | #' Genomic blacklist regions for C. elegans ce11 (0-based) 74 | #' @concept data 75 | #' @format A GRanges object 76 | #' @source \url{https://github.com/Boyle-Lab/Blacklist} 77 | #' @source \doi{10.1038/s41598-019-45839-z} 78 | "blacklist_ce11" 79 | -------------------------------------------------------------------------------- /R/differential_accessibility.R: -------------------------------------------------------------------------------- 1 | # dynamically exported, see zzz.R 2 | #' @method FoldChange ChromatinAssay 3 | #' @importFrom SeuratObject GetAssayData 4 | #' @importFrom Matrix rowMeans 5 | FoldChange.ChromatinAssay <- function( 6 | object, 7 | cells.1, 8 | cells.2, 9 | features = NULL, 10 | slot = "data", 11 | fc.name = NULL, 12 | mean.fxn = NULL, 13 | base = 2, 14 | ... 15 | ) { 16 | if (!requireNamespace(package = "Seurat", quietly = TRUE)) { 17 | stop("Please install Seurat: install.packages('Seurat')") 18 | } 19 | if (is.null(x = mean.fxn)) { 20 | mean.fxn <- function(x) { 21 | return(log(x = rowMeans(x = x) + 1/10000, base = base)) 22 | } 23 | } 24 | # Omit the decimal value of e from the column name if base == exp(1) 25 | base.text <- ifelse( 26 | test = base == exp(1), 27 | yes = "", 28 | no = base 29 | ) 30 | fc.name <- SetIfNull(x = fc.name, y = paste0("avg_log", base.text, "FC")) 31 | data <- GetAssayData(object = object, layer = slot) 32 | Seurat::FoldChange( 33 | object = data, 34 | cells.1 = cells.1, 35 | cells.2 = cells.2, 36 | features = features, 37 | mean.fxn = mean.fxn, 38 | fc.name = fc.name 39 | ) 40 | } 41 | -------------------------------------------------------------------------------- /R/granges-methods.R: -------------------------------------------------------------------------------- 1 | #' @include generics.R 2 | #' @importFrom SeuratObject DefaultAssay 3 | #' @importFrom GenomicRanges granges 4 | NULL 5 | 6 | #' Access genomic ranges for ChromatinAssay objects 7 | #' 8 | #' Methods for accessing \code{\link[GenomicRanges]{GRanges}} object 9 | #' information stored in a \code{\link{ChromatinAssay}} object. 10 | #' 11 | #' @name granges-methods 12 | #' @param x A \code{\link{ChromatinAssay}} object 13 | #' @param use.names Whether the names on the genomic ranges should be 14 | #' propagated to the returned object. 15 | #' @param use.mcols Not supported for \code{\link{ChromatinAssay}} objects 16 | #' @param ... Additional arguments 17 | #' 18 | #' @return Returns a \code{\link[GenomicRanges]{GRanges}} object 19 | #' 20 | #' @aliases granges granges,ChromatinAssay-method 21 | #' @seealso 22 | #' \itemize{ 23 | #' \item{\link[GenomicRanges]{granges} in the \pkg{GenomicRanges} package.} 24 | #' \item{\link{ChromatinAssay-class}} 25 | #' } 26 | #' @exportMethod granges 27 | #' @concept granges 28 | #' @examples 29 | #' granges(atac_small) 30 | setMethod( 31 | f = "granges", 32 | signature = "ChromatinAssay", 33 | definition = function(x, use.names = TRUE, use.mcols = FALSE, ...) { 34 | if (!identical(x = use.mcols, y = FALSE)) { 35 | stop("\"granges\" method for ChromatinAssay objects ", 36 | "does not support the 'use.mcols' argument") 37 | } 38 | slot(object = x, name = "ranges") 39 | } 40 | ) 41 | 42 | #' @describeIn granges-methods method for Seurat objects 43 | #' @concept granges 44 | setMethod( 45 | f = "granges", 46 | signature = "Seurat", 47 | definition = function(x, use.names = TRUE, use.mcols = FALSE, ...) { 48 | if (!identical(x = use.mcols, y = FALSE)) { 49 | stop("\"granges\" method for Seurat objects ", 50 | "does not support the 'use.mcols' argument") 51 | } 52 | assay <- DefaultAssay(object = x) 53 | granges(x = x[[assay]]) 54 | } 55 | ) 56 | -------------------------------------------------------------------------------- /R/zzz.R: -------------------------------------------------------------------------------- 1 | #' @docType package 2 | #' @name Signac-package 3 | #' @rdname Signac-package 4 | #' @concept assay 5 | #' 6 | "_PACKAGE" 7 | 8 | .onLoad <- function(...) { 9 | vctrs::s3_register(generic = "Seurat::FoldChange", class = "ChromatinAssay") 10 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Signac 2 | 3 | [![R-CMD-check](https://github.com/stuart-lab/signac/workflows/R-CMD-check/badge.svg)](https://github.com/stuart-lab/signac/actions) 4 | [![CRAN 5 | Version](https://www.r-pkg.org/badges/version/Signac)](https://cran.r-project.org/package=Signac) 6 | [![CRAN 7 | Downloads](https://cranlogs.r-pkg.org/badges/Signac)](https://cran.r-project.org/package=Signac) 8 | 9 | ## Overview 10 | 11 | Signac is a comprehensive R package for the analysis of single-cell 12 | chromatin data. Signac includes functions for quality control, 13 | normalization, dimension reduction, clustering, differential activity, 14 | and more. 15 | 16 | Documentation and tutorials can be found at 17 | 18 | 19 | ## Installation 20 | 21 | To install the latest release of Signac from CRAN: 22 | 23 | ``` r 24 | setRepositories(ind=1:3) # needed to automatically install Bioconductor dependencies 25 | install.packages("Signac") 26 | ``` 27 | 28 | To release the latest develop version from GitHub: 29 | 30 | ``` r 31 | if (!requireNamespace("remotes", quietly = TRUE)) 32 | install.packages("remotes") 33 | remotes::install_github("stuart-lab/signac", ref = "develop") 34 | ``` 35 | 36 | ## Release notes 37 | 38 | For a changelog please see the [NEWS 39 | file](https://github.com/stuart-lab/signac/blob/develop/NEWS.md), also 40 | available on the [Signac 41 | website](https://stuartlab.org/signac/news/index.html). 42 | 43 | ## Contributing 44 | 45 | We welcome contributions to the Signac package. Please see the 46 | [contribution guide](https://github.com/stuart-lab/signac/blob/develop/CONTRIBUTING.md) 47 | for more information. 48 | 49 | ## Getting help 50 | 51 | If you encounter a bug or have a feature request, please open an 52 | [issue](https://github.com/stuart-lab/signac/issues). 53 | 54 | If you would like to discuss questions related to single-cell analysis, 55 | you can open a 56 | [discussion](https://github.com/stuart-lab/signac/discussions). 57 | 58 | ## Roadmap 59 | 60 | Signac runs on a quarterly release schedule. Additional releases will be 61 | scheduled in the case of urgent bug fixes. The development roadmap can be viewed 62 | on GitHub [here](https://github.com/orgs/stuart-lab/projects/1). 63 | 64 | ## Citing Signac 65 | 66 | If you use the Signac package in your work please cite [Stuart et 67 | al. 2021](https://doi.org/10.1038/s41592-021-01282-5) 68 | 69 | ``` 70 | @ARTICLE{signac, 71 | title = "Single-cell chromatin state analysis with Signac", 72 | author = "Stuart, Tim and Srivastava, Avi and Madad, Shaista and Lareau, 73 | Caleb A and Satija, Rahul", 74 | journal = "Nat. Methods", 75 | publisher = "Nature Publishing Group", 76 | pages = "1--9", 77 | month = nov, 78 | year = 2021, 79 | url = "https://www.nature.com/articles/s41592-021-01282-5", 80 | language = "en" 81 | } 82 | ``` 83 | 84 | ## Related packages 85 | 86 | - [Seurat](https://github.com/satijalab/seurat) 87 | - [SeuratObject](https://github.com/satijalab/seurat-object) 88 | - [SeuratDisk](https://github.com/mojaveazure/seurat-disk) 89 | - [SeuratData](https://github.com/satijalab/seurat-data) 90 | - [SeuratWrappers](https://github.com/satijalab/seurat-wrappers) 91 | - [Azimuth](https://github.com/satijalab/azimuth) 92 | -------------------------------------------------------------------------------- /data/atac_small.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stuart-lab/signac/0b33b1154f9a610897d1efad2c0065081c4e7132/data/atac_small.rda -------------------------------------------------------------------------------- /data/blacklist_ce10.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stuart-lab/signac/0b33b1154f9a610897d1efad2c0065081c4e7132/data/blacklist_ce10.rda -------------------------------------------------------------------------------- /data/blacklist_ce11.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stuart-lab/signac/0b33b1154f9a610897d1efad2c0065081c4e7132/data/blacklist_ce11.rda -------------------------------------------------------------------------------- /data/blacklist_dm3.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stuart-lab/signac/0b33b1154f9a610897d1efad2c0065081c4e7132/data/blacklist_dm3.rda -------------------------------------------------------------------------------- /data/blacklist_dm6.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stuart-lab/signac/0b33b1154f9a610897d1efad2c0065081c4e7132/data/blacklist_dm6.rda -------------------------------------------------------------------------------- /data/blacklist_hg19.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stuart-lab/signac/0b33b1154f9a610897d1efad2c0065081c4e7132/data/blacklist_hg19.rda -------------------------------------------------------------------------------- /data/blacklist_hg38.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stuart-lab/signac/0b33b1154f9a610897d1efad2c0065081c4e7132/data/blacklist_hg38.rda -------------------------------------------------------------------------------- /data/blacklist_hg38_unified.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stuart-lab/signac/0b33b1154f9a610897d1efad2c0065081c4e7132/data/blacklist_hg38_unified.rda -------------------------------------------------------------------------------- /data/blacklist_mm10.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stuart-lab/signac/0b33b1154f9a610897d1efad2c0065081c4e7132/data/blacklist_mm10.rda -------------------------------------------------------------------------------- /index.md: -------------------------------------------------------------------------------- 1 | [![R-CMD-check](https://github.com/stuart-lab/signac/workflows/R-CMD-check/badge.svg)](https://github.com/stuart-lab/signac/actions) 2 | [![CRAN Version](https://www.r-pkg.org/badges/version/Signac)](https://cran.r-project.org/package=Signac) 3 | [![CRAN Downloads](https://cranlogs.r-pkg.org/badges/Signac)](https://cran.r-project.org/package=Signac) 4 | 5 | # Signac 6 | 7 | Signac is a comprehensive R package for the analysis of single-cell 8 | chromatin data. 9 | 10 | ## Features 11 | 12 | Signac is designed for the analysis of single-cell chromatin data, including scATAC-seq, 13 | single-cell targeted tagmentation methods such as [scCUT&Tag](https://www.nature.com/articles/s41467-019-09982-5) 14 | and [scNTT-seq](https://www.nature.com/articles/s41587-022-01588-5), 15 | and multimodal datasets that jointly measure chromatin state alongside other 16 | modalities. 17 | 18 | Signac currently supports the following features: 19 | 20 | * Calling peaks 21 | * Quantifying per-cell counts in different genomic regions 22 | * Calculating single-cell QC metrics 23 | * Dimensional reduction, visualization, and clustering 24 | * Identifying cell-type-specific peaks 25 | * Visualizing 'pseudo-bulk' coverage tracks 26 | * Integration of multiple single-cell datasets 27 | * Integration with single-cell RNA-seq datasets 28 | * Sequence motif enrichment analysis 29 | * Transcription factor footprinting analysis 30 | * Linking peaks to correlated genes 31 | * Parallelization through the [future](https://cran.r-project.org/package=future) package 32 | * Seamless interface with [Seurat](https://satijalab.org/seurat), [SeuratWrappers](https://github.com/satijalab/seurat-wrappers), [SeuratDisk](https://github.com/mojaveazure/seurat-disk), and [SeuratData](https://github.com/satijalab/seurat-data) functionality 33 | * Interoperability with [Bioconductor](https://bioconductor.org/) tools 34 | 35 | Check out the Signac [vignettes](articles/overview.html) page for in-depth 36 | tutorials. 37 | 38 | ## Quick installation 39 | 40 | ```r 41 | setRepositories(ind=1:3) 42 | install.packages("Signac") 43 | ``` 44 | 45 | For full installation instructions see the [install](articles/install.html) page. 46 | 47 | ## Getting help 48 | 49 | If you encounter a bug or have a feature request, please open an 50 | [issue](https://github.com/stuart-lab/signac/issues). 51 | 52 | If you would like to discuss questions related to single-cell analysis, 53 | you can open a 54 | [discussion](https://github.com/stuart-lab/signac/discussions). 55 | 56 | ## Roadmap 57 | 58 | Signac runs on a quarterly release schedule. Additional releases will be 59 | scheduled in the case of urgent bug fixes. The development roadmap can be viewed 60 | on GitHub [here](https://github.com/orgs/stuart-lab/projects/1). 61 | -------------------------------------------------------------------------------- /inst/CITATION: -------------------------------------------------------------------------------- 1 | citHeader("To cite Signac, please use:") 2 | 3 | bibentry(bibtype = "Article", 4 | author = c(person("Tim", "Stuart"), person("Avi", "Srivastava"), 5 | person("Shaista", "Madad"), person("Caleb", "Lareau"), 6 | person("Rahul", "Satija")), 7 | title = "Single-cell chromatin state analysis with Signac", 8 | journal = "Nature Methods", 9 | year = "2021", 10 | doi = "10.1038/s41592-021-01282-5", 11 | note = "https://doi.org/10.1038/s41592-021-01282-5", 12 | textVersion = "Stuart et al. Single-cell chromatin state analysis with Signac. Nature Methods (2021)." 13 | ) 14 | -------------------------------------------------------------------------------- /inst/extdata/fragments.tsv.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stuart-lab/signac/0b33b1154f9a610897d1efad2c0065081c4e7132/inst/extdata/fragments.tsv.gz -------------------------------------------------------------------------------- /inst/extdata/fragments.tsv.gz.tbi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stuart-lab/signac/0b33b1154f9a610897d1efad2c0065081c4e7132/inst/extdata/fragments.tsv.gz.tbi -------------------------------------------------------------------------------- /inst/extdata/fragments_header.tsv.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stuart-lab/signac/0b33b1154f9a610897d1efad2c0065081c4e7132/inst/extdata/fragments_header.tsv.gz -------------------------------------------------------------------------------- /inst/extdata/fragments_header.tsv.gz.tbi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stuart-lab/signac/0b33b1154f9a610897d1efad2c0065081c4e7132/inst/extdata/fragments_header.tsv.gz.tbi -------------------------------------------------------------------------------- /inst/extdata/test_mgatk/chrM_refAllele.txt.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stuart-lab/signac/0b33b1154f9a610897d1efad2c0065081c4e7132/inst/extdata/test_mgatk/chrM_refAllele.txt.gz -------------------------------------------------------------------------------- /inst/extdata/test_mgatk/test.A.txt.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stuart-lab/signac/0b33b1154f9a610897d1efad2c0065081c4e7132/inst/extdata/test_mgatk/test.A.txt.gz -------------------------------------------------------------------------------- /inst/extdata/test_mgatk/test.C.txt.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stuart-lab/signac/0b33b1154f9a610897d1efad2c0065081c4e7132/inst/extdata/test_mgatk/test.C.txt.gz -------------------------------------------------------------------------------- /inst/extdata/test_mgatk/test.G.txt.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stuart-lab/signac/0b33b1154f9a610897d1efad2c0065081c4e7132/inst/extdata/test_mgatk/test.G.txt.gz -------------------------------------------------------------------------------- /inst/extdata/test_mgatk/test.T.txt.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stuart-lab/signac/0b33b1154f9a610897d1efad2c0065081c4e7132/inst/extdata/test_mgatk/test.T.txt.gz -------------------------------------------------------------------------------- /inst/extdata/test_mgatk/test.depthTable.txt: -------------------------------------------------------------------------------- 1 | ACAGGCCGTGGTCGAA-1 268.42 2 | AAACTGCAGAGTCCGA-1 324.71 3 | AAAGATGCAATGGCTT-1 1.49 4 | ACTAGGTAGTGTCGGA-1 338.39 5 | ACCATCCTCTTGTCGC-1 219.04 6 | ACAGAAATCTATCTCA-1 405.72 7 | AATGGCTCAACGTAGG-1 182.02 8 | ACCAAACGTTGTGAGG-1 161.25 9 | AACCGATTCAAGAGAT-1 379.21 10 | ACTAGGTCAATGCCAT-1 229.31 11 | AAAGGGCAGCTACGCC-1 134.01 12 | -------------------------------------------------------------------------------- /man/AccessiblePeaks.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/utilities.R 3 | \name{AccessiblePeaks} 4 | \alias{AccessiblePeaks} 5 | \title{Accessible peaks} 6 | \usage{ 7 | AccessiblePeaks( 8 | object, 9 | assay = NULL, 10 | idents = NULL, 11 | cells = NULL, 12 | min.cells = 10 13 | ) 14 | } 15 | \arguments{ 16 | \item{object}{A Seurat object} 17 | 18 | \item{assay}{Name of assay to use} 19 | 20 | \item{idents}{A set of identity classes to find accessible peaks for} 21 | 22 | \item{cells}{A vector of cells to find accessible peaks for} 23 | 24 | \item{min.cells}{Minimum number of cells with the peak accessible (>0 counts) 25 | for the peak to be called accessible} 26 | } 27 | \value{ 28 | Returns a vector of peak names 29 | } 30 | \description{ 31 | Find accessible peaks in a set of cells 32 | } 33 | \concept{utilities} 34 | -------------------------------------------------------------------------------- /man/AddChromatinModule.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/utilities.R 3 | \name{AddChromatinModule} 4 | \alias{AddChromatinModule} 5 | \title{Add chromatin module} 6 | \usage{ 7 | AddChromatinModule(object, features, genome, assay = NULL, verbose = TRUE, ...) 8 | } 9 | \arguments{ 10 | \item{object}{A Seurat object} 11 | 12 | \item{features}{A named list of features to include in each module. The name 13 | of each element in the list will be used to name the modules computed, which 14 | will be stored in the object metadata.} 15 | 16 | \item{genome}{A BSgenome object} 17 | 18 | \item{assay}{Name of assay to use. If NULL, use the default assay.} 19 | 20 | \item{verbose}{Display messages} 21 | 22 | \item{...}{Additional arguments passed to \code{RunChromVAR}} 23 | } 24 | \value{ 25 | Returns a Seurat object 26 | } 27 | \description{ 28 | Compute chromVAR deviations for groups of peaks. The goal of this function is 29 | similar to that of \code{\link[Seurat]{AddModuleScore}} except that it is 30 | designed for single-cell chromatin data. The chromVAR deviations for each 31 | group of peaks will be added to the object metadata. 32 | } 33 | \concept{utilities} 34 | -------------------------------------------------------------------------------- /man/AddMotifs.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/generics.R, R/motifs.R 3 | \name{AddMotifs} 4 | \alias{AddMotifs} 5 | \alias{AddMotifs.default} 6 | \alias{AddMotifs.ChromatinAssay} 7 | \alias{AddMotifs.Assay} 8 | \alias{AddMotifs.StdAssay} 9 | \alias{AddMotifs.Seurat} 10 | \title{Add DNA sequence motif information} 11 | \usage{ 12 | AddMotifs(object, ...) 13 | 14 | \method{AddMotifs}{default}(object, genome, pfm, verbose = TRUE, ...) 15 | 16 | \method{AddMotifs}{ChromatinAssay}(object, genome, pfm, verbose = TRUE, ...) 17 | 18 | \method{AddMotifs}{Assay}(object, genome, pfm, verbose = TRUE, ...) 19 | 20 | \method{AddMotifs}{StdAssay}(object, genome, pfm, verbose = TRUE, ...) 21 | 22 | \method{AddMotifs}{Seurat}(object, genome, pfm, assay = NULL, verbose = TRUE, ...) 23 | } 24 | \arguments{ 25 | \item{object}{A Seurat object or ChromatinAssay object} 26 | 27 | \item{...}{Additional arguments passed to other methods} 28 | 29 | \item{genome}{A \code{BSgenome}, \code{DNAStringSet}, \code{FaFile}, or 30 | string stating the genome build recognized by \code{getBSgenome}.} 31 | 32 | \item{pfm}{A \code{PFMatrixList} or \code{PWMatrixList} object containing 33 | position weight/frequency matrices to use} 34 | 35 | \item{verbose}{Display messages} 36 | 37 | \item{assay}{Name of assay to use. If NULL, use the default assay} 38 | } 39 | \value{ 40 | When running on a \code{ChromatinAssay} or \code{Seurat} object, 41 | returns a modified version of the input object. When running on a matrix, 42 | returns a \code{Motif} object. 43 | } 44 | \description{ 45 | Construct a \code{\link{Motif}} object containing DNA sequence motif 46 | information and add it to an existing Seurat object or ChromatinAssay. 47 | If running on a Seurat object, \code{AddMotifs} will also run 48 | \code{\link{RegionStats}} to compute the GC content of each peak and store 49 | the results in the feature metadata. PFMs or PWMs are matched to the genome 50 | sequence using the \code{\link[motifmatchr]{matchMotifs}} function with 51 | default parameters to construct a matrix of motif positions in genomic 52 | regions. 53 | } 54 | \seealso{ 55 | \pkg{motifmatchr} 56 | } 57 | \concept{motifs} 58 | -------------------------------------------------------------------------------- /man/AggregateTiles.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/generics.R, R/quantification.R 3 | \name{AggregateTiles} 4 | \alias{AggregateTiles} 5 | \alias{AggregateTiles.Seurat} 6 | \alias{AggregateTiles.ChromatinAssay} 7 | \alias{AggregateTiles.default} 8 | \title{Quantify aggregated genome tiles} 9 | \usage{ 10 | AggregateTiles(object, ...) 11 | 12 | \method{AggregateTiles}{Seurat}( 13 | object, 14 | genome, 15 | assay = NULL, 16 | new.assay.name = "tiles", 17 | min_counts = 5, 18 | binsize = 5000, 19 | verbose = TRUE, 20 | ... 21 | ) 22 | 23 | \method{AggregateTiles}{ChromatinAssay}( 24 | object, 25 | genome, 26 | min_counts = 5, 27 | binsize = 5000, 28 | verbose = TRUE, 29 | ... 30 | ) 31 | 32 | \method{AggregateTiles}{default}( 33 | object, 34 | genome, 35 | cells = NULL, 36 | min_counts = 5, 37 | binsize = 5000, 38 | verbose = TRUE, 39 | ... 40 | ) 41 | } 42 | \arguments{ 43 | \item{object}{A Seurat object or ChromatinAssay object} 44 | 45 | \item{...}{Additional arguments passed to other methods} 46 | 47 | \item{genome}{genome A vector of chromosome sizes for the genome. This is 48 | used to construct the genome bin coordinates. The can be obtained by calling 49 | seqlengths on a BSgenome-class object.} 50 | 51 | \item{assay}{Name of assay to use} 52 | 53 | \item{new.assay.name}{Name of new assay to create containing aggregated 54 | genome tiles} 55 | 56 | \item{min_counts}{Minimum number of counts for a tile to be retained prior to 57 | aggregation} 58 | 59 | \item{binsize}{Size of the genome bins (tiles) in base pairs} 60 | 61 | \item{verbose}{Display messages} 62 | 63 | \item{cells}{Cells to include} 64 | } 65 | \value{ 66 | When running on a Seurat object, returns the Seurat object with a new 67 | \code{\link{ChromatinAssay}} added. 68 | 69 | When running on a \code{\link{ChromatinAssay}}, returns a new 70 | \code{ChromatinAssay} containing the aggregated genome tiles. 71 | 72 | When running on a fragment file, returns a sparse region x cell 73 | matrix. 74 | } 75 | \description{ 76 | Quantifies fragment counts per cell in fixed-size genome bins across the 77 | whole genome, then removes bins with less than a desired minimum number of 78 | counts in the bin, then merges adjacent tiles into a single region. 79 | } 80 | \concept{quantification} 81 | -------------------------------------------------------------------------------- /man/AlleleFreq.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/generics.R, R/mito.R 3 | \name{AlleleFreq} 4 | \alias{AlleleFreq} 5 | \alias{AlleleFreq.default} 6 | \alias{AlleleFreq.Assay} 7 | \alias{AlleleFreq.StdAssay} 8 | \alias{AlleleFreq.Seurat} 9 | \title{Compute allele frequencies per cell} 10 | \usage{ 11 | AlleleFreq(object, ...) 12 | 13 | \method{AlleleFreq}{default}(object, variants, ...) 14 | 15 | \method{AlleleFreq}{Assay}(object, variants, ...) 16 | 17 | \method{AlleleFreq}{StdAssay}(object, variants, ...) 18 | 19 | \method{AlleleFreq}{Seurat}(object, variants, assay = NULL, new.assay.name = "alleles", ...) 20 | } 21 | \arguments{ 22 | \item{object}{A Seurat object, Assay, or matrix} 23 | 24 | \item{...}{Arguments passed to other methods} 25 | 26 | \item{variants}{A character vector of informative variants to keep. For 27 | example, \code{c("627G>A","709G>A","1045G>A","1793G>A")}.} 28 | 29 | \item{assay}{Name of assay to use} 30 | 31 | \item{new.assay.name}{Name of new assay to store variant data in} 32 | } 33 | \value{ 34 | Returns a \code{\link[SeuratObject]{Seurat}} object with a new assay 35 | containing the allele frequencies for the informative variants. 36 | } 37 | \description{ 38 | Collapses allele counts for each strand and normalize by the total number of 39 | counts at each nucleotide position. 40 | } 41 | \concept{mito} 42 | -------------------------------------------------------------------------------- /man/Annotation.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/generics.R, R/objects.R 3 | \name{Annotation} 4 | \alias{Annotation} 5 | \alias{Annotation<-} 6 | \alias{Annotation.ChromatinAssay} 7 | \alias{Annotation.Seurat} 8 | \alias{Annotation<-.ChromatinAssay} 9 | \alias{Annotation<-.Seurat} 10 | \title{Annotation} 11 | \usage{ 12 | Annotation(object, ...) 13 | 14 | Annotation(object, ...) <- value 15 | 16 | \method{Annotation}{ChromatinAssay}(object, ...) 17 | 18 | \method{Annotation}{Seurat}(object, ...) 19 | 20 | \method{Annotation}{ChromatinAssay}(object, ...) <- value 21 | 22 | \method{Annotation}{Seurat}(object, ...) <- value 23 | } 24 | \arguments{ 25 | \item{object}{A Seurat object or ChromatinAssay object} 26 | 27 | \item{...}{Arguments passed to other methods} 28 | 29 | \item{value}{A value to set. Can be NULL, to remove the current annotation 30 | information, or a \code{\link[GenomicRanges]{GRanges}} object. If a 31 | \code{GRanges} object is supplied and the genome information is stored in the 32 | assay, the genome of the new annotations must match the genome of the assay.} 33 | } 34 | \value{ 35 | Returns a \code{\link[GenomicRanges]{GRanges}} object 36 | if the annotation data is present, otherwise returns NULL 37 | } 38 | \description{ 39 | Get the annotation from a ChromatinAssay 40 | } 41 | \examples{ 42 | \donttest{ 43 | Annotation(atac_small[["peaks"]]) 44 | } 45 | \donttest{ 46 | Annotation(atac_small) 47 | } 48 | genes <- Annotation(atac_small) 49 | Annotation(atac_small[["peaks"]]) <- genes 50 | genes <- Annotation(atac_small) 51 | Annotation(atac_small) <- genes 52 | } 53 | \concept{assay} 54 | -------------------------------------------------------------------------------- /man/AnnotationPlot.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/visualization.R 3 | \name{AnnotationPlot} 4 | \alias{AnnotationPlot} 5 | \title{Plot gene annotations} 6 | \usage{ 7 | AnnotationPlot( 8 | object, 9 | region, 10 | assay = NULL, 11 | mode = "gene", 12 | sep = c("-", "-"), 13 | extend.upstream = 0, 14 | extend.downstream = 0 15 | ) 16 | } 17 | \arguments{ 18 | \item{object}{A \code{\link[SeuratObject]{Seurat}} object} 19 | 20 | \item{region}{A genomic region to plot} 21 | 22 | \item{assay}{Name of assay to use. If NULL, use the default assay.} 23 | 24 | \item{mode}{Display mode. Choose either "gene" or "transcript" to determine 25 | whether genes or transcripts are plotted.} 26 | 27 | \item{sep}{Separators to use for strings encoding genomic coordinates. First 28 | element is used to separate the chromosome from the coordinates, second 29 | element is used to separate the start from end coordinate.} 30 | 31 | \item{extend.upstream}{Number of bases to extend the region upstream.} 32 | 33 | \item{extend.downstream}{Number of bases to extend the region downstream.} 34 | } 35 | \value{ 36 | Returns a \code{\link[ggplot2]{ggplot}} object 37 | } 38 | \description{ 39 | Display gene annotations in a given region of the genome. 40 | } 41 | \examples{ 42 | \donttest{ 43 | AnnotationPlot(object = atac_small, region = c("chr1-29554-39554")) 44 | } 45 | } 46 | \concept{visualization} 47 | -------------------------------------------------------------------------------- /man/AverageCounts.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/utilities.R 3 | \name{AverageCounts} 4 | \alias{AverageCounts} 5 | \title{Average Counts} 6 | \usage{ 7 | AverageCounts(object, assay = NULL, group.by = NULL, verbose = TRUE) 8 | } 9 | \arguments{ 10 | \item{object}{A Seurat object} 11 | 12 | \item{assay}{Name of assay to use. Default is the active assay} 13 | 14 | \item{group.by}{Grouping variable to use. Default is the active identities} 15 | 16 | \item{verbose}{Display messages} 17 | } 18 | \value{ 19 | Returns a dataframe 20 | } 21 | \description{ 22 | Compute the mean counts per group of cells for a given assay 23 | } 24 | \examples{ 25 | AverageCounts(atac_small) 26 | } 27 | \concept{utilities} 28 | -------------------------------------------------------------------------------- /man/BigwigTrack.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/visualization.R 3 | \name{BigwigTrack} 4 | \alias{BigwigTrack} 5 | \title{Plot data from BigWig files} 6 | \usage{ 7 | BigwigTrack( 8 | region, 9 | bigwig, 10 | smooth = 200, 11 | extend.upstream = 0, 12 | extend.downstream = 0, 13 | type = "coverage", 14 | y_label = "bigWig", 15 | bigwig.scale = "common", 16 | ymax = NULL, 17 | max.downsample = 3000, 18 | downsample.rate = 0.1 19 | ) 20 | } 21 | \arguments{ 22 | \item{region}{GRanges object specifying region to plot} 23 | 24 | \item{bigwig}{List of bigwig file paths. List should be named, and the name 25 | of each element in the list of files will be displayed alongside the track 26 | in the final plot.} 27 | 28 | \item{smooth}{Number of bases to smooth data over (rolling mean). If NULL, 29 | do not apply smoothing.} 30 | 31 | \item{extend.upstream}{Number of bases to extend the region upstream.} 32 | 33 | \item{extend.downstream}{Number of bases to extend the region downstream.} 34 | 35 | \item{type}{Plot type. Can be one of "line", "heatmap", or "coverage"} 36 | 37 | \item{y_label}{Y-axis label} 38 | 39 | \item{bigwig.scale}{Scaling to apply to data from different bigwig files. 40 | Can be: 41 | \itemize{ 42 | \item{common: plot each bigwig on a common scale (default)} 43 | \item{separate: plot each bigwig on a separate scale ranging from zero to the 44 | maximum value for that bigwig file within the plotted region} 45 | }} 46 | 47 | \item{ymax}{Maximum value for Y axis. Can be one of: 48 | \itemize{ 49 | \item{NULL: set to the highest value among all the tracks (default)} 50 | \item{qXX: clip the maximum value to the XX quantile (for example, q95 will 51 | set the maximum value to 95\% of the maximum value in the data). This can help 52 | remove the effect of extreme values that may otherwise distort the scale.} 53 | \item{numeric: manually define a Y-axis limit} 54 | }} 55 | 56 | \item{max.downsample}{Minimum number of positions kept when downsampling. 57 | Downsampling rate is adaptive to the window size, but this parameter will set 58 | the minimum possible number of positions to include so that plots do not 59 | become too sparse when the window size is small.} 60 | 61 | \item{downsample.rate}{Fraction of positions to retain when downsampling. 62 | Retaining more positions can give a higher-resolution plot but can make the 63 | number of points large, resulting in larger file sizes when saving the plot 64 | and a longer period of time needed to draw the plot.} 65 | } 66 | \value{ 67 | Returns a ggplot object 68 | } 69 | \description{ 70 | Create coverage tracks, heatmaps, or line plots from bigwig files. 71 | } 72 | \details{ 73 | Note that this function does not work on windows. 74 | } 75 | \concept{visualization} 76 | -------------------------------------------------------------------------------- /man/BinarizeCounts.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/generics.R, R/preprocessing.R 3 | \name{BinarizeCounts} 4 | \alias{BinarizeCounts} 5 | \alias{BinarizeCounts.default} 6 | \alias{BinarizeCounts.Assay} 7 | \alias{BinarizeCounts.Seurat} 8 | \title{Binarize counts} 9 | \usage{ 10 | BinarizeCounts(object, ...) 11 | 12 | \method{BinarizeCounts}{default}(object, assay = NULL, verbose = TRUE, ...) 13 | 14 | \method{BinarizeCounts}{Assay}(object, assay = NULL, verbose = TRUE, ...) 15 | 16 | \method{BinarizeCounts}{Seurat}(object, assay = NULL, verbose = TRUE, ...) 17 | } 18 | \arguments{ 19 | \item{object}{A Seurat object} 20 | 21 | \item{...}{Arguments passed to other methods} 22 | 23 | \item{assay}{Name of assay to use. Can be a list of assays, 24 | and binarization will be applied to each.} 25 | 26 | \item{verbose}{Display messages} 27 | } 28 | \value{ 29 | Returns a \code{\link[SeuratObject]{Seurat}} object 30 | } 31 | \description{ 32 | Set counts >1 to 1 in a count matrix 33 | } 34 | \examples{ 35 | x <- matrix(data = sample(0:3, size = 25, replace = TRUE), ncol = 5) 36 | BinarizeCounts(x) 37 | BinarizeCounts(atac_small[['peaks']]) 38 | BinarizeCounts(atac_small) 39 | } 40 | \concept{preprocessing} 41 | -------------------------------------------------------------------------------- /man/Cells-set.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/generics.R 3 | \name{Cells<-} 4 | \alias{Cells<-} 5 | \title{Set and get cell barcode information for a Fragment object} 6 | \usage{ 7 | Cells(x, ...) <- value 8 | } 9 | \arguments{ 10 | \item{x}{A Seurat object} 11 | 12 | \item{...}{Arguments passed to other methods} 13 | 14 | \item{value}{A character vector of cell barcodes} 15 | } 16 | \description{ 17 | Set and get cell barcode information for a Fragment object 18 | } 19 | \concept{assay} 20 | -------------------------------------------------------------------------------- /man/Cells.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/fragments.R 3 | \name{Cells.Fragment} 4 | \alias{Cells.Fragment} 5 | \alias{Cells<-.Fragment} 6 | \title{Set and get cell barcode information for a \code{\link{Fragment}} object} 7 | \usage{ 8 | \method{Cells}{Fragment}(x, ...) 9 | 10 | \method{Cells}{Fragment}(x, ...) <- value 11 | } 12 | \arguments{ 13 | \item{x}{A Fragment object} 14 | 15 | \item{...}{Arguments passed to other methods} 16 | 17 | \item{value}{A vector of cell names to store in the \code{\link{Fragment}} 18 | object} 19 | } 20 | \description{ 21 | This returns the names of cells in the object that are contained in the 22 | fragment file. These cell barcodes may not match the barcodes present in the 23 | fragment file. The \code{\link{Fragment}} object contains an internal mapping 24 | of the cell names in the \code{\link{ChromatinAssay}} object to the cell 25 | names in the fragment file, so that cell names can be changed in the 26 | assay without needing to change the cell names on disk. 27 | } 28 | \details{ 29 | To access the cell names that are stored in the fragment file itself, use 30 | \code{GetFragmentData(object = x, name = "cells")}. 31 | } 32 | \concept{fragments} 33 | -------------------------------------------------------------------------------- /man/CellsPerGroup.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/utilities.R 3 | \name{CellsPerGroup} 4 | \alias{CellsPerGroup} 5 | \title{Cells per group} 6 | \usage{ 7 | CellsPerGroup(object, group.by = NULL) 8 | } 9 | \arguments{ 10 | \item{object}{A Seurat object} 11 | 12 | \item{group.by}{A grouping variable. Default is the active identities} 13 | } 14 | \value{ 15 | Returns a vector 16 | } 17 | \description{ 18 | Count the number of cells in each group 19 | } 20 | \examples{ 21 | CellsPerGroup(atac_small) 22 | } 23 | \concept{utilities} 24 | -------------------------------------------------------------------------------- /man/ChromatinAssay-class.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/objects.R 3 | \docType{class} 4 | \name{ChromatinAssay-class} 5 | \alias{ChromatinAssay-class} 6 | \alias{ChromatinAssay} 7 | \title{The ChromatinAssay class} 8 | \description{ 9 | The ChromatinAssay object is an extended \code{\link[SeuratObject]{Assay}} 10 | for the storage and analysis of single-cell chromatin data. 11 | } 12 | \section{Slots}{ 13 | 14 | \describe{ 15 | \item{\code{ranges}}{A \code{\link[GenomicRanges]{GRanges}} object describing the 16 | genomic location of features in the object} 17 | 18 | \item{\code{motifs}}{A \code{\link{Motif}} object} 19 | 20 | \item{\code{fragments}}{A list of \code{\link{Fragment}} objects.} 21 | 22 | \item{\code{seqinfo}}{A \code{\link[GenomeInfoDb]{Seqinfo}} object containing basic 23 | information about the genome sequence used.} 24 | 25 | \item{\code{annotation}}{A \code{\link[GenomicRanges]{GRanges}} object containing 26 | genomic annotations. This should be a GRanges object with the following 27 | columns: 28 | \itemize{ 29 | \item{tx_id: Transcript ID} 30 | \item{gene_name: Gene name} 31 | \item{gene_id: Gene ID} 32 | \item{gene_biotype: Gene biotype (e.g. "protein_coding", "lincRNA")} 33 | \item{type: Annotation type (e.g. "exon", "gap")} 34 | }} 35 | 36 | \item{\code{bias}}{A vector containing Tn5 integration bias information 37 | (frequency of Tn5 integration at different kmers)} 38 | 39 | \item{\code{positionEnrichment}}{A named list of matrices containing positional 40 | enrichment scores for Tn5 integration (for example, enrichment at the TSS)} 41 | 42 | \item{\code{links}}{A \code{\link[GenomicRanges]{GRanges}} object describing linked 43 | genomic positions, such as co-accessible sites or enhancer-gene regulatory 44 | relationships. This should be a \code{GRanges} object, where the start and 45 | end coordinates are the two linked genomic positions, and must contain a 46 | "score" metadata column.} 47 | }} 48 | 49 | \concept{assay} 50 | -------------------------------------------------------------------------------- /man/ClosestFeature.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/utilities.R 3 | \name{ClosestFeature} 4 | \alias{ClosestFeature} 5 | \title{Closest Feature} 6 | \usage{ 7 | ClosestFeature(object, regions, annotation = NULL, ...) 8 | } 9 | \arguments{ 10 | \item{object}{A Seurat object} 11 | 12 | \item{regions}{A set of genomic regions to query} 13 | 14 | \item{annotation}{A GRanges object containing annotation information. If 15 | NULL, use the annotations stored in the object.} 16 | 17 | \item{...}{Additional arguments passed to \code{\link{StringToGRanges}}} 18 | } 19 | \value{ 20 | Returns a dataframe with the name of each region, the closest feature 21 | in the annotation, and the distance to the feature. 22 | } 23 | \description{ 24 | Find the closest feature to a given set of genomic regions 25 | } 26 | \examples{ 27 | \donttest{ 28 | ClosestFeature( 29 | object = atac_small, 30 | regions = head(granges(atac_small)) 31 | ) 32 | } 33 | } 34 | \concept{utilities} 35 | -------------------------------------------------------------------------------- /man/ClusterClonotypes.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/mito.R 3 | \name{ClusterClonotypes} 4 | \alias{ClusterClonotypes} 5 | \title{Find relationships between clonotypes} 6 | \usage{ 7 | ClusterClonotypes(object, assay = NULL, group.by = NULL) 8 | } 9 | \arguments{ 10 | \item{object}{A Seurat object} 11 | 12 | \item{assay}{Name of assay to use} 13 | 14 | \item{group.by}{Grouping variable for cells} 15 | } 16 | \value{ 17 | Returns a list containing two objects of class 18 | \code{\link[stats]{hclust}}, one for the cell clustering and one for the 19 | feature (allele) clustering 20 | } 21 | \description{ 22 | Perform hierarchical clustering on clonotype data 23 | } 24 | \concept{mito} 25 | -------------------------------------------------------------------------------- /man/CombineTracks.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/visualization.R 3 | \name{CombineTracks} 4 | \alias{CombineTracks} 5 | \title{Combine genome region plots} 6 | \usage{ 7 | CombineTracks(plotlist, expression.plot = NULL, heights = NULL, widths = NULL) 8 | } 9 | \arguments{ 10 | \item{plotlist}{A list of plots to combine. Must be from the same genomic 11 | region.} 12 | 13 | \item{expression.plot}{Plot containing gene expression information. If 14 | supplied, this will be placed to the left of the coverage tracks and aligned 15 | with each track} 16 | 17 | \item{heights}{Relative heights for each plot. If NULL, the first plot will 18 | be 8x the height of the other tracks.} 19 | 20 | \item{widths}{Relative widths for each plot. Only required if adding a gene 21 | expression panel. If NULL, main plots will be 8x the width of the gene 22 | expression panel} 23 | } 24 | \value{ 25 | Returns a patchworked ggplot2 object 26 | } 27 | \description{ 28 | This can be used to combine coverage plots, peak region plots, gene 29 | annotation plots, and linked element plots. The different tracks are stacked 30 | on top of each other and the x-axis combined. 31 | } 32 | \examples{ 33 | \donttest{ 34 | p1 <- PeakPlot(atac_small, region = "chr1-29554-39554") 35 | p2 <- AnnotationPlot(atac_small, region = "chr1-29554-39554") 36 | CombineTracks(plotlist = list(p1, p2), heights = c(1, 1)) 37 | } 38 | } 39 | \concept{visualization} 40 | -------------------------------------------------------------------------------- /man/ConnectionsToLinks.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/links.R 3 | \name{ConnectionsToLinks} 4 | \alias{ConnectionsToLinks} 5 | \title{Cicero connections to links} 6 | \usage{ 7 | ConnectionsToLinks(conns, ccans = NULL, threshold = 0, sep = c("-", "-")) 8 | } 9 | \arguments{ 10 | \item{conns}{A dataframe containing co-accessible elements. This would 11 | usually be the output of \code{run_cicero} or 12 | \code{assemble_connections}. Specifically, this should be a 13 | dataframe where the first column contains the genomic coordinates of the 14 | first element in the linked pair of elements, with chromosome, start, end 15 | coordinates separated by "-" characters. The second column should be the 16 | second element in the linked pair, formatted in the same way as the first 17 | column. A third column should contain the co-accessibility scores.} 18 | 19 | \item{ccans}{This is optional, but if supplied should be a dataframe 20 | containing the cis-co-accessibility network (CCAN) information generated 21 | by \code{generate_ccans}. Specifically, this should be a 22 | dataframe containing the name of the peak in the first column, and the 23 | CCAN that it belongs to in the second column.} 24 | 25 | \item{threshold}{Threshold for retaining a coaccessible site. Links with 26 | a value less than or equal to this threshold will be discarded.} 27 | 28 | \item{sep}{Separators to use for strings encoding genomic coordinates. 29 | First element is used to separate the chromosome from the coordinates, second 30 | element is used to separate the start from end coordinate.} 31 | } 32 | \value{ 33 | Returns a \code{\link[GenomicRanges]{GRanges}} object 34 | } 35 | \description{ 36 | Convert the output of Cicero connections to a set of genomic ranges where 37 | the start and end coordinates of the range are the midpoints of the linked 38 | elements. Only elements on the same chromosome are included in the output. 39 | } 40 | \details{ 41 | See the Cicero package for more information: 42 | \url{https://bioconductor.org/packages/cicero/} 43 | } 44 | \concept{links} 45 | -------------------------------------------------------------------------------- /man/ConvertMotifID.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/generics.R, R/motifs.R 3 | \name{ConvertMotifID} 4 | \alias{ConvertMotifID} 5 | \alias{ConvertMotifID.default} 6 | \alias{ConvertMotifID.Motif} 7 | \alias{ConvertMotifID.ChromatinAssay} 8 | \alias{ConvertMotifID.Assay} 9 | \alias{ConvertMotifID.StdAssay} 10 | \alias{ConvertMotifID.Seurat} 11 | \title{Convert between motif name and motif ID} 12 | \usage{ 13 | ConvertMotifID(object, ...) 14 | 15 | \method{ConvertMotifID}{default}(object, name, id, ...) 16 | 17 | \method{ConvertMotifID}{Motif}(object, ...) 18 | 19 | \method{ConvertMotifID}{ChromatinAssay}(object, ...) 20 | 21 | \method{ConvertMotifID}{Assay}(object, ...) 22 | 23 | \method{ConvertMotifID}{StdAssay}(object, ...) 24 | 25 | \method{ConvertMotifID}{Seurat}(object, assay = NULL, ...) 26 | } 27 | \arguments{ 28 | \item{object}{A Seurat, ChromatinAssay, or Motif object} 29 | 30 | \item{...}{Arguments passed to other methods} 31 | 32 | \item{name}{A vector of motif names} 33 | 34 | \item{id}{A vector of motif IDs. Only one of \code{name} and \code{id} should 35 | be supplied} 36 | 37 | \item{assay}{For \code{Seurat} object. Name of assay to use. 38 | If NULL, use the default assay} 39 | } 40 | \value{ 41 | Returns a character vector with the same length and order as the 42 | input. Any names or IDs that were not found will be stored as \code{NA}. 43 | } 44 | \description{ 45 | Converts from motif name to motif ID or vice versa. To convert common names 46 | to IDs, use the \code{name} parameter. To convert IDs to common names, use 47 | the \code{id} parameter. 48 | } 49 | \concept{motifs} 50 | -------------------------------------------------------------------------------- /man/CountFragments.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/fragments.R 3 | \name{CountFragments} 4 | \alias{CountFragments} 5 | \title{Count fragments} 6 | \usage{ 7 | CountFragments(fragments, cells = NULL, max_lines = NULL, verbose = TRUE) 8 | } 9 | \arguments{ 10 | \item{fragments}{Path to a fragment file. If a list of fragment files is 11 | provided, the total fragments for each cell barcode across all files will be 12 | returned} 13 | 14 | \item{cells}{Cells to include. If NULL, include all cells} 15 | 16 | \item{max_lines}{Maximum number of lines to read from the fragment file. If 17 | NULL, read all lines in the file.} 18 | 19 | \item{verbose}{Display messages} 20 | } 21 | \value{ 22 | Returns a data.frame with the following columns: 23 | \itemize{ 24 | \item{CB: the cell barcode} 25 | \item{frequency_count: total number of fragments sequenced for the cell} 26 | \item{mononucleosome: total number of fragments with length between 147 bp and 294 bp} 27 | \item{nucleosome_free: total number of fragments with length <147 bp} 28 | \item{reads_count: total number of reads sequenced for the cell} 29 | } 30 | } 31 | \description{ 32 | Count total fragments per cell barcode present in a fragment file. 33 | } 34 | \examples{ 35 | fpath <- system.file("extdata", "fragments.tsv.gz", package="Signac") 36 | counts <- CountFragments(fragments = fpath) 37 | } 38 | \concept{fragments} 39 | -------------------------------------------------------------------------------- /man/CountsInRegion.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/utilities.R 3 | \name{CountsInRegion} 4 | \alias{CountsInRegion} 5 | \title{Counts in region} 6 | \usage{ 7 | CountsInRegion(object, assay, regions, ...) 8 | } 9 | \arguments{ 10 | \item{object}{A Seurat object} 11 | 12 | \item{assay}{Name of a chromatin assay in the object to use} 13 | 14 | \item{regions}{A GRanges object} 15 | 16 | \item{...}{Additional arguments passed to \code{\link[IRanges]{findOverlaps}}} 17 | } 18 | \value{ 19 | Returns a numeric vector 20 | } 21 | \description{ 22 | Count reads per cell overlapping a given set of regions 23 | } 24 | \examples{ 25 | \donttest{ 26 | CountsInRegion( 27 | object = atac_small, 28 | assay = 'bins', 29 | regions = blacklist_hg19 30 | ) 31 | } 32 | } 33 | \concept{utilities} 34 | -------------------------------------------------------------------------------- /man/CoverageBrowser.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/visualization.R 3 | \name{CoverageBrowser} 4 | \alias{CoverageBrowser} 5 | \title{Genome browser} 6 | \usage{ 7 | CoverageBrowser(object, region, assay = NULL, sep = c("-", "-"), ...) 8 | } 9 | \arguments{ 10 | \item{object}{A Seurat object} 11 | 12 | \item{region}{A set of genomic coordinates} 13 | 14 | \item{assay}{Name of assay to use} 15 | 16 | \item{sep}{Separators for genomic coordinates if region supplied as a string 17 | rather than GRanges object} 18 | 19 | \item{...}{Parameters passed to \code{\link{CoveragePlot}}} 20 | } 21 | \value{ 22 | Returns a list of ggplot objects 23 | } 24 | \description{ 25 | Interactive version of the \code{\link{CoveragePlot}} function. Allows 26 | altering the genome position interactively. The current view at any time can 27 | be saved to a list of \code{\link[ggplot2]{ggplot}} objects using the "Save 28 | plot" button, and this list of plots will be returned after ending the 29 | browser by pressing the "Done" button. 30 | } 31 | \concept{visualization} 32 | -------------------------------------------------------------------------------- /man/CreateFragmentObject.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/fragments.R 3 | \name{CreateFragmentObject} 4 | \alias{CreateFragmentObject} 5 | \title{Create a Fragment object} 6 | \usage{ 7 | CreateFragmentObject( 8 | path, 9 | cells = NULL, 10 | validate.fragments = TRUE, 11 | verbose = TRUE, 12 | ... 13 | ) 14 | } 15 | \arguments{ 16 | \item{path}{A path to the fragment file. The file should contain a tabix 17 | index in the same directory.} 18 | 19 | \item{cells}{A named character vector containing cell barcodes contained in 20 | the fragment file. This does not need to be all cells in the fragment file, 21 | but there should be no cells in the vector that are not present in the 22 | fragment file. A search of the file will be performed until at least one 23 | fragment from each cell is found. If NULL, don't check for expected cells. 24 | 25 | Each element of the vector should be a cell barcode that appears in the 26 | fragment file, and the name of each element should be the corresponding cell 27 | name in the object.} 28 | 29 | \item{validate.fragments}{Check that expected cells are present in the 30 | fragment file.} 31 | 32 | \item{verbose}{Display messages} 33 | 34 | \item{...}{Additional arguments passed to \code{ValidateCells}} 35 | } 36 | \description{ 37 | Create a \code{Fragment} object to store fragment file information. 38 | This object stores a 32-bit MD5 hash of the fragment file and the fragment 39 | file index so that any changes to the files on-disk can be detected. A check 40 | is also performed to ensure that the expected cells are present in the 41 | fragment file. 42 | } 43 | \examples{ 44 | fpath <- system.file("extdata", "fragments.tsv.gz", package="Signac") 45 | cells <- colnames(x = atac_small) 46 | names(x = cells) <- paste0("test_", cells) 47 | frags <- CreateFragmentObject(path = fpath, cells = cells, verbose = FALSE, tolerance = 0.5) 48 | } 49 | \concept{fragments} 50 | -------------------------------------------------------------------------------- /man/CreateMotifMatrix.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/preprocessing.R 3 | \name{CreateMotifMatrix} 4 | \alias{CreateMotifMatrix} 5 | \title{Create motif matrix} 6 | \usage{ 7 | CreateMotifMatrix( 8 | features, 9 | pwm, 10 | genome, 11 | score = FALSE, 12 | use.counts = FALSE, 13 | sep = c("-", "-"), 14 | ... 15 | ) 16 | } 17 | \arguments{ 18 | \item{features}{A GRanges object containing a set of genomic features} 19 | 20 | \item{pwm}{A \code{\link[TFBSTools]{PFMatrixList}} or 21 | \code{\link[TFBSTools]{PWMatrixList}} 22 | object containing position weight/frequency matrices to use} 23 | 24 | \item{genome}{Any object compatible with the \code{genome} argument 25 | in \code{\link[motifmatchr]{matchMotifs}}} 26 | 27 | \item{score}{Record the motif match score, rather than presence/absence 28 | (default FALSE)} 29 | 30 | \item{use.counts}{Record motif counts per region. If FALSE (default), 31 | record presence/absence of motif. Only applicable if \code{score=FALSE}.} 32 | 33 | \item{sep}{A length-2 character vector containing the separators to be used 34 | when constructing matrix rownames from the GRanges} 35 | 36 | \item{...}{Additional arguments passed to 37 | \code{\link[motifmatchr]{matchMotifs}}} 38 | } 39 | \value{ 40 | Returns a sparse matrix 41 | } 42 | \description{ 43 | Create a motif x feature matrix from a set of genomic ranges, 44 | the genome, and a set of position weight matrices. 45 | } 46 | \details{ 47 | Requires that motifmatchr is installed 48 | \url{https://www.bioconductor.org/packages/motifmatchr/}. 49 | } 50 | \examples{ 51 | \dontrun{ 52 | library(JASPAR2018) 53 | library(TFBSTools) 54 | library(BSgenome.Hsapiens.UCSC.hg19) 55 | 56 | pwm <- getMatrixSet( 57 | x = JASPAR2018, 58 | opts = list(species = 9606, all_versions = FALSE) 59 | ) 60 | motif.matrix <- CreateMotifMatrix( 61 | features = granges(atac_small), 62 | pwm = pwm, 63 | genome = BSgenome.Hsapiens.UCSC.hg19 64 | ) 65 | } 66 | } 67 | \concept{motifs} 68 | \concept{preprocessing} 69 | -------------------------------------------------------------------------------- /man/CreateMotifObject.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/objects.R 3 | \name{CreateMotifObject} 4 | \alias{CreateMotifObject} 5 | \title{Create motif object} 6 | \usage{ 7 | CreateMotifObject( 8 | data = NULL, 9 | pwm = NULL, 10 | motif.names = NULL, 11 | positions = NULL, 12 | meta.data = NULL 13 | ) 14 | } 15 | \arguments{ 16 | \item{data}{A motif x region matrix} 17 | 18 | \item{pwm}{A named list of position weight matrices or position frequency 19 | matrices matching the motif names in \code{data}. 20 | Can be of class PFMatrixList.} 21 | 22 | \item{motif.names}{A named list of motif names. List element names 23 | must match the names given in \code{pwm}. If NULL, use the names from the 24 | list of position weight or position frequency matrices. This can be used to 25 | set a alternative common name for the motif. If a PFMatrixList is passed to 26 | \code{pwm}, it will pull the motif name from the PFMatrixList.} 27 | 28 | \item{positions}{A \code{\link[GenomicRanges]{GRangesList}} object containing 29 | exact positions of each motif.} 30 | 31 | \item{meta.data}{A data.frame containing metadata} 32 | } 33 | \value{ 34 | Returns a \code{\link{Motif}} object 35 | } 36 | \description{ 37 | Create a \code{\link{Motif-class}} object. 38 | } 39 | \examples{ 40 | motif.matrix <- matrix( 41 | data = sample(c(0,1), 42 | size = 100, 43 | replace = TRUE), 44 | ncol = 5 45 | ) 46 | motif <- CreateMotifObject(data = motif.matrix) 47 | } 48 | \concept{motifs} 49 | -------------------------------------------------------------------------------- /man/DensityScatter.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/visualization.R 3 | \name{DensityScatter} 4 | \alias{DensityScatter} 5 | \title{Scatterplot colored by point density} 6 | \usage{ 7 | DensityScatter(object, x, y, log_x = FALSE, log_y = FALSE, quantiles = NULL) 8 | } 9 | \arguments{ 10 | \item{object}{A Seurat object} 11 | 12 | \item{x}{Name of metadata variable to plot on x axis} 13 | 14 | \item{y}{Name of metadata variable to plot on y axis} 15 | 16 | \item{log_x}{log10 transform x values} 17 | 18 | \item{log_y}{log10 transform y values} 19 | 20 | \item{quantiles}{Vector of quantiles to display 21 | for x and y data distribution. Must be integer values 22 | between 0 and 100. 23 | TRUE can be passed as a shorthand way to set 24 | \code{c(5, 10, 90, 95)}. If FALSE or NULL, no quantile 25 | information is displayed} 26 | } 27 | \value{ 28 | Returns a ggplot object 29 | } 30 | \description{ 31 | Create a scatterplot using variables in the object metadata 32 | and color cells by the density of points in the x-y space. 33 | } 34 | \concept{visualization} 35 | -------------------------------------------------------------------------------- /man/DepthCor.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/visualization.R 3 | \name{DepthCor} 4 | \alias{DepthCor} 5 | \title{Plot sequencing depth correlation} 6 | \usage{ 7 | DepthCor(object, assay = NULL, reduction = "lsi", n = 10, ...) 8 | } 9 | \arguments{ 10 | \item{object}{A \code{\link[SeuratObject]{Seurat}} object} 11 | 12 | \item{assay}{Name of assay to use for sequencing depth. If NULL, use the 13 | default assay.} 14 | 15 | \item{reduction}{Name of a dimension reduction stored in the 16 | input object} 17 | 18 | \item{n}{Number of components to use. If \code{NULL}, use all components.} 19 | 20 | \item{...}{Additional arguments passed to \code{\link[stats]{cor}}} 21 | } 22 | \value{ 23 | Returns a \code{\link[ggplot2]{ggplot}} object 24 | } 25 | \description{ 26 | Compute the correlation between total counts and each reduced 27 | dimension component. 28 | } 29 | \examples{ 30 | \donttest{ 31 | DepthCor(object = atac_small) 32 | } 33 | } 34 | \concept{visualization} 35 | -------------------------------------------------------------------------------- /man/DownsampleFeatures.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/preprocessing.R 3 | \name{DownsampleFeatures} 4 | \alias{DownsampleFeatures} 5 | \title{Downsample Features} 6 | \usage{ 7 | DownsampleFeatures(object, assay = NULL, n = 20000, verbose = TRUE) 8 | } 9 | \arguments{ 10 | \item{object}{A Seurat object} 11 | 12 | \item{assay}{Name of assay to use. Default is the active assay.} 13 | 14 | \item{n}{Number of features to retain (default 20000).} 15 | 16 | \item{verbose}{Display messages} 17 | } 18 | \value{ 19 | Returns a \code{\link[SeuratObject]{Seurat}} object with 20 | \code{\link[SeuratObject]{VariableFeatures}} set to the randomly sampled features. 21 | } 22 | \description{ 23 | Randomly downsample features and assign to VariableFeatures for the object. 24 | This will select n features at random. 25 | } 26 | \examples{ 27 | DownsampleFeatures(atac_small, n = 10) 28 | } 29 | \concept{preprocessing} 30 | -------------------------------------------------------------------------------- /man/ExpressionPlot.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/visualization.R 3 | \name{ExpressionPlot} 4 | \alias{ExpressionPlot} 5 | \title{Plot gene expression} 6 | \usage{ 7 | ExpressionPlot( 8 | object, 9 | features, 10 | assay = NULL, 11 | group.by = NULL, 12 | idents = NULL, 13 | slot = "data" 14 | ) 15 | } 16 | \arguments{ 17 | \item{object}{A Seurat object} 18 | 19 | \item{features}{A list of features to plot} 20 | 21 | \item{assay}{Name of the assay storing expression information} 22 | 23 | \item{group.by}{A grouping variable to group cells by. If NULL, use the 24 | current cell identities} 25 | 26 | \item{idents}{A list of identities to include in the plot. If NULL, include 27 | all identities} 28 | 29 | \item{slot}{Which slot to pull expression data from} 30 | } 31 | \description{ 32 | Display gene expression values for different groups of cells and different 33 | genes. Genes will be arranged on the x-axis and different groups stacked on 34 | the y-axis, with expression value distribution for each group shown as a 35 | violin plot. This is designed to work alongside a genomic coverage track, 36 | and the plot will be able to be aligned with coverage tracks for the same 37 | groups of cells. 38 | } 39 | \examples{ 40 | \donttest{ 41 | ExpressionPlot(atac_small, features = "TSPAN6", assay = "RNA") 42 | } 43 | } 44 | \concept{visualization} 45 | -------------------------------------------------------------------------------- /man/Extend.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/utilities.R 3 | \name{Extend} 4 | \alias{Extend} 5 | \title{Extend} 6 | \usage{ 7 | Extend(x, upstream = 0, downstream = 0, from.midpoint = FALSE) 8 | } 9 | \arguments{ 10 | \item{x}{A range} 11 | 12 | \item{upstream}{Length to extend upstream} 13 | 14 | \item{downstream}{Length to extend downstream} 15 | 16 | \item{from.midpoint}{Count bases from region midpoint, 17 | rather than the 5' or 3' end for upstream and downstream 18 | respectively.} 19 | } 20 | \value{ 21 | Returns a \code{\link[GenomicRanges]{GRanges}} object 22 | } 23 | \description{ 24 | Resize GenomicRanges upstream and or downstream. 25 | From \url{https://support.bioconductor.org/p/78652/} 26 | } 27 | \examples{ 28 | Extend(x = blacklist_hg19, upstream = 100, downstream = 100) 29 | } 30 | \concept{utilities} 31 | -------------------------------------------------------------------------------- /man/FRiP.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/preprocessing.R 3 | \name{FRiP} 4 | \alias{FRiP} 5 | \title{Calculate fraction of reads in peaks per cell} 6 | \usage{ 7 | FRiP(object, assay, total.fragments, col.name = "FRiP", verbose = TRUE) 8 | } 9 | \arguments{ 10 | \item{object}{A Seurat object} 11 | 12 | \item{assay}{Name of the assay containing a peak x cell matrix} 13 | 14 | \item{total.fragments}{Name of a metadata column containing the total number 15 | of sequenced fragments for each cell. This can be computed using the 16 | \code{\link{CountFragments}} function.} 17 | 18 | \item{col.name}{Name of column in metadata to store the FRiP information.} 19 | 20 | \item{verbose}{Display messages} 21 | } 22 | \value{ 23 | Returns a \code{\link[SeuratObject]{Seurat}} object 24 | } 25 | \description{ 26 | Calculate fraction of reads in peaks per cell 27 | } 28 | \examples{ 29 | FRiP(object = atac_small, assay = 'peaks', total.fragments = "fragments") 30 | } 31 | \concept{qc} 32 | -------------------------------------------------------------------------------- /man/FeatureMatrix.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/quantification.R 3 | \name{FeatureMatrix} 4 | \alias{FeatureMatrix} 5 | \title{Feature Matrix} 6 | \usage{ 7 | FeatureMatrix( 8 | fragments, 9 | features, 10 | cells = NULL, 11 | process_n = 2000, 12 | sep = c("-", "-"), 13 | verbose = TRUE 14 | ) 15 | } 16 | \arguments{ 17 | \item{fragments}{A list of \code{\link{Fragment}} objects. Note that if 18 | setting the \code{cells} parameter, the requested cells should be present in 19 | the supplied \code{Fragment} objects. However, if the cells information in 20 | the fragment object is not set (\code{Cells(fragments)} is \code{NULL}), then 21 | the fragment object will still be searched.} 22 | 23 | \item{features}{A GRanges object containing a set of genomic intervals. 24 | These will form the rows of the matrix, with each entry recording the number 25 | of unique reads falling in the genomic region for each cell. If a genomic 26 | region provided is on a chromosome that is not present in the fragment file, 27 | it will not be included in the returned matrix.} 28 | 29 | \item{cells}{Vector of cells to include. If NULL, include all cells found 30 | in the fragments file} 31 | 32 | \item{process_n}{Number of regions to load into memory at a time, per thread. 33 | Processing more regions at once can be faster but uses more memory.} 34 | 35 | \item{sep}{Vector of separators to use for genomic string. First element is 36 | used to separate chromosome and coordinates, second separator is used to 37 | separate start and end coordinates.} 38 | 39 | \item{verbose}{Display messages} 40 | } 41 | \value{ 42 | Returns a sparse matrix 43 | } 44 | \description{ 45 | Construct a feature x cell matrix from a genomic fragments file 46 | } 47 | \examples{ 48 | fpath <- system.file("extdata", "fragments.tsv.gz", package="Signac") 49 | fragments <- CreateFragmentObject(fpath) 50 | FeatureMatrix( 51 | fragments = fragments, 52 | features = granges(atac_small) 53 | ) 54 | } 55 | \concept{quantification} 56 | -------------------------------------------------------------------------------- /man/FilterCells.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/fragments.R 3 | \name{FilterCells} 4 | \alias{FilterCells} 5 | \title{Filter cells from fragment file} 6 | \usage{ 7 | FilterCells( 8 | fragments, 9 | cells, 10 | outfile = NULL, 11 | buffer_length = 256L, 12 | verbose = TRUE 13 | ) 14 | } 15 | \arguments{ 16 | \item{fragments}{Path to a fragment file} 17 | 18 | \item{cells}{A vector of cells to keep} 19 | 20 | \item{outfile}{Name for output file} 21 | 22 | \item{buffer_length}{Size of buffer to be read from the fragment file. This 23 | must be longer than the longest line in the file.} 24 | 25 | \item{verbose}{Display messages} 26 | } 27 | \description{ 28 | Remove all fragments that are not from an allowed set of cell barcodes from 29 | the fragment file. This will create a new file on disk that only contains 30 | fragments from cells specified in the \code{cells} argument. The output file 31 | is block gzip-compressed and indexed, ready for use with Signac functions. 32 | } 33 | \examples{ 34 | fpath <- system.file("extdata", "fragments.tsv.gz", package="Signac") 35 | tmpf <- tempfile(fileext = ".gz") 36 | FilterCells( 37 | fragments = fpath, 38 | cells = head(colnames(atac_small)), 39 | outfile = tmpf 40 | ) 41 | file.remove(tmpf) 42 | } 43 | \concept{fragments} 44 | -------------------------------------------------------------------------------- /man/FindClonotypes.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/mito.R 3 | \name{FindClonotypes} 4 | \alias{FindClonotypes} 5 | \title{Find clonotypes} 6 | \usage{ 7 | FindClonotypes( 8 | object, 9 | assay = NULL, 10 | features = NULL, 11 | metric = "cosine", 12 | resolution = 1, 13 | k = 10, 14 | algorithm = 3 15 | ) 16 | } 17 | \arguments{ 18 | \item{object}{A Seurat object} 19 | 20 | \item{assay}{Name of assay to use} 21 | 22 | \item{features}{Features to include when constructing neighbor graph} 23 | 24 | \item{metric}{Distance metric to use} 25 | 26 | \item{resolution}{Clustering resolution to use. See 27 | \code{\link[Seurat]{FindClusters}}} 28 | 29 | \item{k}{Passed to \code{k.param} argument in 30 | \code{\link[Seurat]{FindNeighbors}}} 31 | 32 | \item{algorithm}{Community detection algorithm to use. See 33 | \code{\link[Seurat]{FindClusters}}} 34 | } 35 | \value{ 36 | Returns a \code{\link[SeuratObject]{Seurat}} object 37 | } 38 | \description{ 39 | Identify groups of related cells from allele frequency data. This will 40 | cluster the cells based on their allele frequencies, reorder the factor 41 | levels for the cluster identities by hierarchical clustering the collapsed 42 | (pseudobulk) cluster allele frequencies, and set the variable features for 43 | the allele frequency assay to the order of features defined by hierarchical 44 | clustering. 45 | } 46 | \concept{mito} 47 | -------------------------------------------------------------------------------- /man/FindMotifs.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/motifs.R 3 | \name{FindMotifs} 4 | \alias{FindMotifs} 5 | \title{FindMotifs} 6 | \usage{ 7 | FindMotifs( 8 | object, 9 | features, 10 | background = 40000, 11 | assay = NULL, 12 | verbose = TRUE, 13 | p.adjust.method = "BH", 14 | ... 15 | ) 16 | } 17 | \arguments{ 18 | \item{object}{A Seurat object} 19 | 20 | \item{features}{A vector of features to test for enrichments over background} 21 | 22 | \item{background}{Either a vector of features to use as the background set, 23 | or a number specify the number of features to randomly select as a background 24 | set. If a number is provided, regions will be selected to match the sequence 25 | characteristics of the query features. To match the sequence characteristics, 26 | these characteristics must be stored in the feature metadata for the assay. 27 | This can be added using the 28 | \code{\link{RegionStats}} function. If NULL, use all features in the assay.} 29 | 30 | \item{assay}{Which assay to use. Default is the active assay} 31 | 32 | \item{verbose}{Display messages} 33 | 34 | \item{p.adjust.method}{Multiple testing correction method to be applied. 35 | Passed to \code{\link[stats]{p.adjust}}.} 36 | 37 | \item{...}{Arguments passed to \code{\link{MatchRegionStats}}.} 38 | } 39 | \value{ 40 | Returns a data frame 41 | } 42 | \description{ 43 | Find motifs over-represented in a given set of genomic features. 44 | Computes the number of features containing the motif (observed) and 45 | compares this to the total number of features containing the 46 | motif (background) using the hypergeometric test. 47 | } 48 | \examples{ 49 | de.motif <- head(rownames(atac_small)) 50 | bg.peaks <- tail(rownames(atac_small)) 51 | FindMotifs( 52 | object = atac_small, 53 | features = de.motif, 54 | background = bg.peaks 55 | ) 56 | } 57 | \concept{motifs} 58 | -------------------------------------------------------------------------------- /man/FindTopFeatures.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/generics.R, R/preprocessing.R 3 | \name{FindTopFeatures} 4 | \alias{FindTopFeatures} 5 | \alias{FindTopFeatures.default} 6 | \alias{FindTopFeatures.Assay} 7 | \alias{FindTopFeatures.StdAssay} 8 | \alias{FindTopFeatures.Seurat} 9 | \title{Find most frequently observed features} 10 | \usage{ 11 | FindTopFeatures(object, ...) 12 | 13 | \method{FindTopFeatures}{default}(object, assay = NULL, min.cutoff = "q5", verbose = TRUE, ...) 14 | 15 | \method{FindTopFeatures}{Assay}(object, assay = NULL, min.cutoff = "q5", verbose = TRUE, ...) 16 | 17 | \method{FindTopFeatures}{StdAssay}(object, assay = NULL, min.cutoff = "q5", verbose = TRUE, ...) 18 | 19 | \method{FindTopFeatures}{Seurat}(object, assay = NULL, min.cutoff = "q5", verbose = TRUE, ...) 20 | } 21 | \arguments{ 22 | \item{object}{A Seurat object} 23 | 24 | \item{...}{Arguments passed to other methods} 25 | 26 | \item{assay}{Name of assay to use} 27 | 28 | \item{min.cutoff}{Cutoff for feature to be included in the VariableFeatures 29 | for the object. This can be a percentile specified as 'q' followed by the 30 | minimum percentile, for example 'q5' to set the top 95\% most common features 31 | as the VariableFeatures for the object. Alternatively, this can be an integer 32 | specifying the minimum number of counts for the feature 33 | to be included in the set of VariableFeatures. For example, setting to 10 34 | will include features with >10 total counts in the set of VariableFeatures. If NULL, 35 | include all features in VariableFeatures. If NA, VariableFeatures will not be 36 | altered, and only the feature metadata will be updated with the total counts 37 | and percentile rank for each feature.} 38 | 39 | \item{verbose}{Display messages} 40 | } 41 | \value{ 42 | Returns a \code{\link[SeuratObject]{Seurat}} object 43 | } 44 | \description{ 45 | Find top features for a given assay based on total number of counts for the 46 | feature. Can specify a minimum cell count, or a lower percentile 47 | bound to determine the set of variable features. Running this function will 48 | store the total counts and percentile rank for each feature in the feature 49 | metadata for the assay. To only compute the feature metadata, without 50 | changing the variable features for the assay, set \code{min.cutoff=NA}. 51 | } 52 | \examples{ 53 | FindTopFeatures(object = atac_small[['peaks']]['data']) 54 | FindTopFeatures(object = atac_small[['peaks']]) 55 | FindTopFeatures(object = atac_small[['peaks']]) 56 | FindTopFeatures(atac_small) 57 | } 58 | \concept{preprocessing} 59 | -------------------------------------------------------------------------------- /man/Footprint.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/generics.R, R/footprinting.R 3 | \name{Footprint} 4 | \alias{Footprint} 5 | \alias{Footprint.ChromatinAssay} 6 | \alias{Footprint.Seurat} 7 | \title{Transcription factor footprinting analysis} 8 | \usage{ 9 | Footprint(object, ...) 10 | 11 | \method{Footprint}{ChromatinAssay}( 12 | object, 13 | genome, 14 | motif.name = NULL, 15 | key = motif.name, 16 | regions = NULL, 17 | assay = NULL, 18 | upstream = 250, 19 | downstream = 250, 20 | compute.expected = TRUE, 21 | in.peaks = FALSE, 22 | verbose = TRUE, 23 | ... 24 | ) 25 | 26 | \method{Footprint}{Seurat}( 27 | object, 28 | genome, 29 | regions = NULL, 30 | motif.name = NULL, 31 | assay = NULL, 32 | upstream = 250, 33 | downstream = 250, 34 | in.peaks = FALSE, 35 | verbose = TRUE, 36 | ... 37 | ) 38 | } 39 | \arguments{ 40 | \item{object}{A Seurat or ChromatinAssay object} 41 | 42 | \item{...}{Arguments passed to other methods} 43 | 44 | \item{genome}{A \code{BSgenome} object or any other object supported by 45 | \code{getSeq}. Do \code{showMethods("getSeq")} to get the list of all 46 | supported object types.} 47 | 48 | \item{motif.name}{Name of a motif stored in the assay to footprint. If not 49 | supplied, must supply a set of regions.} 50 | 51 | \item{key}{Key to store positional enrichment information under.} 52 | 53 | \item{regions}{A set of genomic ranges containing the motif instances. These 54 | should all be the same width.} 55 | 56 | \item{assay}{Name of assay to use} 57 | 58 | \item{upstream}{Number of bases to extend upstream} 59 | 60 | \item{downstream}{Number of bases to extend downstream} 61 | 62 | \item{compute.expected}{Find the expected number of insertions at each 63 | position given the local DNA sequence context and the insertion bias of Tn5} 64 | 65 | \item{in.peaks}{Restrict motifs to those that fall in peaks} 66 | 67 | \item{verbose}{Display messages} 68 | } 69 | \value{ 70 | Returns a \code{\link[SeuratObject]{Seurat}} object 71 | } 72 | \description{ 73 | Compute the normalized observed/expected Tn5 insertion frequency 74 | for each position surrounding a set of motif instances. 75 | } 76 | \concept{footprinting} 77 | -------------------------------------------------------------------------------- /man/FractionCountsInRegion.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/utilities.R 3 | \name{FractionCountsInRegion} 4 | \alias{FractionCountsInRegion} 5 | \title{Fraction of counts in a genomic region} 6 | \usage{ 7 | FractionCountsInRegion(object, regions, assay = NULL, ...) 8 | } 9 | \arguments{ 10 | \item{object}{A Seurat object} 11 | 12 | \item{regions}{A GRanges object containing a set of genomic regions} 13 | 14 | \item{assay}{Name of assay to use} 15 | 16 | \item{...}{Additional arguments passed to \code{\link{CountsInRegion}}} 17 | } 18 | \value{ 19 | Returns a numeric vector 20 | } 21 | \description{ 22 | Find the fraction of counts per cell that overlap a given set of genomic 23 | ranges 24 | } 25 | \examples{ 26 | \dontrun{ 27 | FractionCountsInRegion( 28 | object = atac_small, 29 | assay = 'bins', 30 | regions = blacklist_hg19 31 | ) 32 | } 33 | } 34 | \concept{utilities} 35 | -------------------------------------------------------------------------------- /man/Fragment-class.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/objects.R 3 | \docType{class} 4 | \name{Fragment-class} 5 | \alias{Fragment-class} 6 | \alias{Fragment} 7 | \title{The Fragment class} 8 | \description{ 9 | The Fragment class is designed to hold information needed for working with 10 | fragment files. 11 | } 12 | \section{Slots}{ 13 | 14 | \describe{ 15 | \item{\code{path}}{Path to the fragment file on disk. 16 | See \url{https://support.10xgenomics.com/single-cell-atac/software/pipelines/latest/output/fragments}} 17 | 18 | \item{\code{hash}}{A vector of two md5sums: first element is the md5sum of the 19 | fragment file, the second element is the md5sum of the index.} 20 | 21 | \item{\code{cells}}{A named vector of cells where each element is the cell barcode 22 | as it appears in the fragment file, and the name of each element is the 23 | corresponding cell barcode as stored in the ChromatinAssay object.} 24 | }} 25 | 26 | \concept{fragments} 27 | -------------------------------------------------------------------------------- /man/FragmentHistogram.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/visualization.R 3 | \name{FragmentHistogram} 4 | \alias{FragmentHistogram} 5 | \title{Plot fragment length histogram} 6 | \usage{ 7 | FragmentHistogram( 8 | object, 9 | assay = NULL, 10 | region = "chr1-1-2000000", 11 | group.by = NULL, 12 | cells = NULL, 13 | log.scale = FALSE, 14 | ... 15 | ) 16 | } 17 | \arguments{ 18 | \item{object}{A Seurat object} 19 | 20 | \item{assay}{Which assay to use. Default is the active assay.} 21 | 22 | \item{region}{Genomic range to use. Default is fist two megabases of 23 | chromosome 1. Can be a GRanges object, a string, or a vector 24 | of strings.} 25 | 26 | \item{group.by}{Name of one or more metadata columns to group (color) the 27 | cells by. Default is the current cell identities} 28 | 29 | \item{cells}{Which cells to plot. Default all cells} 30 | 31 | \item{log.scale}{Display Y-axis on log scale. Default is FALSE.} 32 | 33 | \item{...}{Arguments passed to other functions} 34 | } 35 | \value{ 36 | Returns a \code{\link[ggplot2]{ggplot}} object 37 | } 38 | \description{ 39 | Plot the frequency that fragments of different lengths are present for 40 | different groups of cells. 41 | } 42 | \examples{ 43 | \donttest{ 44 | fpath <- system.file("extdata", "fragments.tsv.gz", package="Signac") 45 | Fragments(atac_small) <- CreateFragmentObject( 46 | path = fpath, 47 | cells = colnames(atac_small), 48 | validate.fragments = FALSE 49 | ) 50 | FragmentHistogram(object = atac_small, region = "chr1-10245-780007") 51 | } 52 | } 53 | \concept{qc} 54 | \concept{visualization} 55 | -------------------------------------------------------------------------------- /man/Fragments.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/generics.R, R/objects.R 3 | \name{Fragments} 4 | \alias{Fragments} 5 | \alias{Fragments<-} 6 | \alias{Fragments.ChromatinAssay} 7 | \alias{Fragments.Seurat} 8 | \alias{Fragments<-.ChromatinAssay} 9 | \alias{Fragments<-.Seurat} 10 | \title{Get the Fragment objects} 11 | \usage{ 12 | Fragments(object, ...) 13 | 14 | Fragments(object, ...) <- value 15 | 16 | \method{Fragments}{ChromatinAssay}(object, ...) 17 | 18 | \method{Fragments}{Seurat}(object, ...) 19 | 20 | \method{Fragments}{ChromatinAssay}(object, ...) <- value 21 | 22 | \method{Fragments}{Seurat}(object, ...) <- value 23 | } 24 | \arguments{ 25 | \item{object}{A Seurat object or ChromatinAssay object} 26 | 27 | \item{...}{Arguments passed to other methods} 28 | 29 | \item{value}{A \code{\link{Fragment}} object or list of Fragment objects} 30 | } 31 | \value{ 32 | Returns a list of \code{\link{Fragment}} objects. If there are 33 | no Fragment objects present, returns an empty list. 34 | } 35 | \description{ 36 | Get the Fragment objects 37 | } 38 | \examples{ 39 | Fragments(atac_small[["peaks"]]) 40 | Fragments(atac_small) 41 | fpath <- system.file("extdata", "fragments.tsv.gz", package="Signac") 42 | fragments <- CreateFragmentObject( 43 | path = fpath, 44 | cells = colnames(atac_small), 45 | validate.fragments = FALSE 46 | ) 47 | Fragments(atac_small[["bins"]]) <- fragments 48 | fpath <- system.file("extdata", "fragments.tsv.gz", package="Signac") 49 | fragments <- CreateFragmentObject( 50 | path = fpath, 51 | cells = colnames(atac_small), 52 | validate.fragments = FALSE 53 | ) 54 | Fragments(atac_small) <- fragments 55 | } 56 | \concept{assay} 57 | \concept{fragments} 58 | -------------------------------------------------------------------------------- /man/GRangesToString.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/utilities.R 3 | \name{GRangesToString} 4 | \alias{GRangesToString} 5 | \title{GRanges to String} 6 | \usage{ 7 | GRangesToString(grange, sep = c("-", "-")) 8 | } 9 | \arguments{ 10 | \item{grange}{A GRanges object} 11 | 12 | \item{sep}{Vector of separators to use for genomic string. First element is 13 | used to separate chromosome and coordinates, second separator is used to 14 | separate start and end coordinates.} 15 | } 16 | \value{ 17 | Returns a character vector 18 | } 19 | \description{ 20 | Convert GRanges object to a vector of strings 21 | } 22 | \examples{ 23 | GRangesToString(grange = blacklist_hg19) 24 | } 25 | \concept{utilities} 26 | -------------------------------------------------------------------------------- /man/GeneActivity.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/utilities.R 3 | \name{GeneActivity} 4 | \alias{GeneActivity} 5 | \title{Create gene activity matrix} 6 | \usage{ 7 | GeneActivity( 8 | object, 9 | assay = NULL, 10 | features = NULL, 11 | extend.upstream = 2000, 12 | extend.downstream = 0, 13 | biotypes = "protein_coding", 14 | max.width = 5e+05, 15 | process_n = 2000, 16 | gene.id = FALSE, 17 | verbose = TRUE 18 | ) 19 | } 20 | \arguments{ 21 | \item{object}{A Seurat object} 22 | 23 | \item{assay}{Name of assay to use. If NULL, use the default assay} 24 | 25 | \item{features}{Genes to include. If NULL, use all protein-coding genes in 26 | the annotations stored in the object} 27 | 28 | \item{extend.upstream}{Number of bases to extend upstream of the TSS} 29 | 30 | \item{extend.downstream}{Number of bases to extend downstream of the TTS} 31 | 32 | \item{biotypes}{Gene biotypes to include. If NULL, use all biotypes in the 33 | gene annotation.} 34 | 35 | \item{max.width}{Maximum allowed gene width for a gene to be quantified. 36 | Setting this parameter can avoid quantifying extremely long transcripts that 37 | can add a relatively long amount of time. If NULL, do not filter genes based 38 | on width.} 39 | 40 | \item{process_n}{Number of regions to load into memory at a time, per thread. 41 | Processing more regions at once can be faster but uses more memory.} 42 | 43 | \item{gene.id}{Record gene IDs in output matrix rather than gene name.} 44 | 45 | \item{verbose}{Display messages} 46 | } 47 | \value{ 48 | Returns a sparse matrix 49 | } 50 | \description{ 51 | Compute counts per cell in gene body and promoter region. 52 | } 53 | \examples{ 54 | fpath <- system.file("extdata", "fragments.tsv.gz", package="Signac") 55 | fragments <- CreateFragmentObject( 56 | path = fpath, 57 | cells = colnames(atac_small), 58 | validate.fragments = FALSE 59 | ) 60 | Fragments(atac_small) <- fragments 61 | GeneActivity(atac_small) 62 | } 63 | \concept{utilities} 64 | -------------------------------------------------------------------------------- /man/GenomeBinMatrix.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/quantification.R 3 | \name{GenomeBinMatrix} 4 | \alias{GenomeBinMatrix} 5 | \title{Genome bin matrix} 6 | \usage{ 7 | GenomeBinMatrix( 8 | fragments, 9 | genome, 10 | cells = NULL, 11 | binsize = 5000, 12 | process_n = 2000, 13 | sep = c("-", "-"), 14 | verbose = TRUE 15 | ) 16 | } 17 | \arguments{ 18 | \item{fragments}{Path to tabix-indexed fragments file or a list of 19 | \code{\link{Fragment}} objects} 20 | 21 | \item{genome}{A vector of chromosome sizes for the genome. This is used to 22 | construct the genome bin coordinates. The can be obtained by calling 23 | \code{\link[GenomeInfoDb]{seqlengths}} on a 24 | \code{\link[BSgenome]{BSgenome-class}} object.} 25 | 26 | \item{cells}{Vector of cells to include. If NULL, include all cells found 27 | in the fragments file} 28 | 29 | \item{binsize}{Size of the genome bins to use} 30 | 31 | \item{process_n}{Number of regions to load into memory at a time, per thread. 32 | Processing more regions at once can be faster but uses more memory.} 33 | 34 | \item{sep}{Vector of separators to use for genomic string. First element is 35 | used to separate chromosome and coordinates, second separator is used to 36 | separate start and end coordinates.} 37 | 38 | \item{verbose}{Display messages} 39 | } 40 | \value{ 41 | Returns a sparse matrix 42 | } 43 | \description{ 44 | Construct a bin x cell matrix from a fragments file. 45 | } 46 | \details{ 47 | This function bins the genome and calls \code{\link{FeatureMatrix}} to 48 | construct a bin x cell matrix. 49 | } 50 | \examples{ 51 | \donttest{ 52 | genome <- 780007 53 | names(genome) <- 'chr1' 54 | fpath <- system.file("extdata", "fragments.tsv.gz", package="Signac") 55 | fragments <- CreateFragmentObject(fpath) 56 | GenomeBinMatrix( 57 | fragments = fragments, 58 | genome = genome, 59 | binsize = 1000 60 | ) 61 | } 62 | } 63 | \concept{quantification} 64 | -------------------------------------------------------------------------------- /man/GetCellsInRegion.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/utilities.R 3 | \name{GetCellsInRegion} 4 | \alias{GetCellsInRegion} 5 | \title{Get cells in a region} 6 | \usage{ 7 | GetCellsInRegion(tabix, region, cells = NULL) 8 | } 9 | \arguments{ 10 | \item{tabix}{Tabix object} 11 | 12 | \item{region}{A string giving the region to extract from the fragments file} 13 | 14 | \item{cells}{Vector of cells to include in output. If NULL, include all cells} 15 | } 16 | \value{ 17 | Returns a list 18 | } 19 | \description{ 20 | Extract cell names containing reads mapped within a given genomic region 21 | } 22 | \examples{ 23 | fpath <- system.file("extdata", "fragments.tsv.gz", package="Signac") 24 | GetCellsInRegion(tabix = fpath, region = "chr1-10245-762629") 25 | } 26 | \concept{utilities} 27 | -------------------------------------------------------------------------------- /man/GetFootprintData.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/footprinting.R 3 | \name{GetFootprintData} 4 | \alias{GetFootprintData} 5 | \title{Get footprinting data} 6 | \usage{ 7 | GetFootprintData( 8 | object, 9 | features, 10 | assay = NULL, 11 | group.by = NULL, 12 | idents = NULL 13 | ) 14 | } 15 | \arguments{ 16 | \item{object}{A Seurat object} 17 | 18 | \item{features}{A vector of features to extract data for} 19 | 20 | \item{assay}{Name of assay to use} 21 | 22 | \item{group.by}{A grouping variable} 23 | 24 | \item{idents}{Set of identities to group cells by} 25 | } 26 | \value{ 27 | Returns a data.frame with the following columns: 28 | \itemize{ 29 | \item{group: Cell group (determined by group.by parameter} 30 | \item{position: Position relative to motif center} 31 | \item{count: Normalized Tn5 insertion counts at each position} 32 | \item{norm.value: Normalized Tn5 insertion counts at each position (same as count)} 33 | \item{feature: Name of the footprinted motif} 34 | \item{class: observed or expected} 35 | } 36 | } 37 | \description{ 38 | Extract footprint data for a set of transcription factors or metafeatures. 39 | This function will pull accessibility data for a given feature (eg, a TF), 40 | and perform background normalization for each identity class. This is the 41 | data that's used to create TF footprinting plots with the 42 | \code{PlotFootprint} function. 43 | } 44 | \concept{footprinting} 45 | -------------------------------------------------------------------------------- /man/GetFragmentData.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/objects.R 3 | \name{GetFragmentData} 4 | \alias{GetFragmentData} 5 | \title{Get Fragment object data} 6 | \usage{ 7 | GetFragmentData(object, slot = "path") 8 | } 9 | \arguments{ 10 | \item{object}{A \code{\link{Fragment}} object} 11 | 12 | \item{slot}{Information to pull from object (path, hash, cells, prefix, suffix)} 13 | } 14 | \description{ 15 | Extract data from a \code{\link{Fragment-class}} object 16 | } 17 | \concept{assay} 18 | -------------------------------------------------------------------------------- /man/GetGRangesFromEnsDb.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/utilities.R 3 | \name{GetGRangesFromEnsDb} 4 | \alias{GetGRangesFromEnsDb} 5 | \title{Extract genomic ranges from EnsDb object} 6 | \usage{ 7 | GetGRangesFromEnsDb( 8 | ensdb, 9 | standard.chromosomes = TRUE, 10 | biotypes = c("protein_coding", "lincRNA", "rRNA", "processed_transcript"), 11 | verbose = TRUE 12 | ) 13 | } 14 | \arguments{ 15 | \item{ensdb}{An EnsDb object} 16 | 17 | \item{standard.chromosomes}{Keep only standard chromosomes} 18 | 19 | \item{biotypes}{Biotypes to keep} 20 | 21 | \item{verbose}{Display messages} 22 | } 23 | \description{ 24 | Pulls the transcript information for all chromosomes from an EnsDb object. 25 | This wraps \code{\link[biovizBase]{crunch}} and applies the extractor 26 | function to all chromosomes present in the EnsDb object. 27 | } 28 | \concept{utilities} 29 | -------------------------------------------------------------------------------- /man/GetIntersectingFeatures.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/utilities.R 3 | \name{GetIntersectingFeatures} 4 | \alias{GetIntersectingFeatures} 5 | \title{Find intersecting regions between two objects} 6 | \usage{ 7 | GetIntersectingFeatures( 8 | object.1, 9 | object.2, 10 | assay.1 = NULL, 11 | assay.2 = NULL, 12 | distance = 0, 13 | verbose = TRUE 14 | ) 15 | } 16 | \arguments{ 17 | \item{object.1}{The first Seurat object} 18 | 19 | \item{object.2}{The second Seurat object} 20 | 21 | \item{assay.1}{Name of the assay to use in the first object. If NULL, use 22 | the default assay} 23 | 24 | \item{assay.2}{Name of the assay to use in the second object. If NULL, use 25 | the default assay} 26 | 27 | \item{distance}{Maximum distance between regions allowed for an intersection 28 | to be recorded. Default is 0.} 29 | 30 | \item{verbose}{Display messages} 31 | } 32 | \value{ 33 | Returns a list of two character vectors containing the row names 34 | in each object that overlap each other. 35 | } 36 | \description{ 37 | Intersects the regions stored in the rownames of two objects and 38 | returns a vector containing the names of rows that intersect 39 | for each object. The order of the row names return corresponds 40 | to the intersecting regions, i.e. the nth feature of the first vector 41 | will intersect the nth feature in the second vector. A distance 42 | parameter can be given, in which case features within the given 43 | distance will be called as intersecting. 44 | } 45 | \examples{ 46 | GetIntersectingFeatures( 47 | object.1 = atac_small, 48 | object.2 = atac_small, 49 | assay.1 = 'peaks', 50 | assay.2 = 'bins' 51 | ) 52 | } 53 | \concept{utilities} 54 | -------------------------------------------------------------------------------- /man/GetLinkedGenes.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/links.R 3 | \name{GetLinkedGenes} 4 | \alias{GetLinkedGenes} 5 | \title{Get genes linked to peaks} 6 | \usage{ 7 | GetLinkedGenes(object, features, assay = NULL, min.abs.score = 0) 8 | } 9 | \arguments{ 10 | \item{object}{A Seurat object} 11 | 12 | \item{features}{A list of peaks to find linked genes for} 13 | 14 | \item{assay}{Name of assay to use. If NULL, use the default assay} 15 | 16 | \item{min.abs.score}{Minimum absolute value of the link score for a link to 17 | be returned} 18 | } 19 | \description{ 20 | Retrieve peak-gene links for a given set of genes. Links must be first 21 | obtained by running the \code{LinkPeaks} function. 22 | } 23 | \details{ 24 | This function is designed to obtain the stored results from running the 25 | \code{LinkPeaks} function. Alternatively, custom peak-gene linkage methods 26 | can be used as long as they store the gene name, peak name, and a peak-gene 27 | score information as metadata columns named "gene," "peak," and "score" 28 | respectively. 29 | } 30 | \seealso{ 31 | GetLinkedPeaks 32 | } 33 | \concept{links} 34 | -------------------------------------------------------------------------------- /man/GetLinkedPeaks.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/links.R 3 | \name{GetLinkedPeaks} 4 | \alias{GetLinkedPeaks} 5 | \title{Get peaks linked to genes} 6 | \usage{ 7 | GetLinkedPeaks(object, features, assay = NULL, min.abs.score = 0) 8 | } 9 | \arguments{ 10 | \item{object}{A Seurat object} 11 | 12 | \item{features}{A list of genes to find linked peaks for} 13 | 14 | \item{assay}{Name of assay to use. If NULL, use the default assay} 15 | 16 | \item{min.abs.score}{Minimum absolute value of the link score for a link to 17 | be returned} 18 | } 19 | \description{ 20 | Retrieve peak-gene links for a given set of genes. Links must be first 21 | obtained by running the \code{LinkPeaks} function. 22 | } 23 | \details{ 24 | This function is designed to obtain the stored results from running the 25 | \code{LinkPeaks} function. Alternatively, custom peak-gene linkage methods 26 | can be used as long as they store the gene name, peak name, and a peak-gene 27 | score information as metadata columns named "gene," "peak," and "score" 28 | respectively. 29 | } 30 | \seealso{ 31 | GetLinkedGenes 32 | } 33 | \concept{links} 34 | -------------------------------------------------------------------------------- /man/GetMotifData.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/generics.R, R/objects.R 3 | \name{GetMotifData} 4 | \alias{GetMotifData} 5 | \alias{GetMotifData.Motif} 6 | \alias{GetMotifData.ChromatinAssay} 7 | \alias{GetMotifData.Seurat} 8 | \title{Retrieve a motif matrix} 9 | \usage{ 10 | GetMotifData(object, ...) 11 | 12 | \method{GetMotifData}{Motif}(object, slot = "data", ...) 13 | 14 | \method{GetMotifData}{ChromatinAssay}(object, slot = "data", ...) 15 | 16 | \method{GetMotifData}{Seurat}(object, assay = NULL, slot = "data", ...) 17 | } 18 | \arguments{ 19 | \item{object}{A Seurat object} 20 | 21 | \item{...}{Arguments passed to other methods} 22 | 23 | \item{slot}{Information to pull from object (data, pwm, meta.data)} 24 | 25 | \item{assay}{Which assay to use. Default is the current active assay} 26 | } 27 | \value{ 28 | Returns a \code{\link[SeuratObject]{Seurat}} object 29 | } 30 | \description{ 31 | Get motif matrix for given assay 32 | } 33 | \examples{ 34 | motif.obj <- SeuratObject::GetAssayData( 35 | object = atac_small[['peaks']], slot = "motifs" 36 | ) 37 | GetMotifData(object = motif.obj) 38 | GetMotifData(object = atac_small) 39 | } 40 | \concept{motifs} 41 | -------------------------------------------------------------------------------- /man/GetTSSPositions.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/utilities.R 3 | \name{GetTSSPositions} 4 | \alias{GetTSSPositions} 5 | \title{Find transcriptional start sites} 6 | \usage{ 7 | GetTSSPositions(ranges, biotypes = "protein_coding") 8 | } 9 | \arguments{ 10 | \item{ranges}{A GRanges object containing gene annotations.} 11 | 12 | \item{biotypes}{Gene biotypes to include. If NULL, use all biotypes in the 13 | supplied gene annotation.} 14 | } 15 | \description{ 16 | Get the TSS positions from a set of genomic ranges containing gene positions. 17 | Ranges can contain exons, introns, UTRs, etc, rather than the whole 18 | transcript. Only protein coding gene biotypes are included in output. 19 | } 20 | \concept{utilities} 21 | -------------------------------------------------------------------------------- /man/IdentifyVariants.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/generics.R, R/mito.R 3 | \name{IdentifyVariants} 4 | \alias{IdentifyVariants} 5 | \alias{IdentifyVariants.default} 6 | \alias{IdentifyVariants.Assay} 7 | \alias{IdentifyVariants.StdAssay} 8 | \alias{IdentifyVariants.Seurat} 9 | \title{Identify mitochondrial variants} 10 | \usage{ 11 | IdentifyVariants(object, ...) 12 | 13 | \method{IdentifyVariants}{default}( 14 | object, 15 | refallele, 16 | stabilize_variance = TRUE, 17 | low_coverage_threshold = 10, 18 | verbose = TRUE, 19 | ... 20 | ) 21 | 22 | \method{IdentifyVariants}{Assay}(object, refallele, ...) 23 | 24 | \method{IdentifyVariants}{StdAssay}(object, refallele, ...) 25 | 26 | \method{IdentifyVariants}{Seurat}(object, refallele, assay = NULL, ...) 27 | } 28 | \arguments{ 29 | \item{object}{A Seurat object} 30 | 31 | \item{...}{Arguments passed to other methods} 32 | 33 | \item{refallele}{A dataframe containing reference alleles for the 34 | mitochondrial genome.} 35 | 36 | \item{stabilize_variance}{Stabilize variance} 37 | 38 | \item{low_coverage_threshold}{Low coverage threshold} 39 | 40 | \item{verbose}{Display messages} 41 | 42 | \item{assay}{Name of assay to use. If NULL, use the default assay.} 43 | } 44 | \value{ 45 | Returns a dataframe 46 | } 47 | \description{ 48 | Identify mitochondrial variants present in single cells. 49 | } 50 | \examples{ 51 | \dontrun{ 52 | data.dir <- "path/to/data/directory" 53 | mgatk <- ReadMGATK(dir = data.dir) 54 | variant.df <- IdentifyVariants( 55 | object = mgatk$counts, 56 | refallele = mgatk$refallele 57 | ) 58 | } 59 | } 60 | \concept{mito} 61 | -------------------------------------------------------------------------------- /man/InsertionBias.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/generics.R, R/footprinting.R 3 | \name{InsertionBias} 4 | \alias{InsertionBias} 5 | \alias{InsertionBias.ChromatinAssay} 6 | \alias{InsertionBias.Seurat} 7 | \title{Compute Tn5 insertion bias} 8 | \usage{ 9 | InsertionBias(object, ...) 10 | 11 | \method{InsertionBias}{ChromatinAssay}(object, genome, region = "chr1-1-249250621", verbose = TRUE, ...) 12 | 13 | \method{InsertionBias}{Seurat}( 14 | object, 15 | genome, 16 | assay = NULL, 17 | region = "chr1-1-249250621", 18 | verbose = TRUE, 19 | ... 20 | ) 21 | } 22 | \arguments{ 23 | \item{object}{A Seurat or ChromatinAssay object} 24 | 25 | \item{...}{Additional arguments passed to \code{\link{StringToGRanges}}} 26 | 27 | \item{genome}{A \code{BSgenome} object or any other object supported by 28 | \code{getSeq}. Do \code{showMethods("getSeq")} to get the list of all 29 | supported object types.} 30 | 31 | \item{region}{Genomic region to use when assessing bias.} 32 | 33 | \item{verbose}{Display messages} 34 | 35 | \item{assay}{Name of assay to use} 36 | } 37 | \value{ 38 | Returns a Seurat object 39 | } 40 | \description{ 41 | Counts the Tn5 insertion frequency for each DNA hexamer. 42 | } 43 | \examples{ 44 | \dontrun{ 45 | library(BSgenome.Mmusculus.UCSC.mm10) 46 | 47 | region.use <- GRanges( 48 | seqnames = c('chr1', 'chr2'), 49 | IRanges(start = c(1,1), end = c(195471971, 182113224)) 50 | ) 51 | 52 | InsertionBias( 53 | object = atac_small, 54 | genome = BSgenome.Mmusculus.UCSC.mm10, 55 | region = region.use 56 | ) 57 | } 58 | } 59 | \concept{footprinting} 60 | -------------------------------------------------------------------------------- /man/IntersectMatrix.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/utilities.R 3 | \name{IntersectMatrix} 4 | \alias{IntersectMatrix} 5 | \title{Intersect genomic coordinates with matrix rows} 6 | \usage{ 7 | IntersectMatrix( 8 | matrix, 9 | regions, 10 | invert = FALSE, 11 | sep = c("-", "-"), 12 | verbose = TRUE, 13 | ... 14 | ) 15 | } 16 | \arguments{ 17 | \item{matrix}{A matrix with genomic regions in the rows} 18 | 19 | \item{regions}{A set of genomic regions to intersect with regions in the 20 | matrix. Either a vector of strings encoding the genomic coordinates, or a 21 | GRanges object.} 22 | 23 | \item{invert}{Discard rows intersecting the genomic regions supplied, rather 24 | than retain.} 25 | 26 | \item{sep}{A length-2 character vector containing the separators to be used 27 | for extracting genomic coordinates from a string. The first element will be 28 | used to separate the chromosome name from coordinates, and the second element 29 | used to separate start and end coordinates.} 30 | 31 | \item{verbose}{Display messages} 32 | 33 | \item{...}{Additional arguments passed to \code{\link[IRanges]{findOverlaps}}} 34 | } 35 | \value{ 36 | Returns a sparse matrix 37 | } 38 | \description{ 39 | Remove or retain matrix rows that intersect given genomic regions 40 | } 41 | \examples{ 42 | counts <- matrix(data = rep(0, 12), ncol = 2) 43 | rownames(counts) <- c("chr1-565107-565550","chr1-569174-569639", 44 | "chr1-713460-714823","chr1-752422-753038", 45 | "chr1-762106-763359","chr1-779589-780271") 46 | IntersectMatrix(matrix = counts, regions = blacklist_hg19) 47 | } 48 | \concept{utilities} 49 | -------------------------------------------------------------------------------- /man/Jaccard.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/dimension_reduction.R 3 | \name{Jaccard} 4 | \alias{Jaccard} 5 | \title{Calculate the Jaccard index between two matrices} 6 | \usage{ 7 | Jaccard(x, y) 8 | } 9 | \arguments{ 10 | \item{x}{The first matrix} 11 | 12 | \item{y}{The second matrix} 13 | } 14 | \value{ 15 | Returns a matrix 16 | } 17 | \description{ 18 | Finds the Jaccard similarity between rows of the two matrices. Note that 19 | the matrices must be binary, and any rows with zero total counts will result 20 | in an NaN entry that could cause problems in downstream analyses. 21 | } 22 | \details{ 23 | This will calculate the raw Jaccard index, without normalizing for the 24 | expected similarity between cells due to differences in sequencing depth. 25 | } 26 | \examples{ 27 | x <- matrix(data = sample(c(0, 1), size = 25, replace = TRUE), ncol = 5) 28 | Jaccard(x = x, y = x) 29 | } 30 | \concept{dimension_reduction} 31 | -------------------------------------------------------------------------------- /man/LinkPlot.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/visualization.R 3 | \name{LinkPlot} 4 | \alias{LinkPlot} 5 | \title{Plot linked genomic elements} 6 | \usage{ 7 | LinkPlot( 8 | object, 9 | region, 10 | assay = NULL, 11 | min.cutoff = 0, 12 | sep = c("-", "-"), 13 | extend.upstream = 0, 14 | extend.downstream = 0, 15 | scale.linewidth = FALSE 16 | ) 17 | } 18 | \arguments{ 19 | \item{object}{A \code{\link[SeuratObject]{Seurat}} object} 20 | 21 | \item{region}{A genomic region to plot} 22 | 23 | \item{assay}{Name of assay to use. If NULL, use the default assay.} 24 | 25 | \item{min.cutoff}{Minimum absolute score for link to be plotted.} 26 | 27 | \item{sep}{Separators to use for strings encoding genomic coordinates. First 28 | element is used to separate the chromosome from the coordinates, second 29 | element is used to separate the start from end coordinate.} 30 | 31 | \item{extend.upstream}{Number of bases to extend the region upstream.} 32 | 33 | \item{extend.downstream}{Number of bases to extend the region downstream.} 34 | 35 | \item{scale.linewidth}{Scale thickness of the line according to link score.} 36 | } 37 | \value{ 38 | Returns a \code{\link[ggplot2]{ggplot}} object 39 | } 40 | \description{ 41 | Display links between pairs of genomic elements within a given region of the 42 | genome. 43 | } 44 | \concept{links} 45 | \concept{visualization} 46 | -------------------------------------------------------------------------------- /man/Links.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/generics.R, R/objects.R 3 | \name{Links} 4 | \alias{Links} 5 | \alias{Links<-} 6 | \alias{Links.ChromatinAssay} 7 | \alias{Links.Seurat} 8 | \alias{Links<-.ChromatinAssay} 9 | \alias{Links<-.Seurat} 10 | \title{Get or set links information} 11 | \usage{ 12 | Links(object, ...) 13 | 14 | Links(object, ...) <- value 15 | 16 | \method{Links}{ChromatinAssay}(object, ...) 17 | 18 | \method{Links}{Seurat}(object, ...) 19 | 20 | \method{Links}{ChromatinAssay}(object, ...) <- value 21 | 22 | \method{Links}{Seurat}(object, ...) <- value 23 | } 24 | \arguments{ 25 | \item{object}{A Seurat object} 26 | 27 | \item{...}{Arguments passed to other methods} 28 | 29 | \item{value}{A \code{\link[GenomicRanges]{GRanges}} object} 30 | } 31 | \description{ 32 | Get or set the genomic link information for a Seurat object or ChromatinAssay 33 | } 34 | \examples{ 35 | Links(atac_small[["peaks"]]) 36 | Links(atac_small) 37 | links <- Links(atac_small) 38 | Links(atac_small[["peaks"]]) <- links 39 | links <- Links(atac_small) 40 | Links(atac_small) <- links 41 | } 42 | \concept{assay} 43 | \concept{links} 44 | -------------------------------------------------------------------------------- /man/LookupGeneCoords.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/utilities.R 3 | \name{LookupGeneCoords} 4 | \alias{LookupGeneCoords} 5 | \title{Get gene coordinates} 6 | \usage{ 7 | LookupGeneCoords(object, gene, assay = NULL) 8 | } 9 | \arguments{ 10 | \item{object}{A Seurat object} 11 | 12 | \item{gene}{Name of a gene to extract} 13 | 14 | \item{assay}{Name of assay to use} 15 | } 16 | \description{ 17 | Extract the coordinates of the longest transcript for a gene stored in the 18 | annotations within an object. 19 | } 20 | \examples{ 21 | LookupGeneCoords(atac_small, gene = "MIR1302-10") 22 | } 23 | \concept{utilities} 24 | -------------------------------------------------------------------------------- /man/MatchRegionStats.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/utilities.R 3 | \name{MatchRegionStats} 4 | \alias{MatchRegionStats} 5 | \title{Match DNA sequence characteristics} 6 | \usage{ 7 | MatchRegionStats( 8 | meta.feature, 9 | query.feature, 10 | features.match = c("GC.percent"), 11 | n = 10000, 12 | verbose = TRUE, 13 | ... 14 | ) 15 | } 16 | \arguments{ 17 | \item{meta.feature}{A dataframe containing DNA sequence information for 18 | features to choose from} 19 | 20 | \item{query.feature}{A dataframe containing DNA sequence information for 21 | features to match.} 22 | 23 | \item{features.match}{Which features of the query to match when selecting a 24 | set of regions. A vector of column names present in the feature metadata can 25 | be supplied to match multiple characteristics at once. Default is GC content.} 26 | 27 | \item{n}{Number of regions to select, with characteristics matching the query} 28 | 29 | \item{verbose}{Display messages} 30 | 31 | \item{...}{Arguments passed to other functions} 32 | } 33 | \value{ 34 | Returns a character vector 35 | } 36 | \description{ 37 | Return a vector if genomic regions that match the distribution of a set of 38 | query regions for any given set of characteristics, specified in the input 39 | \code{meta.feature} dataframe. 40 | } 41 | \details{ 42 | For each requested feature to match, a density 43 | distribution is estimated using the \code{\link[stats]{density}} function, 44 | and a set of weights for each feature in the dataset estimated based on the 45 | density distribution. If multiple features are to be matched (for example, 46 | GC content and overall accessibility), a joint density distribution is then 47 | computed by multiplying the individual feature weights. A set of features 48 | with characteristics matching the query regions is then selected using the 49 | \code{\link[base]{sample}} function, with the probability of randomly 50 | selecting each feature equal to the joint density distribution weight. 51 | } 52 | \examples{ 53 | metafeatures <- SeuratObject::GetAssayData( 54 | object = atac_small[['peaks']], layer = 'meta.features' 55 | ) 56 | query.feature <- metafeatures[1:10, ] 57 | features.choose <- metafeatures[11:nrow(metafeatures), ] 58 | MatchRegionStats( 59 | meta.feature = features.choose, 60 | query.feature = query.feature, 61 | features.match = "percentile", 62 | n = 10 63 | ) 64 | } 65 | \concept{motifs} 66 | \concept{utilities} 67 | -------------------------------------------------------------------------------- /man/Motif-class.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/objects.R 3 | \docType{class} 4 | \name{Motif-class} 5 | \alias{Motif-class} 6 | \alias{Motif} 7 | \title{The Motif class} 8 | \description{ 9 | The Motif class is designed to store DNA sequence motif information, 10 | including motif PWMs or PFMs, motif positions, and metadata. 11 | } 12 | \section{Slots}{ 13 | 14 | \describe{ 15 | \item{\code{data}}{A sparse, binary, feature x motif matrix. Columns 16 | correspond to motif IDs, rows correspond to genomic features 17 | (peaks or bins). Entries in the matrix should be 1 if the 18 | genomic feature contains the motif, and 0 otherwise.} 19 | 20 | \item{\code{pwm}}{A named list of position weight matrices} 21 | 22 | \item{\code{motif.names}}{A list containing the name of each motif} 23 | 24 | \item{\code{positions}}{A \code{\link[GenomicRanges]{GRangesList}} object containing 25 | exact positions of each motif.} 26 | 27 | \item{\code{meta.data}}{A dataframe for storage of additional 28 | information related to each motif. This could include the 29 | names of proteins that bind the motif.} 30 | }} 31 | 32 | \concept{motifs} 33 | -------------------------------------------------------------------------------- /man/MotifCounts.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/motifs.R 3 | \name{MotifCounts} 4 | \alias{MotifCounts} 5 | \title{Count fragments surrounding motif sites} 6 | \usage{ 7 | MotifCounts( 8 | object, 9 | motifs, 10 | flanking.region = 1000, 11 | assay = NULL, 12 | verbose = TRUE, 13 | ... 14 | ) 15 | } 16 | \arguments{ 17 | \item{object}{A Seurat object} 18 | 19 | \item{motifs}{A list of DNA sequence motif names. One matrix will be generated 20 | for each motif} 21 | 22 | \item{flanking.region}{Amount of sequence to include surrounding the motif 23 | itself} 24 | 25 | \item{assay}{Name of assay to use. Must be a ChromatinAssay} 26 | 27 | \item{verbose}{Display messages} 28 | 29 | \item{...}{Additional arguments passed to \code{\link{FeatureMatrix}}} 30 | } 31 | \value{ 32 | Returns a list of sparse matrices 33 | } 34 | \description{ 35 | Count the number of sequenced DNA fragments in a region surrounding each 36 | instance of a given DNA sequence motif. 37 | } 38 | \concept{motifs} 39 | -------------------------------------------------------------------------------- /man/MotifPlot.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/visualization.R 3 | \name{MotifPlot} 4 | \alias{MotifPlot} 5 | \title{Plot DNA sequence motif} 6 | \usage{ 7 | MotifPlot(object, motifs, assay = NULL, use.names = TRUE, ...) 8 | } 9 | \arguments{ 10 | \item{object}{A Seurat object} 11 | 12 | \item{motifs}{A list of motif IDs or motif names to plot} 13 | 14 | \item{assay}{Name of the assay to use} 15 | 16 | \item{use.names}{Use motif names stored in the motif object} 17 | 18 | \item{...}{Additional parameters passed to \code{\link[ggseqlogo]{ggseqlogo}}} 19 | } 20 | \value{ 21 | Returns a \code{\link[ggplot2]{ggplot}} object 22 | } 23 | \description{ 24 | Plot position weight matrix or position frequency matrix for different DNA 25 | sequence motifs. 26 | } 27 | \examples{ 28 | \donttest{ 29 | motif.obj <- Motifs(atac_small) 30 | MotifPlot(atac_small, motifs = head(colnames(motif.obj))) 31 | } 32 | } 33 | \concept{motifs} 34 | \concept{visualization} 35 | -------------------------------------------------------------------------------- /man/Motifs.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/generics.R, R/objects.R 3 | \name{Motifs} 4 | \alias{Motifs} 5 | \alias{Motifs<-} 6 | \alias{Motifs.ChromatinAssay} 7 | \alias{Motifs.Seurat} 8 | \alias{Motifs<-.ChromatinAssay} 9 | \alias{Motifs<-.Seurat} 10 | \title{Get or set a motif information} 11 | \usage{ 12 | Motifs(object, ...) 13 | 14 | Motifs(object, ...) <- value 15 | 16 | \method{Motifs}{ChromatinAssay}(object, ...) 17 | 18 | \method{Motifs}{Seurat}(object, ...) 19 | 20 | \method{Motifs}{ChromatinAssay}(object, ...) <- value 21 | 22 | \method{Motifs}{Seurat}(object, ...) <- value 23 | } 24 | \arguments{ 25 | \item{object}{A Seurat object} 26 | 27 | \item{...}{Arguments passed to other methods} 28 | 29 | \item{value}{A \code{\link{Motif}} object} 30 | } 31 | \description{ 32 | Get or set the Motif object for a Seurat object or ChromatinAssay. 33 | } 34 | \examples{ 35 | Motifs(atac_small[["peaks"]]) 36 | Motifs(atac_small) 37 | motifs <- Motifs(atac_small) 38 | Motifs(atac_small[["peaks"]]) <- motifs 39 | motifs <- Motifs(atac_small) 40 | Motifs(atac_small) <- motifs 41 | } 42 | \concept{assay} 43 | \concept{motifs} 44 | -------------------------------------------------------------------------------- /man/NucleosomeSignal.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/preprocessing.R 3 | \name{NucleosomeSignal} 4 | \alias{NucleosomeSignal} 5 | \title{NucleosomeSignal} 6 | \usage{ 7 | NucleosomeSignal( 8 | object, 9 | assay = NULL, 10 | n = ncol(object) * 5000, 11 | verbose = TRUE, 12 | ... 13 | ) 14 | } 15 | \arguments{ 16 | \item{object}{A Seurat object} 17 | 18 | \item{assay}{Name of assay to use. Only required if a fragment path is not 19 | provided. If NULL, use the active assay.} 20 | 21 | \item{n}{Number of lines to read from the fragment file. If NULL, read all 22 | lines. Default scales with the number of cells in the object.} 23 | 24 | \item{verbose}{Display messages} 25 | 26 | \item{...}{Arguments passed to other functions} 27 | } 28 | \value{ 29 | Returns a \code{\link[SeuratObject]{Seurat}} object with 30 | added metadata for the ratio of mononucleosomal to nucleosome-free fragments 31 | per cell, and the percentile rank of each ratio. 32 | } 33 | \description{ 34 | Calculate the strength of the nucleosome signal per cell. 35 | Computes the ratio of fragments between 147 bp and 294 bp (mononucleosome) to 36 | fragments < 147 bp (nucleosome-free) 37 | } 38 | \examples{ 39 | fpath <- system.file("extdata", "fragments.tsv.gz", package="Signac") 40 | Fragments(atac_small) <- CreateFragmentObject( 41 | path = fpath, 42 | cells = colnames(atac_small), 43 | tolerance = 0.5 44 | ) 45 | NucleosomeSignal(object = atac_small) 46 | } 47 | \concept{qc} 48 | -------------------------------------------------------------------------------- /man/PeakPlot.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/visualization.R 3 | \name{PeakPlot} 4 | \alias{PeakPlot} 5 | \title{Plot peaks in a genomic region} 6 | \usage{ 7 | PeakPlot( 8 | object, 9 | region, 10 | assay = NULL, 11 | peaks = NULL, 12 | group.by = NULL, 13 | color = "dimgrey", 14 | sep = c("-", "-"), 15 | extend.upstream = 0, 16 | extend.downstream = 0 17 | ) 18 | } 19 | \arguments{ 20 | \item{object}{A \code{\link[SeuratObject]{Seurat}} object} 21 | 22 | \item{region}{A genomic region to plot} 23 | 24 | \item{assay}{Name of assay to use. If NULL, use the default assay.} 25 | 26 | \item{peaks}{A GRanges object containing peak coordinates. If NULL, use 27 | coordinates stored in the Seurat object.} 28 | 29 | \item{group.by}{Name of variable in feature metadata (if using ranges in the 30 | Seurat object) or genomic ranges metadata (if using supplied ranges) to color 31 | ranges by. If NULL, do not color by any metadata variable.} 32 | 33 | \item{color}{Color to use. If \code{group.by} is not NULL, this can be a 34 | custom color scale (see examples).} 35 | 36 | \item{sep}{Separators to use for strings encoding genomic coordinates. First 37 | element is used to separate the chromosome from the coordinates, second 38 | element is used to separate the start from end coordinate.} 39 | 40 | \item{extend.upstream}{Number of bases to extend the region upstream.} 41 | 42 | \item{extend.downstream}{Number of bases to extend the region downstream.} 43 | } 44 | \value{ 45 | Returns a \code{\link[ggplot2]{ggplot}} object 46 | } 47 | \description{ 48 | Display the genomic ranges in a \code{\link{ChromatinAssay}} object that fall 49 | in a given genomic region 50 | } 51 | \examples{ 52 | \donttest{ 53 | # plot peaks in assay 54 | PeakPlot(atac_small, region = "chr1-710000-715000") 55 | 56 | # manually set color 57 | PeakPlot(atac_small, region = "chr1-710000-715000", color = "red") 58 | 59 | # color by a variable in the feature metadata 60 | PeakPlot(atac_small, region = "chr1-710000-715000", group.by = "count") 61 | } 62 | } 63 | \concept{visualization} 64 | -------------------------------------------------------------------------------- /man/PlotFootprint.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/visualization.R 3 | \name{PlotFootprint} 4 | \alias{PlotFootprint} 5 | \title{Plot motif footprinting results} 6 | \usage{ 7 | PlotFootprint( 8 | object, 9 | features, 10 | assay = NULL, 11 | group.by = NULL, 12 | split.by = NULL, 13 | idents = NULL, 14 | label = TRUE, 15 | repel = TRUE, 16 | show.expected = TRUE, 17 | normalization = "subtract", 18 | label.top = 3, 19 | label.idents = NULL 20 | ) 21 | } 22 | \arguments{ 23 | \item{object}{A Seurat object} 24 | 25 | \item{features}{A vector of features to plot} 26 | 27 | \item{assay}{Name of assay to use} 28 | 29 | \item{group.by}{A grouping variable} 30 | 31 | \item{split.by}{A metadata variable to split the plot by. For example, 32 | grouping by "celltype" and splitting by "batch" will create separate plots 33 | for each celltype and batch.} 34 | 35 | \item{idents}{Set of identities to include in the plot} 36 | 37 | \item{label}{TRUE/FALSE value to control whether groups are labeled.} 38 | 39 | \item{repel}{Repel labels from each other} 40 | 41 | \item{show.expected}{Plot the expected Tn5 integration frequency below the 42 | main footprint plot} 43 | 44 | \item{normalization}{Method to normalize for Tn5 DNA sequence bias. Options 45 | are "subtract", "divide", or NULL to perform no bias correction.} 46 | 47 | \item{label.top}{Number of groups to label based on highest accessibility 48 | in motif flanking region.} 49 | 50 | \item{label.idents}{Vector of identities to label. If supplied, 51 | \code{label.top} will be ignored.} 52 | } 53 | \description{ 54 | Plot motif footprinting results 55 | } 56 | \concept{footprinting} 57 | \concept{visualization} 58 | -------------------------------------------------------------------------------- /man/ReadMGATK.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/mito.R 3 | \name{ReadMGATK} 4 | \alias{ReadMGATK} 5 | \title{Read MGATK output} 6 | \usage{ 7 | ReadMGATK(dir, verbose = TRUE) 8 | } 9 | \arguments{ 10 | \item{dir}{Path to directory containing MGATK output files} 11 | 12 | \item{verbose}{Display messages} 13 | } 14 | \value{ 15 | Returns a list containing a sparse matrix (counts) and two dataframes 16 | (depth and refallele). 17 | 18 | The sparse matrix contains read counts for each base at each position 19 | and strand. 20 | 21 | The depth dataframe contains the total depth for each cell. 22 | The refallele dataframe contains the reference genome allele at each 23 | position. 24 | } 25 | \description{ 26 | Read output files from MGATK (\url{https://github.com/caleblareau/mgatk}). 27 | } 28 | \examples{ 29 | \dontrun{ 30 | data.dir <- system.file("extdata", "test_mgatk", package="Signac") 31 | mgatk <- ReadMGATK(dir = data.dir) 32 | } 33 | } 34 | \concept{mito} 35 | -------------------------------------------------------------------------------- /man/RegionHeatmap.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/visualization.R 3 | \name{RegionHeatmap} 4 | \alias{RegionHeatmap} 5 | \title{Region heatmap} 6 | \usage{ 7 | RegionHeatmap( 8 | object, 9 | key, 10 | assay = NULL, 11 | idents = NULL, 12 | normalize = TRUE, 13 | upstream = 3000, 14 | downstream = 3000, 15 | max.cutoff = "q95", 16 | cols = NULL, 17 | min.counts = 1, 18 | window = (upstream + downstream)/30, 19 | order = TRUE, 20 | nrow = NULL 21 | ) 22 | } 23 | \arguments{ 24 | \item{object}{A Seurat object} 25 | 26 | \item{key}{Name of key to pull data from. Stores the results from 27 | \code{\link{RegionMatrix}}} 28 | 29 | \item{assay}{Name of assay to use. If a list or vector of assay names is 30 | given, data will be plotted from each assay. Note that all assays must 31 | contain \code{RegionMatrix} results with the same key. Sorting will be 32 | defined by the first assay in the list} 33 | 34 | \item{idents}{Cell identities to include. Note that cells cannot be 35 | regrouped, this will require re-running \code{RegionMatrix} to generate a 36 | new set of matrices} 37 | 38 | \item{normalize}{Normalize by number of cells in each group} 39 | 40 | \item{upstream}{Number of bases to include upstream of region. If NULL, use 41 | all bases that were included in the \code{RegionMatrix} function call. Note 42 | that this value cannot be larger than the value for \code{upstream} given in 43 | the original \code{RegionMatrix} function call. If NULL, use parameters that 44 | were given in the \code{RegionMatrix} function call} 45 | 46 | \item{downstream}{Number of bases to include downstream of region. See 47 | documentation for \code{upstream}} 48 | 49 | \item{max.cutoff}{Maximum cutoff value. Data above this value will be clipped 50 | to the maximum value. A quantile maximum can be specified in the form of 51 | "q##" where "##" is the quantile (eg, "q90" for 90th quantile). If NULL, no 52 | cutoff will be set} 53 | 54 | \item{cols}{Vector of colors to use as the maximum value of the color scale. 55 | One color must be supplied for each assay. If NULL, the default ggplot2 56 | colors are used.} 57 | 58 | \item{min.counts}{Minimum total counts to display region in plot} 59 | 60 | \item{window}{Smoothing window to apply} 61 | 62 | \item{order}{Order regions by the total number of fragments in the region 63 | across all included identities} 64 | 65 | \item{nrow}{Number of rows to use when creating plot. If NULL, chosen 66 | automatically by ggplot2} 67 | } 68 | \value{ 69 | Returns a ggplot2 object 70 | } 71 | \description{ 72 | Plot fragment counts within a set of regions. 73 | } 74 | \seealso{ 75 | RegionMatrix 76 | } 77 | \concept{heatmap} 78 | \concept{visualization} 79 | -------------------------------------------------------------------------------- /man/RegionMatrix.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/generics.R, R/heatmaps.R 3 | \name{RegionMatrix} 4 | \alias{RegionMatrix} 5 | \alias{RegionMatrix.Seurat} 6 | \alias{RegionMatrix.ChromatinAssay} 7 | \alias{RegionMatrix.default} 8 | \title{Region enrichment analysis} 9 | \usage{ 10 | RegionMatrix(object, ...) 11 | 12 | \method{RegionMatrix}{Seurat}( 13 | object, 14 | regions, 15 | key, 16 | assay = NULL, 17 | group.by = NULL, 18 | idents = NULL, 19 | upstream = 3000, 20 | downstream = 3000, 21 | verbose = TRUE, 22 | ... 23 | ) 24 | 25 | \method{RegionMatrix}{ChromatinAssay}( 26 | object, 27 | regions, 28 | key, 29 | assay = NULL, 30 | group.by = NULL, 31 | idents = NULL, 32 | upstream = 3000, 33 | downstream = 3000, 34 | verbose = TRUE, 35 | ... 36 | ) 37 | 38 | \method{RegionMatrix}{default}( 39 | object, 40 | regions, 41 | key, 42 | assay = NULL, 43 | group.by = NULL, 44 | idents = NULL, 45 | upstream = 3000, 46 | downstream = 3000, 47 | verbose = TRUE, 48 | ... 49 | ) 50 | } 51 | \arguments{ 52 | \item{object}{A Seurat or ChromatinAssay object} 53 | 54 | \item{...}{Arguments passed to other methods} 55 | 56 | \item{regions}{A \code{\link[GenomicRanges]{GRanges}} object containing the 57 | set of genomic ranges to quantify} 58 | 59 | \item{key}{Name to store resulting matrices under} 60 | 61 | \item{assay}{Name of assay to use. If NULL, use the default assay} 62 | 63 | \item{group.by}{Grouping variable to use when aggregating data across cells. 64 | If NULL, use the active cell identities} 65 | 66 | \item{idents}{Cell identities to include. If NULL, include all identities} 67 | 68 | \item{upstream}{Number of bases to extend regions upstream} 69 | 70 | \item{downstream}{Number of bases to extend regions downstream} 71 | 72 | \item{verbose}{Display messages} 73 | } 74 | \value{ 75 | Returns a \code{\link[SeuratObject]{Seurat}} object 76 | } 77 | \description{ 78 | Count fragments within a set of regions for different groups of 79 | cells. 80 | } 81 | \concept{heatmap} 82 | -------------------------------------------------------------------------------- /man/RegionPlot.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/visualization.R 3 | \name{RegionPlot} 4 | \alias{RegionPlot} 5 | \title{Region plot} 6 | \usage{ 7 | RegionPlot( 8 | object, 9 | key, 10 | assay = NULL, 11 | idents = NULL, 12 | normalize = TRUE, 13 | upstream = NULL, 14 | downstream = NULL, 15 | window = (upstream + downstream)/500, 16 | nrow = NULL 17 | ) 18 | } 19 | \arguments{ 20 | \item{object}{A Seurat object} 21 | 22 | \item{key}{Name of key to pull data from. Stores the results from 23 | \code{\link{RegionMatrix}}} 24 | 25 | \item{assay}{Name of assay to use. If a list or vector of assay names is 26 | given, data will be plotted from each assay. Note that all assays must 27 | contain \code{RegionMatrix} results with the same key. Sorting will be 28 | defined by the first assay in the list} 29 | 30 | \item{idents}{Cell identities to include. Note that cells cannot be 31 | regrouped, this will require re-running \code{RegionMatrix} to generate a 32 | new set of matrices} 33 | 34 | \item{normalize}{Normalize by number of cells in each group} 35 | 36 | \item{upstream}{Number of bases to include upstream of region. If NULL, use 37 | all bases that were included in the \code{RegionMatrix} function call. Note 38 | that this value cannot be larger than the value for \code{upstream} given in 39 | the original \code{RegionMatrix} function call. If NULL, use parameters that 40 | were given in the \code{RegionMatrix} function call} 41 | 42 | \item{downstream}{Number of bases to include downstream of region. See 43 | documentation for \code{upstream}} 44 | 45 | \item{window}{Smoothing window to apply} 46 | 47 | \item{nrow}{Number of rows to use when creating plot. If NULL, chosen 48 | automatically by ggplot2} 49 | } 50 | \value{ 51 | Returns a ggplot2 object 52 | } 53 | \description{ 54 | Plot fragment counts within a set of regions. 55 | } 56 | \seealso{ 57 | RegionMatrix 58 | } 59 | \concept{heatmap} 60 | \concept{visualization} 61 | -------------------------------------------------------------------------------- /man/RegionStats.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/generics.R, R/preprocessing.R 3 | \name{RegionStats} 4 | \alias{RegionStats} 5 | \alias{RegionStats.default} 6 | \alias{RegionStats.ChromatinAssay} 7 | \alias{RegionStats.Seurat} 8 | \title{Compute base composition information for genomic ranges} 9 | \usage{ 10 | RegionStats(object, ...) 11 | 12 | \method{RegionStats}{default}(object, genome, verbose = TRUE, ...) 13 | 14 | \method{RegionStats}{ChromatinAssay}(object, genome, verbose = TRUE, ...) 15 | 16 | \method{RegionStats}{Seurat}(object, genome, assay = NULL, verbose = TRUE, ...) 17 | } 18 | \arguments{ 19 | \item{object}{A Seurat object, Assay object, or set of genomic ranges} 20 | 21 | \item{...}{Arguments passed to other methods} 22 | 23 | \item{genome}{A \code{BSgenome} object or any other object supported by 24 | \code{getSeq}. Do \code{showMethods("getSeq")} to get the list of all 25 | supported object types.} 26 | 27 | \item{verbose}{Display messages} 28 | 29 | \item{assay}{Name of assay to use} 30 | } 31 | \value{ 32 | Returns a dataframe 33 | } 34 | \description{ 35 | Compute the GC content, region lengths, and dinucleotide base frequencies 36 | for regions in the assay and add to the feature metadata. 37 | } 38 | \examples{ 39 | \dontrun{ 40 | library(BSgenome.Hsapiens.UCSC.hg19) 41 | RegionStats( 42 | object = rownames(atac_small), 43 | genome = BSgenome.Hsapiens.UCSC.hg19 44 | ) 45 | } 46 | \dontrun{ 47 | library(BSgenome.Hsapiens.UCSC.hg19) 48 | RegionStats( 49 | object = atac_small[['peaks']], 50 | genome = BSgenome.Hsapiens.UCSC.hg19 51 | ) 52 | } 53 | \dontrun{ 54 | library(BSgenome.Hsapiens.UCSC.hg19) 55 | RegionStats( 56 | object = atac_small, 57 | assay = 'bins', 58 | genome = BSgenome.Hsapiens.UCSC.hg19 59 | ) 60 | } 61 | } 62 | \concept{motifs} 63 | -------------------------------------------------------------------------------- /man/RunChromVAR.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/generics.R, R/motifs.R 3 | \name{RunChromVAR} 4 | \alias{RunChromVAR} 5 | \alias{RunChromVAR.ChromatinAssay} 6 | \alias{RunChromVAR.Seurat} 7 | \title{Run chromVAR} 8 | \usage{ 9 | RunChromVAR(object, ...) 10 | 11 | \method{RunChromVAR}{ChromatinAssay}(object, genome, motif.matrix = NULL, verbose = TRUE, ...) 12 | 13 | \method{RunChromVAR}{Seurat}( 14 | object, 15 | genome, 16 | motif.matrix = NULL, 17 | assay = NULL, 18 | new.assay.name = "chromvar", 19 | ... 20 | ) 21 | } 22 | \arguments{ 23 | \item{object}{A Seurat object} 24 | 25 | \item{...}{Additional arguments passed to 26 | \code{\link[chromVAR]{getBackgroundPeaks}}} 27 | 28 | \item{genome}{A \code{BSgenome} object or string stating the genome build 29 | recognized by \code{getBSgenome}.} 30 | 31 | \item{motif.matrix}{A peak x motif matrix. If NULL, pull the peak x motif 32 | matrix from a Motif object stored in the assay.} 33 | 34 | \item{verbose}{Display messages} 35 | 36 | \item{assay}{Name of assay to use} 37 | 38 | \item{new.assay.name}{Name of new assay used to store the chromVAR results. 39 | Default is "chromvar".} 40 | } 41 | \value{ 42 | Returns a \code{\link[SeuratObject]{Seurat}} object with a new assay 43 | } 44 | \description{ 45 | Wrapper to run \code{\link[chromVAR]{chromVAR}} on an assay with a motif 46 | object present. Will return a new Seurat assay with the motif activities 47 | (the deviations in chromatin accessibility across the set of regions) as 48 | a new assay. 49 | } 50 | \details{ 51 | See the chromVAR documentation for more information: 52 | \url{https://greenleaflab.github.io/chromVAR/index.html} 53 | 54 | See the chromVAR paper: \url{https://www.nature.com/articles/nmeth.4401} 55 | } 56 | \examples{ 57 | \dontrun{ 58 | library(BSgenome.Hsapiens.UCSC.hg19) 59 | RunChromVAR(object = atac_small[["peaks"]], genome = BSgenome.Hsapiens.UCSC.hg19) 60 | } 61 | \dontrun{ 62 | library(BSgenome.Hsapiens.UCSC.hg19) 63 | RunChromVAR(object = atac_small, genome = BSgenome.Hsapiens.UCSC.hg19) 64 | } 65 | } 66 | \concept{motifs} 67 | -------------------------------------------------------------------------------- /man/RunSVD.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/generics.R, R/dimension_reduction.R 3 | \name{RunSVD} 4 | \alias{RunSVD} 5 | \alias{RunSVD.default} 6 | \alias{RunSVD.Assay} 7 | \alias{RunSVD.StdAssay} 8 | \alias{RunSVD.Seurat} 9 | \title{Run singular value decomposition} 10 | \usage{ 11 | RunSVD(object, ...) 12 | 13 | \method{RunSVD}{default}( 14 | object, 15 | assay = NULL, 16 | n = 50, 17 | scale.embeddings = TRUE, 18 | reduction.key = "LSI_", 19 | scale.max = NULL, 20 | verbose = TRUE, 21 | irlba.work = n * 3, 22 | tol = 1e-05, 23 | ... 24 | ) 25 | 26 | \method{RunSVD}{Assay}( 27 | object, 28 | assay = NULL, 29 | features = NULL, 30 | n = 50, 31 | reduction.key = "LSI_", 32 | scale.max = NULL, 33 | verbose = TRUE, 34 | ... 35 | ) 36 | 37 | \method{RunSVD}{StdAssay}( 38 | object, 39 | assay = NULL, 40 | features = NULL, 41 | n = 50, 42 | reduction.key = "LSI_", 43 | scale.max = NULL, 44 | verbose = TRUE, 45 | ... 46 | ) 47 | 48 | \method{RunSVD}{Seurat}( 49 | object, 50 | assay = NULL, 51 | features = NULL, 52 | n = 50, 53 | reduction.key = "LSI_", 54 | reduction.name = "lsi", 55 | scale.max = NULL, 56 | verbose = TRUE, 57 | ... 58 | ) 59 | } 60 | \arguments{ 61 | \item{object}{A Seurat object} 62 | 63 | \item{...}{Arguments passed to other methods} 64 | 65 | \item{assay}{Which assay to use. If NULL, use the default assay} 66 | 67 | \item{n}{Number of singular values to compute} 68 | 69 | \item{scale.embeddings}{Scale cell embeddings within each component to 70 | mean 0 and SD 1 (default TRUE).} 71 | 72 | \item{reduction.key}{Key for dimension reduction object} 73 | 74 | \item{scale.max}{Clipping value for cell embeddings. 75 | Default (NULL) is no clipping.} 76 | 77 | \item{verbose}{Print messages} 78 | 79 | \item{irlba.work}{work parameter for \code{\link[irlba]{irlba}}. 80 | Working subspace dimension, larger values can speed convergence at the 81 | cost of more memory use.} 82 | 83 | \item{tol}{Tolerance (tol) parameter for \code{\link[irlba]{irlba}}. Larger 84 | values speed up convergence due to greater amount of allowed error.} 85 | 86 | \item{features}{Which features to use. If NULL, use variable features} 87 | 88 | \item{reduction.name}{Name for stored dimension reduction object. 89 | Default 'svd'} 90 | } 91 | \value{ 92 | Returns a \code{\link[SeuratObject]{Seurat}} object 93 | } 94 | \description{ 95 | Run partial singular value decomposition using \code{\link[irlba]{irlba}} 96 | } 97 | \examples{ 98 | x <- matrix(data = rnorm(100), ncol = 10) 99 | RunSVD(x) 100 | \dontrun{ 101 | RunSVD(atac_small[['peaks']]) 102 | } 103 | \dontrun{ 104 | RunSVD(atac_small[['peaks']]) 105 | } 106 | \dontrun{ 107 | RunSVD(atac_small) 108 | } 109 | } 110 | \concept{dimension_reduction} 111 | -------------------------------------------------------------------------------- /man/RunTFIDF.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/generics.R, R/preprocessing.R 3 | \name{RunTFIDF} 4 | \alias{RunTFIDF} 5 | \alias{RunTFIDF.default} 6 | \alias{RunTFIDF.Assay} 7 | \alias{RunTFIDF.StdAssay} 8 | \alias{RunTFIDF.Seurat} 9 | \title{Compute the term-frequency inverse-document-frequency} 10 | \usage{ 11 | RunTFIDF(object, ...) 12 | 13 | \method{RunTFIDF}{default}( 14 | object, 15 | assay = NULL, 16 | method = 1, 17 | scale.factor = 10000, 18 | idf = NULL, 19 | verbose = TRUE, 20 | ... 21 | ) 22 | 23 | \method{RunTFIDF}{Assay}( 24 | object, 25 | assay = NULL, 26 | method = 1, 27 | scale.factor = 10000, 28 | idf = NULL, 29 | verbose = TRUE, 30 | ... 31 | ) 32 | 33 | \method{RunTFIDF}{StdAssay}( 34 | object, 35 | assay = NULL, 36 | method = 1, 37 | scale.factor = 10000, 38 | idf = NULL, 39 | verbose = TRUE, 40 | ... 41 | ) 42 | 43 | \method{RunTFIDF}{Seurat}( 44 | object, 45 | assay = NULL, 46 | method = 1, 47 | scale.factor = 10000, 48 | idf = NULL, 49 | verbose = TRUE, 50 | ... 51 | ) 52 | } 53 | \arguments{ 54 | \item{object}{A Seurat object} 55 | 56 | \item{...}{Arguments passed to other methods} 57 | 58 | \item{assay}{Name of assay to use} 59 | 60 | \item{method}{Which TF-IDF implementation to use. Choice of: 61 | \itemize{ 62 | \item{1}: The TF-IDF implementation used by Stuart & Butler et al. 2019 63 | (\doi{10.1101/460147}). This computes 64 | \eqn{\log(TF \times IDF)}. 65 | \item{2}: The TF-IDF implementation used by Cusanovich & Hill 66 | et al. 2018 (\doi{10.1016/j.cell.2018.06.052}). This 67 | computes \eqn{TF \times (\log(IDF))}. 68 | \item{3}: The log-TF method used by Andrew Hill. 69 | This computes \eqn{\log(TF) \times \log(IDF)}. 70 | \item{4}: The 10x Genomics method (no TF normalization). This computes 71 | \eqn{IDF}. 72 | }} 73 | 74 | \item{scale.factor}{Which scale factor to use. Default is 10000.} 75 | 76 | \item{idf}{A precomputed IDF vector to use. If NULL, compute based on the 77 | input data matrix.} 78 | 79 | \item{verbose}{Print progress} 80 | } 81 | \value{ 82 | Returns a \code{\link[SeuratObject]{Seurat}} object 83 | } 84 | \description{ 85 | Run term frequency inverse document frequency (TF-IDF) normalization on a 86 | matrix. 87 | } 88 | \details{ 89 | Four different TF-IDF methods are implemented. We recommend using method 1 90 | (the default). 91 | } 92 | \examples{ 93 | mat <- matrix(data = rbinom(n = 25, size = 5, prob = 0.2), nrow = 5) 94 | RunTFIDF(object = mat) 95 | RunTFIDF(atac_small[['peaks']]) 96 | RunTFIDF(atac_small[['peaks']]) 97 | RunTFIDF(object = atac_small) 98 | } 99 | \references{ 100 | \url{https://en.wikipedia.org/wiki/Latent_semantic_analysis#Latent_semantic_indexing} 101 | } 102 | \concept{preprocessing} 103 | -------------------------------------------------------------------------------- /man/SetMotifData.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/generics.R, R/objects.R 3 | \name{SetMotifData} 4 | \alias{SetMotifData} 5 | \alias{SetMotifData.Motif} 6 | \alias{SetMotifData.ChromatinAssay} 7 | \alias{SetMotifData.Seurat} 8 | \title{Set motif data} 9 | \usage{ 10 | SetMotifData(object, ...) 11 | 12 | \method{SetMotifData}{Motif}(object, slot, new.data, ...) 13 | 14 | \method{SetMotifData}{ChromatinAssay}(object, slot, new.data, ...) 15 | 16 | \method{SetMotifData}{Seurat}(object, assay = NULL, ...) 17 | } 18 | \arguments{ 19 | \item{object}{A Seurat object} 20 | 21 | \item{...}{Arguments passed to other methods} 22 | 23 | \item{slot}{Name of slot to use} 24 | 25 | \item{new.data}{motif matrix to add. Should be matrix or sparse matrix class} 26 | 27 | \item{assay}{Name of assay whose data should be set} 28 | } 29 | \value{ 30 | Returns a \code{\link[SeuratObject]{Seurat}} object 31 | } 32 | \description{ 33 | Set motif matrix for given assay 34 | } 35 | \examples{ 36 | motif.obj <- SeuratObject::GetAssayData( 37 | object = atac_small[['peaks']], slot = "motifs" 38 | ) 39 | SetMotifData(object = motif.obj, slot = 'data', new.data = matrix(1:2)) 40 | SetMotifData( 41 | object = atac_small[['peaks']], slot = 'data', new.data = matrix(1:2) 42 | ) 43 | motif.matrix <- GetMotifData(object = atac_small) 44 | SetMotifData( 45 | object = atac_small, assay = 'peaks', slot = 'data', new.data = motif.matrix 46 | ) 47 | } 48 | \concept{motifs} 49 | -------------------------------------------------------------------------------- /man/Signac-package.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/zzz.R 3 | \docType{package} 4 | \name{Signac-package} 5 | \alias{Signac} 6 | \alias{Signac-package} 7 | \title{Signac: Analysis of Single-Cell Chromatin Data} 8 | \description{ 9 | \if{html}{\figure{logo.png}{options: style='float: right' alt='logo' width='120'}} 10 | 11 | A framework for the analysis and exploration of single-cell chromatin data. The 'Signac' package contains functions for quantifying single-cell chromatin data, computing per-cell quality control metrics, dimension reduction and normalization, visualization, and DNA sequence motif analysis. Reference: Stuart et al. (2021) \doi{10.1038/s41592-021-01282-5}. 12 | } 13 | \seealso{ 14 | Useful links: 15 | \itemize{ 16 | \item \url{https://github.com/stuart-lab/signac} 17 | \item \url{https://stuartlab.org/signac} 18 | \item Report bugs at \url{https://github.com/stuart-lab/signac/issues} 19 | } 20 | 21 | } 22 | \author{ 23 | \strong{Maintainer}: Tim Stuart \email{stuartt@gis.a-star.edu.sg} (\href{https://orcid.org/0000-0002-3044-0897}{ORCID}) 24 | 25 | Authors: 26 | \itemize{ 27 | \item Avi Srivastava \email{asrivastava@nygenome.org} (\href{https://orcid.org/0000-0001-9798-2079}{ORCID}) 28 | } 29 | 30 | Other contributors: 31 | \itemize{ 32 | \item Paul Hoffman \email{phoffman@nygenome.org} (\href{https://orcid.org/0000-0002-7693-8957}{ORCID}) [contributor] 33 | \item Rahul Satija \email{rsatija@nygenome.org} (\href{https://orcid.org/0000-0001-9448-8833}{ORCID}) [contributor] 34 | } 35 | 36 | } 37 | \concept{assay} 38 | -------------------------------------------------------------------------------- /man/SortIdents.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/utilities.R 3 | \name{SortIdents} 4 | \alias{SortIdents} 5 | \title{Sorts cell metadata variable by similarity using hierarchical clustering} 6 | \usage{ 7 | SortIdents( 8 | object, 9 | layer = "data", 10 | assay = NULL, 11 | label = NULL, 12 | dendrogram = FALSE, 13 | method = "euclidean", 14 | verbose = TRUE 15 | ) 16 | } 17 | \arguments{ 18 | \item{object}{A Seurat object containing single-cell data.} 19 | 20 | \item{layer}{The layer of the data to use (default is "data").} 21 | 22 | \item{assay}{Name of assay to use. If NULL, use the default assay} 23 | 24 | \item{label}{Metadata attribute to sort. If NULL, 25 | uses the active identities.} 26 | 27 | \item{dendrogram}{Logical, whether to plot the dendrogram (default is FALSE).} 28 | 29 | \item{method}{The distance method to use for hierarchical clustering 30 | (default is 'euclidean', other options from \code{\link[stats]{dist}} are 31 | 'maximum', 'manhattan', 'canberra', 'binary' and 'minkowski').} 32 | 33 | \item{verbose}{Display messages} 34 | } 35 | \value{ 36 | The Seurat object with metadata variable reordered by similarity. 37 | If the metadata variable was a character vector, it will be converted to a 38 | factor and the factor levels set according to the similarity ordering. If 39 | active identities were used (label=NULL), the levels will be updated according 40 | to similarity ordering. 41 | } 42 | \description{ 43 | Compute distance matrix from a feature/variable matrix and 44 | perform hierarchical clustering to order variables (for example, cell types) 45 | according to their similarity. 46 | } 47 | \examples{ 48 | atac_small$test <- sample(1:10, ncol(atac_small), replace = TRUE) 49 | atac_small <- SortIdents(object = atac_small, label = 'test') 50 | print(levels(atac_small$test)) 51 | 52 | } 53 | \concept{utilities} 54 | -------------------------------------------------------------------------------- /man/SplitFragments.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/fragments.R 3 | \name{SplitFragments} 4 | \alias{SplitFragments} 5 | \title{Split fragment file by cell identities} 6 | \usage{ 7 | SplitFragments( 8 | object, 9 | assay = NULL, 10 | group.by = NULL, 11 | idents = NULL, 12 | outdir = getwd(), 13 | file.suffix = "", 14 | append = TRUE, 15 | buffer_length = 256L, 16 | verbose = TRUE 17 | ) 18 | } 19 | \arguments{ 20 | \item{object}{A Seurat object} 21 | 22 | \item{assay}{Name of assay to use} 23 | 24 | \item{group.by}{Name of grouping variable to group cells by} 25 | 26 | \item{idents}{List of identities to include} 27 | 28 | \item{outdir}{Directory to write output files} 29 | 30 | \item{file.suffix}{Suffix to add to all file names (before file extension). 31 | If splitting multiple fragment files without the \code{append} option set to 32 | TRUE, an additional numeric suffix will be added to each file (eg, .1, .2).} 33 | 34 | \item{append}{If splitting multiple fragment files, append cells from the 35 | same group (eg cluster) to the same file. Note that this can cause the output 36 | file to be unsorted.} 37 | 38 | \item{buffer_length}{Size of buffer to be read from the fragment file. This 39 | must be longer than the longest line in the file.} 40 | 41 | \item{verbose}{Display messages} 42 | } 43 | \description{ 44 | Splits a fragment file into separate files for each group of cells. If 45 | splitting multiple fragment files containing common cell types, fragments 46 | originating from different files will be appended to the same file for one 47 | group of cell identities. 48 | } 49 | \concept{fragments} 50 | -------------------------------------------------------------------------------- /man/StringToGRanges.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/utilities.R 3 | \name{StringToGRanges} 4 | \alias{StringToGRanges} 5 | \title{String to GRanges} 6 | \usage{ 7 | StringToGRanges(regions, sep = c("-", "-"), ...) 8 | } 9 | \arguments{ 10 | \item{regions}{Vector of genomic region strings} 11 | 12 | \item{sep}{Vector of separators to use for genomic string. First element is 13 | used to separate chromosome and coordinates, second separator is used to 14 | separate start and end coordinates.} 15 | 16 | \item{...}{Additional arguments passed to 17 | \code{\link[GenomicRanges]{makeGRangesFromDataFrame}}} 18 | } 19 | \value{ 20 | Returns a GRanges object 21 | } 22 | \description{ 23 | Convert a genomic coordinate string to a GRanges object 24 | } 25 | \examples{ 26 | regions <- c('chr1-1-10', 'chr2-12-3121') 27 | StringToGRanges(regions = regions) 28 | } 29 | \concept{utilities} 30 | -------------------------------------------------------------------------------- /man/SubsetMatrix.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/utilities.R 3 | \name{SubsetMatrix} 4 | \alias{SubsetMatrix} 5 | \title{Subset matrix rows and columns} 6 | \usage{ 7 | SubsetMatrix( 8 | mat, 9 | min.rows = 1, 10 | min.cols = 1, 11 | max.row.val = 10, 12 | max.col.val = NULL 13 | ) 14 | } 15 | \arguments{ 16 | \item{mat}{A matrix} 17 | 18 | \item{min.rows}{Minimum number of non-zero elements for 19 | the row to be retained} 20 | 21 | \item{min.cols}{Minimum number of non-zero elements for 22 | the column to be retained} 23 | 24 | \item{max.row.val}{Maximum allowed value in a row for the 25 | row to be retained. If NULL, don't set any limit.} 26 | 27 | \item{max.col.val}{Maximum allowed value in a column for 28 | the column to be retained. If NULL, don't set any limit.} 29 | } 30 | \value{ 31 | Returns a matrix 32 | } 33 | \description{ 34 | Subset the rows and columns of a matrix by removing 35 | rows and columns with less than the specified number of 36 | non-zero elements. 37 | } 38 | \examples{ 39 | SubsetMatrix(mat = volcano) 40 | } 41 | \concept{utilities} 42 | -------------------------------------------------------------------------------- /man/TSSEnrichment.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/region-enrichment.R 3 | \name{TSSEnrichment} 4 | \alias{TSSEnrichment} 5 | \title{Compute TSS enrichment score per cell} 6 | \usage{ 7 | TSSEnrichment( 8 | object, 9 | tss.positions = NULL, 10 | n = NULL, 11 | fast = TRUE, 12 | assay = NULL, 13 | cells = NULL, 14 | process_n = 2000, 15 | verbose = TRUE, 16 | region_extension = 1000 17 | ) 18 | } 19 | \arguments{ 20 | \item{object}{A Seurat object} 21 | 22 | \item{tss.positions}{A GRanges object containing the TSS positions. If NULL, 23 | use the genomic annotations stored in the assay.} 24 | 25 | \item{n}{Number of TSS positions to use. This will select the first _n_ 26 | TSSs from the set. If NULL, use all TSSs (slower).} 27 | 28 | \item{fast}{Just compute the TSS enrichment score, without storing the 29 | base-resolution matrix of integration counts at each site. This reduces the 30 | memory required to store the object but does not allow plotting the 31 | accessibility profile at the TSS.} 32 | 33 | \item{assay}{Name of assay to use} 34 | 35 | \item{cells}{A vector of cells to include. If NULL (default), use all cells 36 | in the object} 37 | 38 | \item{process_n}{Number of regions to process at a time if using \code{fast} 39 | option.} 40 | 41 | \item{verbose}{Display messages} 42 | 43 | \item{region_extension}{Distance extended upstream and downstream from TSS 44 | in which to calculate enrichment and background.} 45 | } 46 | \value{ 47 | Returns a \code{\link[SeuratObject]{Seurat}} object 48 | } 49 | \description{ 50 | Compute the transcription start site (TSS) enrichment score for each cell, 51 | as defined by ENCODE: 52 | \url{https://www.encodeproject.org/data-standards/terms/}. 53 | } 54 | \details{ 55 | The computed score will be added to the object metadata as "TSS.enrichment". 56 | } 57 | \examples{ 58 | \dontrun{ 59 | fpath <- system.file("extdata", "fragments.tsv.gz", package="Signac") 60 | Fragments(atac_small) <- CreateFragmentObject( 61 | path = fpath, 62 | cells = colnames(atac_small), 63 | tolerance = 0.5 64 | ) 65 | TSSEnrichment(object = atac_small) 66 | } 67 | } 68 | \concept{qc} 69 | -------------------------------------------------------------------------------- /man/TSSPlot.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/visualization.R 3 | \name{TSSPlot} 4 | \alias{TSSPlot} 5 | \title{Plot signal enrichment around TSSs} 6 | \usage{ 7 | TSSPlot(object, assay = NULL, group.by = NULL, idents = NULL) 8 | } 9 | \arguments{ 10 | \item{object}{A Seurat object} 11 | 12 | \item{assay}{Name of the assay to use. Should have the TSS enrichment 13 | information for each cell 14 | already computed by running \code{\link{TSSEnrichment}}} 15 | 16 | \item{group.by}{Set of identities to group cells by} 17 | 18 | \item{idents}{Set of identities to include in the plot} 19 | } 20 | \value{ 21 | Returns a \code{\link[ggplot2]{ggplot2}} object 22 | } 23 | \description{ 24 | Plot the normalized TSS enrichment score at each position relative to the 25 | TSS. Requires that \code{\link{TSSEnrichment}} has already been run on the 26 | assay. 27 | } 28 | \concept{qc} 29 | \concept{visualization} 30 | -------------------------------------------------------------------------------- /man/TilePlot.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/visualization.R 3 | \name{TilePlot} 4 | \alias{TilePlot} 5 | \title{Plot integration sites per cell} 6 | \usage{ 7 | TilePlot( 8 | object, 9 | region, 10 | sep = c("-", "-"), 11 | tile.size = 100, 12 | tile.cells = 100, 13 | extend.upstream = 0, 14 | extend.downstream = 0, 15 | assay = NULL, 16 | cells = NULL, 17 | group.by = NULL, 18 | order.by = "total", 19 | idents = NULL 20 | ) 21 | } 22 | \arguments{ 23 | \item{object}{A Seurat object} 24 | 25 | \item{region}{A set of genomic coordinates to show. Can be a GRanges object, 26 | a string encoding a genomic position, a gene name, or a vector of strings 27 | describing the genomic coordinates or gene names to plot. If a gene name is 28 | supplied, annotations must be present in the assay.} 29 | 30 | \item{sep}{Separators to use for strings encoding genomic coordinates. First 31 | element is used to separate the chromosome from the coordinates, second 32 | element is used to separate the start from end coordinate.} 33 | 34 | \item{tile.size}{Size of the sliding window for per-cell fragment tile plot} 35 | 36 | \item{tile.cells}{Number of cells to display fragment information for in tile 37 | plot.} 38 | 39 | \item{extend.upstream}{Number of bases to extend the region upstream.} 40 | 41 | \item{extend.downstream}{Number of bases to extend the region downstream.} 42 | 43 | \item{assay}{Name of assay to use} 44 | 45 | \item{cells}{Which cells to plot. Default all cells} 46 | 47 | \item{group.by}{Name of grouping variable to group cells by. If NULL, use the 48 | current cell identities} 49 | 50 | \item{order.by}{Option for determining how cells are chosen from each group. 51 | Options are "total" or "random". "total" will select the top cells based on 52 | total number of fragments in the region, "random" will select randomly.} 53 | 54 | \item{idents}{List of cell identities to include in the plot. If NULL, use 55 | all identities.} 56 | } 57 | \value{ 58 | Returns a \code{\link[ggplot2]{ggplot}} object 59 | } 60 | \description{ 61 | Plots the presence/absence of Tn5 integration sites for each cell 62 | within a genomic region. 63 | } 64 | \examples{ 65 | \donttest{ 66 | fpath <- system.file("extdata", "fragments.tsv.gz", package="Signac") 67 | fragments <- CreateFragmentObject( 68 | path = fpath, 69 | cells = colnames(atac_small), 70 | validate.fragments = FALSE 71 | ) 72 | Fragments(atac_small) <- fragments 73 | TilePlot(object = atac_small, region = c("chr1-713500-714500")) 74 | } 75 | } 76 | \concept{visualization} 77 | -------------------------------------------------------------------------------- /man/UnifyPeaks.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/utilities.R 3 | \name{UnifyPeaks} 4 | \alias{UnifyPeaks} 5 | \title{Unify genomic ranges} 6 | \usage{ 7 | UnifyPeaks(object.list, mode = "reduce") 8 | } 9 | \arguments{ 10 | \item{object.list}{A list of Seurat objects or ChromatinAssay objects} 11 | 12 | \item{mode}{Function to use when combining genomic ranges. Can be "reduce" 13 | (default) or "disjoin". 14 | See \code{\link[GenomicRanges]{reduce}} 15 | and \code{\link[GenomicRanges]{disjoin}} 16 | for more information on these functions.} 17 | } 18 | \value{ 19 | Returns a GRanges object 20 | } 21 | \description{ 22 | Create a unified set of non-overlapping genomic ranges 23 | from multiple Seurat objects containing single-cell 24 | chromatin data. 25 | } 26 | \examples{ 27 | UnifyPeaks(object.list = list(atac_small, atac_small)) 28 | } 29 | \concept{preprocessing} 30 | \concept{utilities} 31 | -------------------------------------------------------------------------------- /man/UpdatePath.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/fragments.R 3 | \name{UpdatePath} 4 | \alias{UpdatePath} 5 | \title{Update the file path for a Fragment object} 6 | \usage{ 7 | UpdatePath(object, new.path, verbose = TRUE) 8 | } 9 | \arguments{ 10 | \item{object}{A \code{\link{Fragment}} object} 11 | 12 | \item{new.path}{Path to the fragment file} 13 | 14 | \item{verbose}{Display messages} 15 | } 16 | \description{ 17 | Change the path to a fragment file store in a \code{\link{Fragment}} 18 | object. Path must be to the same file that was used to create the fragment 19 | object. An MD5 hash will be computed using the new path and compared to the 20 | hash stored in the Fragment object to verify that the files are the same. 21 | } 22 | \concept{fragments} 23 | -------------------------------------------------------------------------------- /man/ValidateCells.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/fragments.R 3 | \name{ValidateCells} 4 | \alias{ValidateCells} 5 | \title{Validate cells present in fragment file} 6 | \usage{ 7 | ValidateCells( 8 | object, 9 | cells = NULL, 10 | tolerance = 0.5, 11 | max.lines = 5e+07, 12 | verbose = TRUE 13 | ) 14 | } 15 | \arguments{ 16 | \item{object}{A \code{\link{Fragment}} object} 17 | 18 | \item{cells}{A character vector containing cell barcodes to search for. 19 | If NULL, use the cells stored in the Fragment object.} 20 | 21 | \item{tolerance}{Fraction of input cells that can be unseen before returning 22 | TRUE. For example, \code{tolerance = 0.01} will return TRUE when 99% of cells 23 | have observed fragments in the file. This can be useful if there are cells 24 | present that have much fewer total counts, and would require extensive 25 | searching before a fragment from those cells are found.} 26 | 27 | \item{max.lines}{Maximum number of lines to read in without finding the 28 | required number of cells before returning FALSE. Setting this value avoids 29 | having to search the whole file if it becomes clear that the expected cells 30 | are not present. Setting this value to NULL will enable an exhaustive search 31 | of the entire file.} 32 | 33 | \item{verbose}{Display messages} 34 | } 35 | \description{ 36 | Search for a fragment from each cell that should exist in the fragment file. 37 | Will iterate through chunks of the fragment file until at least one fragment 38 | from each cell barcode requested is found. 39 | } 40 | \concept{fragments} 41 | -------------------------------------------------------------------------------- /man/ValidateFragments.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/fragments.R 3 | \name{ValidateFragments} 4 | \alias{ValidateFragments} 5 | \title{Validate Fragment object} 6 | \usage{ 7 | ValidateFragments(object, verbose = TRUE, ...) 8 | } 9 | \arguments{ 10 | \item{object}{A \code{\link{Fragment}} object} 11 | 12 | \item{verbose}{Display messages} 13 | 14 | \item{...}{Additional parameters passed to \code{\link{ValidateCells}}} 15 | } 16 | \description{ 17 | Verify that the cells listed in the object exist in the fragment file 18 | and that the fragment file or index have not changed since creating the 19 | fragment object. 20 | } 21 | \concept{fragments} 22 | -------------------------------------------------------------------------------- /man/ValidateHash.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/fragments.R 3 | \name{ValidateHash} 4 | \alias{ValidateHash} 5 | \title{Validate hashes for Fragment object} 6 | \usage{ 7 | ValidateHash(object, verbose = TRUE) 8 | } 9 | \arguments{ 10 | \item{object}{A \code{\link{Fragment}} object} 11 | 12 | \item{verbose}{Display messages} 13 | } 14 | \description{ 15 | Validate hashes for Fragment object 16 | } 17 | \concept{fragments} 18 | -------------------------------------------------------------------------------- /man/VariantPlot.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/visualization.R 3 | \name{VariantPlot} 4 | \alias{VariantPlot} 5 | \title{Plot strand concordance vs. VMR} 6 | \usage{ 7 | VariantPlot( 8 | variants, 9 | min.cells = 2, 10 | concordance.threshold = 0.65, 11 | vmr.threshold = 0.01 12 | ) 13 | } 14 | \arguments{ 15 | \item{variants}{A dataframe containing variant information. This should be 16 | computed using \code{\link{IdentifyVariants}}} 17 | 18 | \item{min.cells}{Minimum number of high-confidence cells detected with the 19 | variant for the variant to be displayed.} 20 | 21 | \item{concordance.threshold}{Strand concordance threshold} 22 | 23 | \item{vmr.threshold}{Mean-variance ratio threshold} 24 | } 25 | \description{ 26 | Plot the Pearson correlation between allele frequencies on each strand 27 | versus the log10 mean-variance ratio for the allele. 28 | } 29 | \concept{mito} 30 | \concept{visualization} 31 | -------------------------------------------------------------------------------- /man/as.ChromatinAssay.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/generics.R, R/objects.R 3 | \name{as.ChromatinAssay} 4 | \alias{as.ChromatinAssay} 5 | \alias{as.ChromatinAssay.Assay} 6 | \title{Convert objects to a ChromatinAssay} 7 | \usage{ 8 | as.ChromatinAssay(x, ...) 9 | 10 | \method{as.ChromatinAssay}{Assay}( 11 | x, 12 | ranges = NULL, 13 | seqinfo = NULL, 14 | annotation = NULL, 15 | motifs = NULL, 16 | fragments = NULL, 17 | bias = NULL, 18 | positionEnrichment = NULL, 19 | sep = c("-", "-"), 20 | ... 21 | ) 22 | } 23 | \arguments{ 24 | \item{x}{An object to convert to class \code{\link{ChromatinAssay}}} 25 | 26 | \item{...}{Arguments passed to other methods} 27 | 28 | \item{ranges}{A GRanges object} 29 | 30 | \item{seqinfo}{A \code{\link[GenomeInfoDb]{Seqinfo}} object containing basic 31 | information about the genome used. Alternatively, the name of a UCSC genome 32 | can be provided and the sequence information will be downloaded from UCSC.} 33 | 34 | \item{annotation}{Genomic annotation} 35 | 36 | \item{motifs}{A \code{\link{Motif}} object} 37 | 38 | \item{fragments}{A list of \code{\link{Fragment}} objects} 39 | 40 | \item{bias}{Tn5 integration bias matrix} 41 | 42 | \item{positionEnrichment}{A named list of position enrichment matrices.} 43 | 44 | \item{sep}{Characters used to separate the chromosome, start, and end 45 | coordinates in the row names of the data matrix} 46 | } 47 | \description{ 48 | Convert objects to a ChromatinAssay 49 | } 50 | \concept{assay} 51 | -------------------------------------------------------------------------------- /man/atac_small.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/data.R 3 | \docType{data} 4 | \name{atac_small} 5 | \alias{atac_small} 6 | \title{A small example scATAC-seq dataset} 7 | \format{ 8 | A Seurat object with the following assays 9 | \describe{ 10 | \item{peaks}{A peak x cell dataset} 11 | \item{bins}{A 5 kb genome bin x cell dataset} 12 | \item{RNA}{A gene x cell dataset} 13 | } 14 | } 15 | \source{ 16 | \url{https://support.10xgenomics.com/single-cell-atac/datasets/1.1.0/atac_v1_pbmc_10k} 17 | } 18 | \usage{ 19 | atac_small 20 | } 21 | \description{ 22 | A subsetted version of 10x Genomics 10k human (hg19) PBMC scATAC-seq dataset 23 | } 24 | \concept{data} 25 | \keyword{datasets} 26 | -------------------------------------------------------------------------------- /man/blacklist_ce10.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/data.R 3 | \docType{data} 4 | \name{blacklist_ce10} 5 | \alias{blacklist_ce10} 6 | \title{Genomic blacklist regions for C. elegans ce10 (0-based)} 7 | \format{ 8 | A GRanges object 9 | } 10 | \source{ 11 | \url{https://github.com/Boyle-Lab/Blacklist} 12 | 13 | \doi{10.1038/s41598-019-45839-z} 14 | } 15 | \usage{ 16 | blacklist_ce10 17 | } 18 | \description{ 19 | Genomic blacklist regions for C. elegans ce10 (0-based) 20 | } 21 | \concept{data} 22 | \keyword{datasets} 23 | -------------------------------------------------------------------------------- /man/blacklist_ce11.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/data.R 3 | \docType{data} 4 | \name{blacklist_ce11} 5 | \alias{blacklist_ce11} 6 | \title{Genomic blacklist regions for C. elegans ce11 (0-based)} 7 | \format{ 8 | A GRanges object 9 | } 10 | \source{ 11 | \url{https://github.com/Boyle-Lab/Blacklist} 12 | 13 | \doi{10.1038/s41598-019-45839-z} 14 | } 15 | \usage{ 16 | blacklist_ce11 17 | } 18 | \description{ 19 | Genomic blacklist regions for C. elegans ce11 (0-based) 20 | } 21 | \concept{data} 22 | \keyword{datasets} 23 | -------------------------------------------------------------------------------- /man/blacklist_dm3.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/data.R 3 | \docType{data} 4 | \name{blacklist_dm3} 5 | \alias{blacklist_dm3} 6 | \title{Genomic blacklist regions for Drosophila dm3 (0-based)} 7 | \format{ 8 | A GRanges object 9 | } 10 | \source{ 11 | \url{https://github.com/Boyle-Lab/Blacklist} 12 | 13 | \doi{10.1038/s41598-019-45839-z} 14 | } 15 | \usage{ 16 | blacklist_dm3 17 | } 18 | \description{ 19 | Genomic blacklist regions for Drosophila dm3 (0-based) 20 | } 21 | \concept{data} 22 | \keyword{datasets} 23 | -------------------------------------------------------------------------------- /man/blacklist_dm6.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/data.R 3 | \docType{data} 4 | \name{blacklist_dm6} 5 | \alias{blacklist_dm6} 6 | \title{Genomic blacklist regions for Drosophila dm6 (0-based)} 7 | \format{ 8 | A GRanges object 9 | } 10 | \source{ 11 | \url{https://github.com/Boyle-Lab/Blacklist} 12 | 13 | \doi{10.1038/s41598-019-45839-z} 14 | } 15 | \usage{ 16 | blacklist_dm6 17 | } 18 | \description{ 19 | Genomic blacklist regions for Drosophila dm6 (0-based) 20 | } 21 | \concept{data} 22 | \keyword{datasets} 23 | -------------------------------------------------------------------------------- /man/blacklist_hg19.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/data.R 3 | \docType{data} 4 | \name{blacklist_hg19} 5 | \alias{blacklist_hg19} 6 | \title{Genomic blacklist regions for Human hg19 (0-based)} 7 | \format{ 8 | A GRanges object 9 | } 10 | \source{ 11 | \url{https://github.com/Boyle-Lab/Blacklist} 12 | 13 | \doi{10.1038/s41598-019-45839-z} 14 | } 15 | \usage{ 16 | blacklist_hg19 17 | } 18 | \description{ 19 | Genomic blacklist regions for Human hg19 (0-based) 20 | } 21 | \concept{data} 22 | \keyword{datasets} 23 | -------------------------------------------------------------------------------- /man/blacklist_hg38.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/data.R 3 | \docType{data} 4 | \name{blacklist_hg38} 5 | \alias{blacklist_hg38} 6 | \title{Genomic blacklist regions for Human GRCh38} 7 | \format{ 8 | A GRanges object 9 | } 10 | \source{ 11 | \url{https://github.com/Boyle-Lab/Blacklist} 12 | 13 | \doi{10.1038/s41598-019-45839-z} 14 | } 15 | \usage{ 16 | blacklist_hg38 17 | } 18 | \description{ 19 | Genomic blacklist regions for Human GRCh38 20 | } 21 | \concept{data} 22 | \keyword{datasets} 23 | -------------------------------------------------------------------------------- /man/blacklist_hg38_unified.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/data.R 3 | \docType{data} 4 | \name{blacklist_hg38_unified} 5 | \alias{blacklist_hg38_unified} 6 | \title{Unified genomic blacklist regions for Human GRCh38} 7 | \format{ 8 | A GRanges object 9 | } 10 | \source{ 11 | \url{https://www.encodeproject.org/files/ENCFF356LFX/} 12 | 13 | \doi{10.1038/s41598-019-45839-z} 14 | } 15 | \usage{ 16 | blacklist_hg38_unified 17 | } 18 | \description{ 19 | Manually curated genomic blacklist regions for the hg38 genome by Anshul 20 | Kundaje and Anna Shcherbina. See 21 | \url{https://www.encodeproject.org/files/ENCFF356LFX/} for a description of 22 | how this blacklist was curated. 23 | } 24 | \author{ 25 | Anshul Kundaje 26 | 27 | Anna Shcherbina 28 | } 29 | \concept{data} 30 | \keyword{datasets} 31 | -------------------------------------------------------------------------------- /man/blacklist_mm10.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/data.R 3 | \docType{data} 4 | \name{blacklist_mm10} 5 | \alias{blacklist_mm10} 6 | \title{Genomic blacklist regions for Mouse mm10 (0-based)} 7 | \format{ 8 | A GRanges object 9 | } 10 | \source{ 11 | \url{https://github.com/Boyle-Lab/Blacklist} 12 | 13 | \doi{10.1038/s41598-019-45839-z} 14 | } 15 | \usage{ 16 | blacklist_mm10 17 | } 18 | \description{ 19 | Genomic blacklist regions for Mouse mm10 (0-based) 20 | } 21 | \concept{data} 22 | \keyword{datasets} 23 | -------------------------------------------------------------------------------- /man/corSparse.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/utilities.R 3 | \name{corSparse} 4 | \alias{corSparse} 5 | \title{Sparse matrix correlation} 6 | \usage{ 7 | corSparse(X, Y = NULL, cov = FALSE) 8 | } 9 | \arguments{ 10 | \item{X}{A matrix} 11 | 12 | \item{Y}{A matrix} 13 | 14 | \item{cov}{return covariance matrix} 15 | } 16 | \description{ 17 | Compute the Pearson correlation matrix between 18 | columns of two sparse matrices. 19 | } 20 | \details{ 21 | Originally from 22 | \url{https://stackoverflow.com/questions/5888287/running-cor-or-any-variant-over-a-sparse-matrix-in-r} 23 | and the qlcMatrix package. 24 | } 25 | \author{ 26 | Michael Cysouw, Karsten Looschen 27 | } 28 | \keyword{internal} 29 | -------------------------------------------------------------------------------- /man/coverage-ChromatinAssay-method.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/iranges-methods.R 3 | \name{coverage,ChromatinAssay-method} 4 | \alias{coverage,ChromatinAssay-method} 5 | \alias{coverage} 6 | \alias{coverage,Seurat-method} 7 | \title{Coverage of a ChromatinAssay object} 8 | \usage{ 9 | \S4method{coverage}{ChromatinAssay}( 10 | x, 11 | shift = 0L, 12 | width = NULL, 13 | weight = 1L, 14 | method = c("auto", "sort", "hash") 15 | ) 16 | 17 | \S4method{coverage}{Seurat}( 18 | x, 19 | shift = 0L, 20 | width = NULL, 21 | weight = 1L, 22 | method = c("auto", "sort", "hash") 23 | ) 24 | } 25 | \arguments{ 26 | \item{x}{A \code{\link{ChromatinAssay}} object} 27 | 28 | \item{shift}{How much each range should be shifted before coverage is 29 | computed. See \code{\link[IRanges]{coverage}} in the \pkg{IRanges} package.} 30 | 31 | \item{width}{Specifies the length of the returned coverage vectors. 32 | See \code{\link[IRanges]{coverage}} in the \pkg{IRanges} package.} 33 | 34 | \item{weight}{Assigns weight to each range in \code{x}. 35 | See \code{\link[IRanges]{coverage}} in the \pkg{IRanges} package.} 36 | 37 | \item{method}{See \code{\link[IRanges]{coverage}} in the \pkg{IRanges} 38 | package} 39 | } 40 | \description{ 41 | This is the \code{coverage} method for \code{\link{ChromatinAssay}} objects. 42 | } 43 | \section{Functions}{ 44 | \itemize{ 45 | \item \code{coverage(ChromatinAssay)}: method for ChromatinAssay objects 46 | 47 | \item \code{coverage(Seurat)}: method for Seurat objects 48 | 49 | }} 50 | \seealso{ 51 | \itemize{ 52 | \item{\link[IRanges]{coverage-methods} in the \pkg{IRanges} package.} 53 | \item{\link[GenomicRanges]{coverage-methods} in the \pkg{GenomicRanges} 54 | package} 55 | \item{\link{ChromatinAssay-class}} 56 | } 57 | } 58 | \concept{coverage} 59 | -------------------------------------------------------------------------------- /man/figures/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stuart-lab/signac/0b33b1154f9a610897d1efad2c0065081c4e7132/man/figures/icon.png -------------------------------------------------------------------------------- /man/figures/icon.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 10 | 11 | 12 | 13 | 14 | 15 | 17 | 18 | -------------------------------------------------------------------------------- /man/figures/icon_grey.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stuart-lab/signac/0b33b1154f9a610897d1efad2c0065081c4e7132/man/figures/icon_grey.png -------------------------------------------------------------------------------- /man/figures/icon_grey.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 9 | 10 | 11 | 12 | 13 | 14 | 16 | 17 | -------------------------------------------------------------------------------- /man/figures/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stuart-lab/signac/0b33b1154f9a610897d1efad2c0065081c4e7132/man/figures/logo.png -------------------------------------------------------------------------------- /man/granges-methods.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/granges-methods.R 3 | \name{granges-methods} 4 | \alias{granges-methods} 5 | \alias{granges} 6 | \alias{granges,ChromatinAssay-method} 7 | \alias{granges,Seurat-method} 8 | \title{Access genomic ranges for ChromatinAssay objects} 9 | \usage{ 10 | \S4method{granges}{ChromatinAssay}(x, use.names = TRUE, use.mcols = FALSE, ...) 11 | 12 | \S4method{granges}{Seurat}(x, use.names = TRUE, use.mcols = FALSE, ...) 13 | } 14 | \arguments{ 15 | \item{x}{A \code{\link{ChromatinAssay}} object} 16 | 17 | \item{use.names}{Whether the names on the genomic ranges should be 18 | propagated to the returned object.} 19 | 20 | \item{use.mcols}{Not supported for \code{\link{ChromatinAssay}} objects} 21 | 22 | \item{...}{Additional arguments} 23 | } 24 | \value{ 25 | Returns a \code{\link[GenomicRanges]{GRanges}} object 26 | } 27 | \description{ 28 | Methods for accessing \code{\link[GenomicRanges]{GRanges}} object 29 | information stored in a \code{\link{ChromatinAssay}} object. 30 | } 31 | \section{Functions}{ 32 | \itemize{ 33 | \item \code{granges(Seurat)}: method for Seurat objects 34 | 35 | }} 36 | \examples{ 37 | granges(atac_small) 38 | } 39 | \seealso{ 40 | \itemize{ 41 | \item{\link[GenomicRanges]{granges} in the \pkg{GenomicRanges} package.} 42 | \item{\link{ChromatinAssay-class}} 43 | } 44 | } 45 | \concept{granges} 46 | -------------------------------------------------------------------------------- /man/head.Fragment.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/fragments.R 3 | \name{head.Fragment} 4 | \alias{head.Fragment} 5 | \title{Return the first rows of a fragment file} 6 | \usage{ 7 | \method{head}{Fragment}(x, n = 6L, ...) 8 | } 9 | \arguments{ 10 | \item{x}{a \code{Fragment} object} 11 | 12 | \item{n}{an integer specifying the number of rows to return from the fragment 13 | file} 14 | 15 | \item{...}{additional arguments passed to \code{\link[utils]{read.table}}} 16 | } 17 | \value{ 18 | The first \code{n} rows of a fragment file as a \code{data.frame} 19 | with the following columns: chrom, start, end, barcode, readCount. 20 | } 21 | \description{ 22 | Returns the first \code{n} rows of a fragment file. This allows the content 23 | of a fragment file to be inspected. 24 | } 25 | \concept{fragments} 26 | -------------------------------------------------------------------------------- /man/inter-range-methods.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/iranges-methods.R 3 | \name{inter-range-methods} 4 | \alias{inter-range-methods} 5 | \alias{range} 6 | \alias{range,ChromatinAssay-method} 7 | \alias{range,Seurat-method} 8 | \alias{reduce,ChromatinAssay-method} 9 | \alias{reduce} 10 | \alias{reduce,Seurat-method} 11 | \alias{gaps,ChromatinAssay-method} 12 | \alias{gaps} 13 | \alias{gaps,Seurat-method} 14 | \alias{disjoin,ChromatinAssay-method} 15 | \alias{disjoin} 16 | \alias{disjoin,Seurat-method} 17 | \alias{isDisjoint,ChromatinAssay-method} 18 | \alias{isDisjoint} 19 | \alias{isDisjoint,Seurat-method} 20 | \alias{disjointBins,ChromatinAssay-method} 21 | \alias{disjointBins} 22 | \alias{disjointBins,Seurat-method} 23 | \title{Inter-range transformations for ChromatinAssay objects} 24 | \usage{ 25 | \S4method{range}{ChromatinAssay}(x, ..., with.revmap = FALSE, na.rm = FALSE) 26 | 27 | \S4method{range}{Seurat}(x, ..., with.revmap = FALSE, na.rm = FALSE) 28 | 29 | \S4method{reduce}{ChromatinAssay}(x, drop.empty.ranges = FALSE, ...) 30 | 31 | \S4method{reduce}{Seurat}(x, drop.empty.ranges = FALSE, ...) 32 | 33 | \S4method{gaps}{ChromatinAssay}(x, start = NA, end = NA) 34 | 35 | \S4method{gaps}{Seurat}(x, start = NA, end = NA) 36 | 37 | \S4method{disjoin}{ChromatinAssay}(x, ...) 38 | 39 | \S4method{disjoin}{Seurat}(x, ...) 40 | 41 | \S4method{isDisjoint}{ChromatinAssay}(x, ...) 42 | 43 | \S4method{isDisjoint}{Seurat}(x, ...) 44 | 45 | \S4method{disjointBins}{ChromatinAssay}(x, ...) 46 | 47 | \S4method{disjointBins}{Seurat}(x, ...) 48 | } 49 | \arguments{ 50 | \item{x}{A \code{\link{ChromatinAssay}} object} 51 | 52 | \item{...}{Additional arguments} 53 | 54 | \item{with.revmap}{See \code{\link[IRanges]{inter-range-methods}} in the 55 | \pkg{IRanges} packages} 56 | 57 | \item{na.rm}{Ignored} 58 | 59 | \item{drop.empty.ranges}{See \code{?\link[IRanges]{inter-range-methods}}} 60 | 61 | \item{start, end}{See \code{?\link[IRanges]{inter-range-methods}}} 62 | } 63 | \description{ 64 | The \code{range, reduce, gaps, disjoin, isDisjoint, disjointBins} methods 65 | are available for \code{\link{ChromatinAssay}} objects. 66 | } 67 | \section{Functions}{ 68 | \itemize{ 69 | \item \code{range(Seurat)}: method for Seurat objects 70 | 71 | \item \code{reduce(ChromatinAssay)}: method for ChromatinAssay objects 72 | 73 | \item \code{reduce(Seurat)}: method for Seurat objects 74 | 75 | \item \code{gaps(ChromatinAssay)}: method for ChromatinAssay objects 76 | 77 | \item \code{gaps(Seurat)}: method for Seurat objects 78 | 79 | \item \code{disjoin(ChromatinAssay)}: method for ChromatinAssay objects 80 | 81 | \item \code{disjoin(Seurat)}: method for Seurat objects 82 | 83 | \item \code{isDisjoint(ChromatinAssay)}: method for ChromatinAssay objects 84 | 85 | \item \code{isDisjoint(Seurat)}: method for Seurat objects 86 | 87 | \item \code{disjointBins(ChromatinAssay)}: method for ChromatinAssay objects 88 | 89 | \item \code{disjointBins(Seurat)}: method for Seurat objects 90 | 91 | }} 92 | \seealso{ 93 | \itemize{ 94 | \item{\link[IRanges]{inter-range-methods} in the \pkg{IRanges} package.} 95 | \item{\link[GenomicRanges]{inter-range-methods} in the \pkg{GenomicRanges} 96 | package} 97 | \item{\link{ChromatinAssay-class}} 98 | } 99 | } 100 | \concept{inter_range} 101 | -------------------------------------------------------------------------------- /man/reexports.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/fragments.R 3 | \docType{import} 4 | \name{reexports} 5 | \alias{reexports} 6 | \alias{Cells} 7 | \title{Objects exported from other packages} 8 | \keyword{internal} 9 | \description{ 10 | These objects are imported from other packages. Follow the links 11 | below to see their documentation. 12 | 13 | \describe{ 14 | \item{SeuratObject}{\code{\link[SeuratObject]{Cells}}} 15 | }} 16 | 17 | -------------------------------------------------------------------------------- /man/subset.Fragment.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/objects.R 3 | \name{subset.Fragment} 4 | \alias{subset.Fragment} 5 | \title{Subset a Fragment object} 6 | \usage{ 7 | \method{subset}{Fragment}(x, cells = NULL, ...) 8 | } 9 | \arguments{ 10 | \item{x}{A Fragment object} 11 | 12 | \item{cells}{Vector of cells to retain} 13 | 14 | \item{...}{Arguments passed to other methods} 15 | } 16 | \value{ 17 | Returns a subsetted \code{\link{Fragment}} object 18 | } 19 | \description{ 20 | Returns a subset of a \code{\link{Fragment-class}} object. 21 | } 22 | \examples{ 23 | fpath <- system.file("extdata", "fragments.tsv.gz", package="Signac") 24 | cells <- colnames(x = atac_small) 25 | names(x = cells) <- paste0("test_", cells) 26 | frags <- CreateFragmentObject(path = fpath, cells = cells, verbose = FALSE, tolerance = 0.5) 27 | subset(frags, head(names(cells))) 28 | } 29 | \seealso{ 30 | \code{\link[base]{subset}} 31 | } 32 | \concept{fragments} 33 | -------------------------------------------------------------------------------- /man/subset.Motif.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/objects.R 3 | \name{subset.Motif} 4 | \alias{subset.Motif} 5 | \alias{[.Motif} 6 | \title{Subset a Motif object} 7 | \usage{ 8 | \method{subset}{Motif}(x, features = NULL, motifs = NULL, ...) 9 | 10 | \method{[}{Motif}(x, i, j, ...) 11 | } 12 | \arguments{ 13 | \item{x}{A Motif object} 14 | 15 | \item{features}{Which features to retain} 16 | 17 | \item{motifs}{Which motifs to retain} 18 | 19 | \item{...}{Arguments passed to other methods} 20 | 21 | \item{i}{Which columns to retain} 22 | 23 | \item{j}{Which rows to retain} 24 | } 25 | \value{ 26 | Returns a subsetted \code{\link{Motif}} object 27 | } 28 | \description{ 29 | Returns a subset of a \code{\link{Motif-class}} object. 30 | } 31 | \examples{ 32 | motif.obj <- SeuratObject::GetAssayData( 33 | object = atac_small[['peaks']], layer = "motifs" 34 | ) 35 | subset(x = motif.obj, features = head(rownames(motif.obj), 10)) 36 | motif.obj <- SeuratObject::GetAssayData( 37 | object = atac_small, assay = 'peaks', layer = 'motifs' 38 | ) 39 | motif.obj[1:10,1:10] 40 | } 41 | \seealso{ 42 | \code{\link[base]{subset}} 43 | } 44 | \concept{motifs} 45 | -------------------------------------------------------------------------------- /man/theme_browser.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/visualization.R 3 | \name{theme_browser} 4 | \alias{theme_browser} 5 | \title{Genome browser theme} 6 | \usage{ 7 | theme_browser(..., legend = TRUE, axis.text.y = FALSE) 8 | } 9 | \arguments{ 10 | \item{...}{Additional arguments} 11 | 12 | \item{legend}{Display plot legend} 13 | 14 | \item{axis.text.y}{Display y-axis text} 15 | } 16 | \description{ 17 | Theme applied to panels in the \code{\link{CoveragePlot}} function. 18 | } 19 | \examples{ 20 | \donttest{ 21 | PeakPlot(atac_small, region = "chr1-710000-715000") + theme_browser() 22 | } 23 | } 24 | \concept{visualization} 25 | -------------------------------------------------------------------------------- /pkgdown/extra.css: -------------------------------------------------------------------------------- 1 | details { 2 | background-color: #f0f8ff; 3 | padding: 10px; 4 | border-radius: 5px; 5 | } 6 | 7 | pre, code { 8 | white-space: pre !important; 9 | overflow-x: auto; 10 | } -------------------------------------------------------------------------------- /pkgdown/favicon/android-chrome-192x192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stuart-lab/signac/0b33b1154f9a610897d1efad2c0065081c4e7132/pkgdown/favicon/android-chrome-192x192.png -------------------------------------------------------------------------------- /pkgdown/favicon/android-chrome-512x512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stuart-lab/signac/0b33b1154f9a610897d1efad2c0065081c4e7132/pkgdown/favicon/android-chrome-512x512.png -------------------------------------------------------------------------------- /pkgdown/favicon/apple-touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stuart-lab/signac/0b33b1154f9a610897d1efad2c0065081c4e7132/pkgdown/favicon/apple-touch-icon.png -------------------------------------------------------------------------------- /pkgdown/favicon/browserconfig.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | #da532c 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /pkgdown/favicon/favicon-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stuart-lab/signac/0b33b1154f9a610897d1efad2c0065081c4e7132/pkgdown/favicon/favicon-16x16.png -------------------------------------------------------------------------------- /pkgdown/favicon/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stuart-lab/signac/0b33b1154f9a610897d1efad2c0065081c4e7132/pkgdown/favicon/favicon-32x32.png -------------------------------------------------------------------------------- /pkgdown/favicon/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stuart-lab/signac/0b33b1154f9a610897d1efad2c0065081c4e7132/pkgdown/favicon/favicon.ico -------------------------------------------------------------------------------- /pkgdown/favicon/mstile-150x150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stuart-lab/signac/0b33b1154f9a610897d1efad2c0065081c4e7132/pkgdown/favicon/mstile-150x150.png -------------------------------------------------------------------------------- /pkgdown/favicon/site.webmanifest: -------------------------------------------------------------------------------- 1 | { 2 | "name": "", 3 | "short_name": "", 4 | "icons": [ 5 | { 6 | "src": "/android-chrome-192x192.png", 7 | "sizes": "192x192", 8 | "type": "image/png" 9 | }, 10 | { 11 | "src": "/android-chrome-512x512.png", 12 | "sizes": "512x512", 13 | "type": "image/png" 14 | } 15 | ], 16 | "theme_color": "#ffffff", 17 | "background_color": "#ffffff", 18 | "display": "standalone" 19 | } 20 | -------------------------------------------------------------------------------- /src/Makevars: -------------------------------------------------------------------------------- 1 | PKG_LIBS = -lz 2 | -------------------------------------------------------------------------------- /src/filter.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | 7 | // [[Rcpp::export]] 8 | int filterCells( 9 | std::string fragments, 10 | std::string outfile, 11 | std::vector keep_cells, 12 | int buffer_length, 13 | bool verbose = true 14 | ) { 15 | // opening gzipped compressed stream 16 | gzFile ifileHandler = gzopen(fragments.c_str(), "rb"); 17 | std::ofstream ofileHandler; 18 | ofileHandler.open(outfile.c_str()); 19 | 20 | // return 1 if it can't find the file 21 | if (ifileHandler == NULL) { 22 | Rcpp::Rcerr << "can't open file" << std::flush; 23 | return 1; 24 | } 25 | 26 | // C based buffered string parsing 27 | char* cb_char; 28 | size_t line_counter {1}; 29 | char *buffer = new char[buffer_length]; 30 | 31 | // Hash Map storing the barcodes to keep 32 | std::unordered_set index_hash(keep_cells.begin(), keep_cells.end()); 33 | 34 | size_t num_whitelist_cells {0}; 35 | { 36 | 37 | if (verbose) { 38 | num_whitelist_cells = index_hash.size(); 39 | Rcpp::Rcerr << "Keeping " << num_whitelist_cells 40 | << " cell barcodes" 41 | << std::endl << std::flush; 42 | } 43 | } 44 | 45 | // char * to string extraction 46 | std::string cb_seq, line_seq; 47 | cb_seq.reserve(2048); 48 | line_seq.reserve(buffer_length); 49 | 50 | bool eof_check; 51 | while ((eof_check = gzgets(ifileHandler, buffer, buffer_length)) !=0) { 52 | line_seq.clear(); 53 | line_seq.append(buffer); 54 | 55 | if (line_seq.at(0) != '#') { 56 | break; 57 | } 58 | } 59 | 60 | if (!eof_check) { 61 | Rcpp::Rcerr << "Error: fragment file contains header only\n" << std::flush; 62 | gzclose(ifileHandler); 63 | return 1; 64 | } 65 | 66 | line_seq.clear(); 67 | // looping over the fragments file 68 | do { 69 | line_seq.append(buffer); 70 | 71 | cb_char = strtok ( buffer, "\t" ); 72 | 73 | if (cb_char == NULL) { 74 | Rcpp::Rcerr << "Error: fragment file lines too long\n" << std::flush; 75 | gzclose(ifileHandler); 76 | return (false); 77 | } 78 | 79 | for (auto i=1; i<=3; i++) { 80 | cb_char = strtok (NULL, "\t"); 81 | 82 | if (cb_char == NULL) { 83 | Rcpp::Rcerr << "Error: fragment file lines too long\n" << std::flush; 84 | gzclose(ifileHandler); 85 | return (false); 86 | } 87 | 88 | if(i == 3) { 89 | cb_seq.clear(); 90 | cb_seq.append(cb_char); 91 | if (index_hash.count(cb_seq) > 0) { 92 | ofileHandler << line_seq.c_str(); 93 | } 94 | } 95 | } 96 | 97 | line_counter += 1; 98 | bool is_ten_mil = line_counter % 10000000 == 0; 99 | if (verbose) { 100 | if (is_ten_mil) { 101 | Rcpp::Rcerr << "\r "; 102 | } 103 | 104 | if (line_counter % 1000000 == 0) { 105 | Rcpp::Rcerr << "\rDone Processing " << line_counter / 1000000 106 | << " million lines"; 107 | } 108 | } 109 | 110 | if (is_ten_mil) { 111 | Rcpp::checkUserInterrupt(); 112 | } 113 | 114 | line_seq.clear(); 115 | } while(gzgets(ifileHandler, buffer, buffer_length) !=0 ); 116 | 117 | //Cleanup 118 | gzclose(ifileHandler); 119 | ofileHandler.close(); 120 | 121 | return 0; 122 | } 123 | -------------------------------------------------------------------------------- /src/group.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | using namespace Rcpp; 6 | 7 | SEXP groupCommand(std::string fragments); 8 | -------------------------------------------------------------------------------- /src/validate.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | // [[Rcpp::export]] 5 | bool validateCells( 6 | std::string fragments, 7 | std::vector cells, 8 | std::size_t find_n, 9 | std::size_t max_lines = 0, 10 | bool verbose = true 11 | ) { 12 | // opening gzipped compressed stream 13 | gzFile fileHandler = gzopen(fragments.c_str(), "rb"); 14 | 15 | // determine if we read the whole file or the first n lines 16 | bool read_part {false}; 17 | if (max_lines > 0) { 18 | read_part = true; 19 | } 20 | 21 | // return false it can't find the file 22 | if (fileHandler == NULL) { 23 | Rcpp::Rcerr << "can't open file" << std::flush; 24 | gzclose(fileHandler); 25 | return (false); 26 | } 27 | 28 | // C based buffered string parsing 29 | char* cb_char; 30 | size_t line_counter {1}; 31 | size_t total_seen {0}; 32 | uint32_t buffer_length = 4096; 33 | char *buffer = new char[buffer_length]; 34 | 35 | // Hash Map storing the barcodes to look for 36 | std::unordered_set index_hash(cells.begin(), cells.end()); 37 | 38 | // work out how many cells we need to see before returning true 39 | size_t ncell = index_hash.size(); 40 | { 41 | if (verbose) { 42 | Rcpp::Rcerr << "Checking for " << ncell 43 | << " cell barcodes" 44 | << std::endl << std::flush; 45 | } 46 | } 47 | 48 | // char * to string extraction 49 | std::string cb_seq, line_seq; 50 | cb_seq.reserve(2048); 51 | line_seq.reserve(buffer_length); 52 | 53 | // skip header if present 54 | bool eof_check; 55 | while ((eof_check = gzgets(fileHandler, buffer, buffer_length)) !=0) { 56 | line_seq.clear(); 57 | line_seq.append(buffer); 58 | 59 | if (line_seq.at(0) != '#') { 60 | break; 61 | } 62 | } 63 | 64 | if (!eof_check) { 65 | Rcpp::Rcerr << "Error: fragment file contains header only\n" << std::flush; 66 | gzclose(fileHandler); 67 | return (false); 68 | } 69 | 70 | // looping over the fragments file 71 | do { 72 | cb_char = strtok ( buffer, "\t" ); 73 | 74 | if (cb_char == NULL) { 75 | Rcpp::Rcerr << "Error: fragment file lines too long\n" << std::flush; 76 | gzclose(fileHandler); 77 | return (false); 78 | } 79 | 80 | for (auto i=1; i<=3; i++) { 81 | cb_char = strtok (NULL, "\t"); 82 | 83 | if (cb_char == NULL) { 84 | Rcpp::Rcerr << "Error: fragment file lines too long\n" << std::flush; 85 | gzclose(fileHandler); 86 | return (false); 87 | } 88 | 89 | if(i == 3) { 90 | cb_seq.clear(); 91 | cb_seq.append(cb_char); 92 | auto it = index_hash.find(cb_seq); 93 | if (it != index_hash.end()) { 94 | // cell exists in the set, remove from hash map 95 | index_hash.erase(it); 96 | total_seen++; 97 | } 98 | } 99 | } 100 | 101 | if (total_seen >= find_n) { 102 | gzclose(fileHandler); 103 | return(true); 104 | } 105 | 106 | line_counter += 1; 107 | if (read_part) { 108 | if (line_counter > max_lines) { 109 | gzclose(fileHandler); 110 | return(false); 111 | } 112 | } 113 | 114 | if (line_counter % 2000000 == 0) { 115 | Rcpp::checkUserInterrupt(); 116 | } 117 | } while(gzgets(fileHandler, buffer, buffer_length) !=0 ); 118 | 119 | //Cleanup 120 | gzclose(fileHandler); 121 | 122 | return (false); 123 | } 124 | -------------------------------------------------------------------------------- /tests/testdata/featurematrix.rds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stuart-lab/signac/0b33b1154f9a610897d1efad2c0065081c4e7132/tests/testdata/featurematrix.rds -------------------------------------------------------------------------------- /tests/testthat.R: -------------------------------------------------------------------------------- 1 | library(testthat) 2 | library(Signac) 3 | 4 | test_check("Signac") 5 | -------------------------------------------------------------------------------- /tests/testthat/test-dimreduc.R: -------------------------------------------------------------------------------- 1 | suppressWarnings(RNGversion(vstr = "3.5.3")) 2 | 3 | test_that("LSI works", { 4 | set.seed(seed = 1) 5 | mat <- matrix(data = rbinom(n = 25, size = 5, prob = 0.2), nrow = 5) 6 | method1 <- RunTFIDF(object = mat, method = 1) 7 | method2 <- RunTFIDF(object = mat, method = 2) 8 | method3 <- RunTFIDF(object = mat, method = 3) 9 | method4 <- RunTFIDF(object = mat, method = 4) 10 | 11 | expect_equal( 12 | object = method1[1, ], 13 | expected = c(0.000000, 7.957927, 0.000000, 7.131699, 8.805025), 14 | tolerance = 1 / 1000 15 | ) 16 | expect_equal( 17 | object = method2[1, ], 18 | expected = c(0.0000000, 0.1980421, 0.0000000, 0.0866434, 0.4620981), 19 | tolerance = 1 / 1000 20 | ) 21 | expect_equal( 22 | object = method3[1, ], 23 | expected = c(0.000000, 5.516015, 0.000000, 4.943317, 6.103178), 24 | tolerance = 1 / 1000 25 | ) 26 | expect_equal( 27 | object = method4[1, ], 28 | expected = c(0, 2, 0, 1, 2) 29 | ) 30 | 31 | lsi <- suppressWarnings(RunSVD(object = mat)) 32 | embeddings <- SeuratObject::Embeddings(object = lsi) 33 | loadings <- SeuratObject::Loadings(object = lsi) 34 | 35 | expect_equal( 36 | object = as.vector(embeddings[1, ]), 37 | expected = c(0.51255352, -0.08674426, 1.33604004, 1.18108240), 38 | tolerance = 1 / 1000 39 | ) 40 | expect_equal( 41 | object = as.vector(loadings[1, ]), 42 | expected = c(-0.4024075, -0.4292469, -0.6463644, 0.1740785), 43 | tolerance = 1 / 1000 44 | ) 45 | }) 46 | 47 | test_that("Jaccard works", { 48 | set.seed(1) 49 | mat <- matrix(data = sample(x = c(0, 1), size = 25, replace = TRUE), nrow = 5) 50 | jm <- Jaccard(x = mat, y = mat) 51 | expect_equal(object = jm[1, ], expected = c(1, 1 / 3, 2 / 5, 1 / 3, 0)) 52 | }) 53 | -------------------------------------------------------------------------------- /tests/testthat/test-mito.R: -------------------------------------------------------------------------------- 1 | test_that("Importing data from mgatk works", { 2 | set.seed(1) 3 | data.dir <- system.file("extdata", "test_mgatk", package="Signac") 4 | mgatk <- ReadMGATK(dir = data.dir) 5 | 6 | # We imported 11 cells 7 | expect_equal(object = dim(mgatk$depth), expected = c(11,1)) 8 | 9 | # We get + and - counts for every position 10 | expect_equal(object = dim(mgatk$counts), expected = c(8*dim(mgatk$refallele)[1],11)) 11 | }) 12 | 13 | test_that("Variant calling is operational", { 14 | data.dir <- system.file("extdata", "test_mgatk", package="Signac") 15 | mgatk <- ReadMGATK(dir = data.dir) 16 | var_df <- IdentifyVariants(mgatk$counts, mgatk$refallele) 17 | possible_vars_df <- var_df[var_df$strand_correlation > 0.65 & var_df$n_cells_conf_detected > 3,] 18 | homoplasmic_vars <- possible_vars_df[possible_vars_df$mean > 0.9,"variant"] 19 | heteroplasmic_vars <- possible_vars_df[possible_vars_df$mean < 0.5,"variant"] 20 | 21 | # We get the expected # of homoplasmic variants 22 | expect_equal(object = length(homoplasmic_vars), expected = 42) 23 | 24 | # We get the expected # of heteroplasmic variants 25 | expect_equal(object = length(heteroplasmic_vars), expected = 11) 26 | 27 | }) 28 | 29 | test_that("Allele frequency calculation works", { 30 | data.dir <- system.file("extdata", "test_mgatk", package="Signac") 31 | mgatk <- ReadMGATK(dir = data.dir) 32 | vars.compute <- c("627G>A", "1888G>A", "1888G>C") 33 | expected <- new("dgCMatrix", 34 | i = c(1L, 0L, 2L, 1L, 0L, 2L, 1L, 2L, 0L, 0L,1L, 1L, 0L, 2L), 35 | p = c(0L, 1L, 3L, 3L, 4L, 6L, 8L, 9L, 10L, 11L, 12L, 14L), 36 | Dim = c(3L, 11L), Dimnames = list(c("627G>A", "1888G>A", "1888G>C"), 37 | c("ACAGGCCGTGGTCGAA-1", "AAACTGCAGAGTCCGA-1", "AAAGATGCAATGGCTT-1", 38 | "ACTAGGTAGTGTCGGA-1", "ACCATCCTCTTGTCGC-1", "ACAGAAATCTATCTCA-1", 39 | "AATGGCTCAACGTAGG-1", "ACCAAACGTTGTGAGG-1", "AACCGATTCAAGAGAT-1", 40 | "ACTAGGTCAATGCCAT-1", "AAAGGGCAGCTACGCC-1")), 41 | x = c(0.0947368421052632, 42 | 0.0955631399317406, 0.00273972602739726, 0.108108108108108, 0.0833333333333333, 43 | 0.00409836065573771, 0.0256410256410256, 0.00233100233100233, 44 | 0.087431693989071, 0.13768115942029, 0.0308788598574822, 0.072, 45 | 0.0254237288135593, 0.00689655172413793), 46 | factors = list()) 47 | alleles <- AlleleFreq( 48 | object = mgatk$counts, variants = vars.compute 49 | ) 50 | expect_equal(object = alleles, expected = expected) 51 | }) 52 | -------------------------------------------------------------------------------- /tests/testthat/test-preprocessing.R: -------------------------------------------------------------------------------- 1 | suppressWarnings(RNGversion(vstr = "3.5.3")) 2 | 3 | test_that("BinarizeCounts works", { 4 | set.seed(1) 5 | # matrix 6 | mat <- matrix(data = rbinom(n = 25, size = 5, prob = 0.2), nrow = 5) 7 | bin_mat <- BinarizeCounts(object = mat) 8 | 9 | # sparse matrix 10 | mat_sparse <- as(object = mat, Class = "dgCMatrix") 11 | bin_mat_sparse <- BinarizeCounts(object = mat_sparse) 12 | 13 | expect_equal( 14 | object = as.vector(bin_mat[1, ]), expected = c(0, 1, 0, 1, 1) 15 | ) 16 | expect_equal( 17 | object = as.vector(bin_mat_sparse[1, ]), expected = c(0, 1, 0, 1, 1) 18 | ) 19 | }) 20 | 21 | test_that("DownsampleFeatures works", { 22 | set.seed(1) 23 | atac_ds <- DownsampleFeatures(object = atac_small, n = 5, verbose = FALSE) 24 | expect_equal( 25 | object = SeuratObject::VariableFeatures(object = atac_ds), 26 | expected = c( 27 | "chr1-1804025-1804468", 28 | "chr1-2221250-2223390", 29 | "chr1-6074646-6075340", 30 | "chr1-8931013-8932013", 31 | "chr1-1562519-1567986" 32 | ) 33 | ) 34 | }) 35 | 36 | test_that("FindTopFeatures works", { 37 | VariableFeatures(atac_small) <- NULL 38 | atac_small <- FindTopFeatures(object = atac_small) 39 | expect_equal( 40 | object = head(SeuratObject::VariableFeatures(object = atac_small)), 41 | expected = c("chr1-2157847-2188813", 42 | "chr1-2471903-2481288", 43 | "chr1-6843960-6846894", 44 | "chr1-3815928-3820356", 45 | "chr1-8935313-8940649", 46 | "chr1-2515241-2519350") 47 | ) 48 | }) 49 | 50 | test_that("FRiP works", { 51 | atac_small <- FRiP( 52 | object = atac_small, 53 | assay = "peaks", 54 | total.fragments = "fragments" 55 | ) 56 | expect_equal( 57 | object = as.vector(x = head(atac_small$FRiP)), 58 | expected = c( 59 | 0.0069896591, 0.0086400864, 0.0102987567, 60 | 0.0093475841, 0.0081182600, 0.0001859341 61 | ), 62 | tolerance = 1 / 100000 63 | ) 64 | }) 65 | 66 | test_that("FeatureMatrix works", { 67 | computed_fmat <- readRDS("../testdata/featurematrix.rds") 68 | fpath <- system.file("extdata", "fragments.tsv.gz", package="Signac") 69 | fragments <- CreateFragmentObject( 70 | path = fpath, 71 | cells = colnames(x = atac_small), 72 | tolerance = 0.5, 73 | verbose = FALSE 74 | ) 75 | fm <- FeatureMatrix( 76 | fragments = fragments, 77 | features = granges(atac_small), 78 | verbose = FALSE 79 | ) 80 | expect_identical(object = fm, expected = computed_fmat) 81 | 82 | # different sep 83 | fm2 <- FeatureMatrix( 84 | fragments = fragments, 85 | features = granges(atac_small), 86 | sep = c(":", "-"), 87 | verbose = FALSE 88 | ) 89 | rownames(computed_fmat) <- GRangesToString(StringToGRanges(rownames(computed_fmat)), sep = c(":", "-")) 90 | expect_identical(object = fm2, expected = computed_fmat) 91 | }) 92 | 93 | test_that("NucleosomeSignal works", { 94 | fpath <- system.file("extdata", "fragments.tsv.gz", package="Signac") 95 | fragments <- CreateFragmentObject( 96 | path = fpath, 97 | cells = colnames(x = atac_small), 98 | tolerance = 0.5, 99 | verbose = FALSE 100 | ) 101 | Fragments(object = atac_small) <- fragments 102 | ns <- NucleosomeSignal(object = atac_small, verbose = FALSE) 103 | expect_equal( 104 | object = as.numeric(x = head(x = ns$nucleosome_signal)), 105 | expected = c(NaN, NaN, 0.0, 2.5, NaN, NaN) 106 | ) 107 | }) 108 | -------------------------------------------------------------------------------- /tests/testthat/test-utilities.R: -------------------------------------------------------------------------------- 1 | library(GenomicRanges) 2 | 3 | test_that("AverageCounts works", { 4 | expect_equal( 5 | object = as.vector(x = AverageCounts(object = atac_small)), 6 | expected = c(162.80, 118.74), 7 | tolerance = 1 / 1000 8 | ) 9 | }) 10 | 11 | test_that("CellsPerGroup works", { 12 | expect_equal( 13 | object = as.vector(x = CellsPerGroup(object = atac_small)), 14 | expected = c(50, 50, 0) 15 | ) 16 | }) 17 | 18 | test_that("SortIdents works",{ 19 | set.seed(1) 20 | atac_small$test <- sample(1:10, ncol(atac_small), replace = TRUE) 21 | atac_small <- SortIdents(object = atac_small, label = "test") 22 | expect_equal( 23 | object = levels(atac_small$test), 24 | expected = c("10", "6", "3", "7", "9", "5", "4", "8", "1", "2") 25 | ) 26 | Idents(atac_small) <- sample(1:10, ncol(atac_small), replace = TRUE) 27 | atac_small <- SortIdents(object = atac_small) 28 | expect_equal( 29 | object = levels(Idents(atac_small)), 30 | expected = c("1", "9", "10", "2", "3", "5", "4", "7", "6", "8") 31 | ) 32 | }) 33 | 34 | test_that("GRanges conversion works", { 35 | correct_string <- c("chr1-1-10", "chr2-12-3121") 36 | correct_ranges <- GRanges( 37 | seqnames = c("chr1", "chr2"), 38 | ranges = IRanges(start = c(1, 12), end = c(10, 3121)) 39 | ) 40 | granges <- StringToGRanges(regions = correct_string) 41 | string_ranges <- GRangesToString(grange = correct_ranges) 42 | expect_equal(object = granges, expected = correct_ranges) 43 | expect_equal(object = string_ranges, expected = correct_string) 44 | }) 45 | 46 | test_that("ChunkGRanges works", { 47 | granges <- GRanges( 48 | seqnames = c("chr1"), 49 | ranges = IRanges(start = seq(1, 10), end = seq(1, 10) + 1) 50 | ) 51 | split_ranges <- ChunkGRanges(granges = granges, nchunk = 3) 52 | correct_split <- list( 53 | GRanges(seqnames = "chr1", ranges = IRanges(start = 1:3, end = (1:3) + 1)), 54 | GRanges(seqnames = "chr1", ranges = IRanges(start = 4:6, end = (4:6) + 1)), 55 | GRanges(seqnames = "chr1", ranges = IRanges(start = 7:10, end = (7:10) + 1)) 56 | ) 57 | expect_equal(object = split_ranges, expected = correct_split) 58 | }) 59 | 60 | test_that("Extend works", { 61 | granges <- GRanges( 62 | seqnames = c("chr1", "chr2"), 63 | ranges = IRanges( 64 | start = c(1000, 1200), 65 | end = c(10000, 312100) 66 | ), 67 | strand = c("+", "-") 68 | ) 69 | correct_extended <- GRanges( 70 | seqnames = c("chr1", "chr2"), 71 | ranges = IRanges( 72 | start = c(500, 200), 73 | end = c(11000, 312600) 74 | ), 75 | strand = c("+", "-") 76 | ) 77 | extended_granges <- Extend(x = granges, upstream = 500, downstream = 1000) 78 | expect_equal(object = extended_granges, expected = correct_extended) 79 | }) 80 | 81 | test_that("ExtractCell works", { 82 | expect_equal( 83 | object = ExtractCell(x = "chr1\t1\t300\tTGCA\t1"), expected = "TGCA" 84 | ) 85 | }) 86 | -------------------------------------------------------------------------------- /vignettes/archive.Rmd: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Archive" 3 | output: html_document 4 | --- 5 | 6 | To install past versions of Signac see the 7 | [installation instructions](install.html#old-versions) 8 | 9 | Past versions of the Signac documentation can be found here: 10 | 11 | ## [0.2](../0.2/index.html) 12 | 13 | ## [1.2.0](../1.2.0/index.html) 14 | 15 | ## [1.11.0](../1.11.0/index.html) 16 | -------------------------------------------------------------------------------- /vignettes/assets/cicero.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stuart-lab/signac/0b33b1154f9a610897d1efad2c0065081c4e7132/vignettes/assets/cicero.png -------------------------------------------------------------------------------- /vignettes/assets/footprint.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stuart-lab/signac/0b33b1154f9a610897d1efad2c0065081c4e7132/vignettes/assets/footprint.png -------------------------------------------------------------------------------- /vignettes/assets/integration.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stuart-lab/signac/0b33b1154f9a610897d1efad2c0065081c4e7132/vignettes/assets/integration.png -------------------------------------------------------------------------------- /vignettes/assets/merge.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stuart-lab/signac/0b33b1154f9a610897d1efad2c0065081c4e7132/vignettes/assets/merge.png -------------------------------------------------------------------------------- /vignettes/assets/merging.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stuart-lab/signac/0b33b1154f9a610897d1efad2c0065081c4e7132/vignettes/assets/merging.png -------------------------------------------------------------------------------- /vignettes/assets/mito.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stuart-lab/signac/0b33b1154f9a610897d1efad2c0065081c4e7132/vignettes/assets/mito.png -------------------------------------------------------------------------------- /vignettes/assets/monocle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stuart-lab/signac/0b33b1154f9a610897d1efad2c0065081c4e7132/vignettes/assets/monocle.png -------------------------------------------------------------------------------- /vignettes/assets/motifs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stuart-lab/signac/0b33b1154f9a610897d1efad2c0065081c4e7132/vignettes/assets/motifs.png -------------------------------------------------------------------------------- /vignettes/assets/mouse.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stuart-lab/signac/0b33b1154f9a610897d1efad2c0065081c4e7132/vignettes/assets/mouse.png -------------------------------------------------------------------------------- /vignettes/assets/multiomic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stuart-lab/signac/0b33b1154f9a610897d1efad2c0065081c4e7132/vignettes/assets/multiomic.png -------------------------------------------------------------------------------- /vignettes/assets/pbmc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stuart-lab/signac/0b33b1154f9a610897d1efad2c0065081c4e7132/vignettes/assets/pbmc.png -------------------------------------------------------------------------------- /vignettes/assets/peaks.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stuart-lab/signac/0b33b1154f9a610897d1efad2c0065081c4e7132/vignettes/assets/peaks.png -------------------------------------------------------------------------------- /vignettes/assets/snareseq.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stuart-lab/signac/0b33b1154f9a610897d1efad2c0065081c4e7132/vignettes/assets/snareseq.png -------------------------------------------------------------------------------- /vignettes/assets/viz.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stuart-lab/signac/0b33b1154f9a610897d1efad2c0065081c4e7132/vignettes/assets/viz.png -------------------------------------------------------------------------------- /vignettes/footprint.Rmd: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Transcription factor footprinting" 3 | date: 'Compiled: `r format(Sys.Date(), "%B %d, %Y")`' 4 | output: html_document 5 | --- 6 | 7 | 8 | ```{r init, include=FALSE} 9 | knitr::opts_chunk$set(echo = TRUE) 10 | knitr::opts_knit$set(root.dir = "../vignette_data/bmmc") 11 | ``` 12 | 13 | ```{r message=FALSE, warning=FALSE} 14 | library(Signac) 15 | library(Seurat) 16 | ``` 17 | 18 | ## Data loading 19 | 20 | For this vignette we'll use the dataset introduced and pre-processed in the 21 | [trajectory building vignette](monocle.html). 22 | 23 | ```{r} 24 | bone <- readRDS("cd34.rds") 25 | DimPlot(bone, label = TRUE) 26 | ``` 27 | 28 | To perform a footprinting analysis we first need to add motif information to the 29 | object, including the exact positions of each motif. This can be done using 30 | functions from the \code{motifmatchr} and \code{TFBSTools} packages. 31 | 32 | ```{r include=FALSE} 33 | if (!requireNamespace("JASPAR2020", quietly = TRUE)) 34 | BiocManager::install("JASPAR2020") 35 | 36 | if (!requireNamespace("TFBSTools", quietly = TRUE)) 37 | BiocManager::install("TFBSTools") 38 | 39 | if (!requireNamespace("motifmatchr", quietly = TRUE)) 40 | BiocManager::install("motifmatchr") 41 | 42 | if (!requireNamespace("BSgenome.Hsapiens.UCSC.hg19", quietly = TRUE)) 43 | BiocManager::install("BSgenome.Hsapiens.UCSC.hg19") 44 | ``` 45 | 46 | ```{r message=FALSE, warning=FALSE} 47 | library(motifmatchr) 48 | library(JASPAR2020) 49 | library(TFBSTools) 50 | library(BSgenome.Hsapiens.UCSC.hg19) 51 | 52 | # extract position frequency matrices for the motifs 53 | pwm <- getMatrixSet( 54 | x = JASPAR2020, 55 | opts = list(species = 9606, all_versions = FALSE) 56 | ) 57 | 58 | # add motif information 59 | bone <- AddMotifs(bone, genome = BSgenome.Hsapiens.UCSC.hg19, pfm = pwm) 60 | ``` 61 | 62 | ## Motif footprinting 63 | 64 | Now we can footprint any motif that we have positional information for. By 65 | default, this includes every instance of the motif in the genome. We can instead 66 | use the `in.peaks = TRUE` parameter to include only those motifs that fall 67 | inside a peak in the assay. The `Footprint()` function gathers all the required 68 | data and stores it in the assay. We can then plot the footprinted motifs using 69 | the `PlotFootprint()` function. 70 | 71 | ```{r message=FALSE, warning=FALSE} 72 | # gather the footprinting information for sets of motifs 73 | bone <- Footprint( 74 | object = bone, 75 | motif.name = c("GATA2", "CEBPA", "EBF1"), 76 | genome = BSgenome.Hsapiens.UCSC.hg19 77 | ) 78 | 79 | # plot the footprint data for each group of cells 80 | p2 <- PlotFootprint(bone, features = c("GATA2", "CEBPA", "EBF1")) 81 | ``` 82 | 83 | ```{r fig.height=12, message=FALSE, warning=FALSE} 84 | p2 + patchwork::plot_layout(ncol = 1) 85 | ``` 86 | 87 |
88 | **Session Info** 89 | 90 | ```{r} 91 | sessionInfo() 92 | ``` 93 | 94 |
95 | -------------------------------------------------------------------------------- /vignettes/install.Rmd: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Installation" 3 | output: html_document 4 | --- 5 | 6 | ```{r setup, include=FALSE} 7 | knitr::opts_chunk$set(eval = FALSE) 8 | ``` 9 | 10 | ## Current release 11 | 12 | ```{r} 13 | setRepositories(ind=1:3) # needed to automatically install Bioconductor dependencies 14 | install.packages("Signac") 15 | ``` 16 | 17 | ## Development version 18 | 19 | Unreleased versions of Signac can be installed from the GitHub repository using 20 | the devtools package: 21 | 22 | ```{r} 23 | if (!requireNamespace("devtools", quietly = TRUE)) 24 | install.packages("devtools") 25 | devtools::install_github("stuart-lab/signac", ref = "develop") 26 | ``` 27 | 28 | ## Old versions 29 | 30 | Older Signac releases can be installed from the CRAN archive using devtools: 31 | 32 | ```{r} 33 | if (!requireNamespace("devtools", quietly = TRUE)) 34 | install.packages("devtools") 35 | 36 | # replace "0.2.5" with the version that you want to install 37 | devtools::install_version(package = 'Signac', version = package_version('0.2.5')) 38 | ``` 39 | 40 | ## Docker 41 | 42 | We provide docker images for Signac via [dockerhub](https://hub.docker.com/r/timoast/signac). 43 | 44 | To pull the latest image from the command line: 45 | 46 | ```sh 47 | docker pull timoast/signac:latest 48 | ``` 49 | 50 | To use as a base image in a new Dockerfile: 51 | 52 | ```sh 53 | FROM timoast/signac:latest 54 | ``` 55 | 56 | ## Conda 57 | 58 | Signac can also be installed using conda. Note that if you use conda, you 59 | should install all packages through conda rather than R itself. 60 | 61 | ```{bash} 62 | conda install -c bioconda r-signac 63 | ``` 64 | 65 | ## Installing genome assembly and gene annotation packages 66 | 67 | It can also be useful (but not essential) to install species-specific packages 68 | containing genome and gene annotation information from Bioconductor. 69 | 70 | [This](https://useast.ensembl.org/info/website/archives/assembly.html) table 71 | from Ensembl provides a mapping of genome assembly to the corresponding gene 72 | annotation version. 73 | 74 | ### Human hg19 75 | 76 | ```{r} 77 | BiocManager::install(c('BSgenome.Hsapiens.UCSC.hg19', 'EnsDb.Hsapiens.v75')) 78 | ``` 79 | 80 | ### Human hg38 81 | 82 | ```{r} 83 | BiocManager::install(c('BSgenome.Hsapiens.UCSC.hg38', 'EnsDb.Hsapiens.v86')) 84 | ``` 85 | 86 | ### Mouse mm10 87 | 88 | ```{r} 89 | BiocManager::install(c('BSgenome.Mmusculus.UCSC.mm10', 'EnsDb.Mmusculus.v79')) 90 | ``` 91 | -------------------------------------------------------------------------------- /vignettes/peak_calling.Rmd: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Calling peaks" 3 | date: 'Compiled: `r format(Sys.Date(), "%B %d, %Y")`' 4 | output: html_document 5 | --- 6 | 7 | ```{r setup, include=FALSE} 8 | knitr::opts_chunk$set(echo = TRUE) 9 | knitr::opts_knit$set(root.dir = "../vignette_data/pbmc_vignette") 10 | ``` 11 | 12 | In this tutorial, we demonstrate how to call peaks on a single-cell ATAC-seq 13 | dataset using [MACS2](https://github.com/macs3-project/MACS). 14 | 15 | To use the peak calling functionality in Signac you will first need to install 16 | MACS2. This can be done using [pip](https://pypi.org/project/MACS2/) or 17 | [conda](https://anaconda.org/bioconda/macs2), or by building the package 18 | from [source](https://github.com/macs3-project/MACS). 19 | 20 | In this demonstration we use scATAC-seq data for human PBMCs. See our 21 | [vignette](pbmc_vignette.html) for the code used to generate this object, 22 | and links to the raw data. First, load the required packages and the 23 | pre-computed Seurat object: 24 | 25 | ```{r message=FALSE, warning=FALSE} 26 | library(Signac) 27 | library(Seurat) 28 | 29 | pbmc <- readRDS("pbmc.rds") 30 | DimPlot(pbmc) 31 | ``` 32 | 33 | Peak calling can be performed using the `CallPeaks()` function, and can either 34 | be done separately for different groups of cells, or performed using data from 35 | all the cells. To call peaks on each annotated cell type, we can use the 36 | `group.by` argument: 37 | 38 | ```{r message=FALSE, warning=FALSE, cache=TRUE} 39 | peaks <- CallPeaks( 40 | object = pbmc, 41 | group.by = "predicted.id" 42 | ) 43 | ``` 44 | 45 | The results are returned as a `GRanges` object, with an additional metadata column 46 | listing the cell types that each peak was identified in: 47 | 48 | ```{r echo=FALSE} 49 | knitr::kable(head(as.data.frame(peaks))) 50 | ``` 51 | 52 | To quantify counts in each peak, you can use the `FeatureMatrix()` function. 53 | 54 | We can visualize the cell-type-specific MACS2 peak calls alongside the 10x Cellranger 55 | peak calls (currently being used in the `pbmc` object) with the `CoveragePlot()` 56 | function. Here the Cellranger peaks are shown in grey and the MACS2 peaks in red: 57 | 58 | ```{r fig.height=6, fig.width=10} 59 | CoveragePlot( 60 | object = pbmc, 61 | region = "CD8A", 62 | ranges = peaks, 63 | ranges.title = "MACS2" 64 | ) 65 | ``` 66 |
67 | **Session Info** 68 | 69 | ```{r} 70 | sessionInfo() 71 | ``` 72 | 73 |
74 | --------------------------------------------------------------------------------