[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7EFM77J0QFF68DPDXE6AQT7":3,"skill-same:01M7EFM77J0QFF68DPDXE6AQT7":68},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":30,"commitSha":31,"skillDirectory":32,"forksCount":14,"repositoryHtmlUrl":33,"repositoryHomepageUrl":33,"ownerHtmlUrl":34,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":35,"install":36,"resources":49},"01M7EFM77J0QFF68DPDXE6AQT7","bio-single-cell-scatac-analysis",null,"Analyze single-cell ATAC-seq with Signac\u002FArchR (R) and SnapATAC2 (Python alternative). Use when processing scATAC fragments, choosing a framework, calling consensus peaks, running TF-IDF\u002FLSI while diagnosing the depth component, scoring chromVAR motif deviations against GC-matched backgrounds, detecting homotypic vs heterotypic doublets, or deciding whether to binarize the count matrix.","Mr-Nobody-Anonymous\u002FAll-skills","Mr-Nobody-Anonymous","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F184253119?v=4","01M7AEXFJHKTYQW5R0ZCQQTWFV","anonymous","01M7C00M3GQR4QKP9GZA42GFAK",0,"MIT","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fbiology\u002Fbio-single-cell-scatac-analysis\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: bio-single-cell-scatac-analysis\ndescription: Analyze single-cell ATAC-seq with Signac\u002FArchR (R) and SnapATAC2 (Python alternative). Use when processing scATAC fragments, choosing a framework, calling consensus peaks, running TF-IDF\u002FLSI while diagnosing the depth component, scoring chromVAR motif deviations against GC-matched backgrounds, detecting homotypic vs heterotypic doublets, or deciding whether to binarize the count matrix.\ntool_type: r\nprimary_tool: Signac\nsource: \"https:\u002F\u002Fgithub.com\u002FGPTomics\u002FbioSkills\"\nsource_repository: \"GPTomics\u002FbioSkills\"\nsource_path: \"single-cell\u002Fscatac-analysis\u002FSKILL.md\"\nlicense: \"MIT\"\nimported_at: \"2026-09-20\"\n---\n\n## Version Compatibility\n\nReference examples tested with: Signac 1.13+, Seurat 5.0+, ArchR 1.0+\n\nBefore using code patterns, verify installed versions match. If versions differ:\n- R: `packageVersion('\u003Cpkg>')` then `?function_name` to verify parameters\n- Python (SnapATAC2 alternative): `pip show snapatac2` then `help(module.function)`\n\nIf code throws ImportError, AttributeError, or TypeError, introspect the installed\npackage and adapt the example to match the actual API rather than retrying.\n\n# scATAC-seq Analysis\n\n**\"Analyze my single-cell ATAC-seq data\"** -> Process fragments, QC on chromatin signal, reduce dimensions with TF-IDF\u002FLSI, cluster, call consensus peaks per cell type, and score TF motif activity.\n- R: `Signac::CreateChromatinAssay()` -> `RunTFIDF()` -> `FindTopFeatures()` -> `RunSVD()` -> `RunChromVAR()`\n- R (large data, on-disk): `ArchR::createArrowFiles()` -> `addIterativeLSI()` -> `addReproduciblePeakSet()`\n- Python (scverse, >1M cells): `snapatac2.pp.add_tile_matrix()` -> `tl.spectral()` -> `tl.macs3()`\n\n## Governing Principle\n\nA zero in the cell-by-peak matrix is epistemically ambiguous: it can mean \"closed in this cell\" (biology) or \"accessible but no Tn5 fragment captured here\" (sampling). With ~2 DNA copies per diploid locus and shallow per-cell coverage, sampling dominates the zeros. The matrix is near-binary by sampling statistics, not by biology; underlying accessibility is continuous but observed as a Bernoulli-like draw.\n\nBinarization is now disfavored. Among non-zero entries the count (1 vs 2 vs >2) is informative, and collapsing to 1 discards it (Martens 2024). Model fragment counts with a count likelihood (Paired-Insertion Counting, SnapATAC2; PoissonVI), never read counts (PCR noise). Caveat: the extra information lives in the count=2 tier, so the benefit scales with sequencing depth; binarized analyses of shallow data are leaving little on the table, deep data more.\n\nPer-cell signal is near-binary by sampling, so single-cell single-gene quantitative claims are unreliable; aggregate to cluster\u002Fpseudobulk for graded signal.\n\nGene-activity scores are a weak cluster-level proxy, structurally not just empirically: (1) enhancer-to-promoter assignment is unknown, and any fixed-distance heuristic (Signac gene body + 2 kb, ArchR exponential decay to 100 kb) is wrong for genes whose enhancers sit outside the window or loop differently by cell type; (2) poised\u002Fbivalent promoters are accessible while the gene is silent, so accessibility-to-expression is not monotone. Use gene activity for cluster-level annotation and scRNA-integration anchoring only, never as a single-cell transcriptome surrogate.\n\nThe peak set depends on which cells called the peaks: peaks are called on cells already grouped, but the grouping used a feature matrix that depends on a peak\u002Ftile choice. This is a circularity. Rare populations unresolved in the first pass never get their peaks called, so their defining elements stay invisible, a self-reinforcing blind spot. This is why iterative per-cluster peak calling (ArchR iterative LSI) exists, and why testing differential accessibility on a peak set called from the same clustering is double-dipping.\n\n## Framework Decision Table\n\nFramework choice is an infrastructure decision (language, memory, multimodal needs), not a statistics decision. Scalability numbers describe each tool's most-optimized path, not every operation.\n\n| Framework | Language \u002F storage | Use when | Fails when |\n|---|---|---|---|\n| Signac | R, in-memory Seurat ChromatinAssay | Seurat-integrated multimodal (WNN), familiar Seurat API | ~10^5+ cells (RAM-bound; `future` workers copy the object) |\n| ArchR | R, on-disk HDF5 Arrow files | Large R workflows (~1M cells), built-in iterative LSI\u002Fpeak\u002FGRN suite | Networked filesystems (HDF5 file-locking); not a portable matrix |\n| SnapATAC2 | Python+Rust, AnnData backed | >1M cells (matrix-free spectral), scverse\u002Fscvi-tools stack | Less turnkey footprinting\u002FGRN; faster-moving 2.x API |\n| muon + scanpy | Python, MuData | Multimodal Python container (RNA+ATAC) | Not ATAC-optimized for the heaviest steps |\n\nR\u003C->Python interop (reticulate, zellkonverter, sceasy) loses information (ChromatinAssay slots, ArchR HDF5 do not round-trip); plan to stay in one ecosystem. Verify the current best-practice default against installed docs before committing.\n\n## Matrix Type: Tile vs Peak vs Gene Activity\n\n| Matrix | What it is | Use when | Caveat |\n|---|---|---|---|\n| Tile\u002Fbin (500 bp) | Genome binned, no prior peaks | Initial LSI\u002Fclustering before peaks exist | Not biology-aware; 500 bp tiles vs 501 bp peaks (off-by-one feature bugs) |\n| Peak (consensus) | Per-cluster MACS peaks merged to fixed width | Final accessibility quantification, DA testing | Requires peaks first; circular with clustering |\n| Gene activity | Accessibility folded to per-gene scalar | Cluster annotation, scRNA-integration anchors | Weak proxy; repressed\u002Fbivalent genes fail; distal enhancers misassigned |\n\n## TF-IDF + LSI: Diagnose the Depth Component\n\n**Goal:** Reduce the sparse, near-binary, depth-confounded matrix without letting technical depth dominate.\n\n**Approach:** Reweight peaks with TF-IDF, reduce with truncated SVD, then drop components that correlate with depth, diagnosed by `DepthCor`, not blindly dropping component 1.\n\n```r\nobj \u003C- RunTFIDF(obj)                       # method 1 (default) = log(TF x IDF), Stuart & Butler\nobj \u003C- FindTopFeatures(obj, min.cutoff = 'q0')\nobj \u003C- RunSVD(obj)                         # writes the 'lsi' reduction\n\nDepthCor(obj, n = 10)                      # per-component Pearson correlation with nCount\n# LSI_1 usually has |corr| > 0.95 with depth, but verify; occasionally it is component 2\u002F3, or none\n```\n\nComponent 1 captures depth ~90% of the time but the rule is symptom-based: compute each component's depth correlation (`DepthCor`, or ArchR `corCutOff = 0.75`) and drop whichever exceed the threshold. ArchR `addIterativeLSI()` recomputes LSI on variable features across clustering passes to reduce depth\u002Fbatch artifacts. A reviewer flags blind `dims = 2:30` with no depth-correlation diagnostic.\n\n## Clustering on LSI\n\n**Goal:** Cluster cells from the depth-cleaned LSI embedding.\n\n**Approach:** Build the neighbor graph and UMAP on the retained LSI dimensions, then cluster.\n\n```r\ndims_use \u003C- 2:30                            # set from DepthCor, not assumed\nobj \u003C- RunUMAP(obj, reduction = 'lsi', dims = dims_use)\nobj \u003C- FindNeighbors(obj, reduction = 'lsi', dims = dims_use)\nobj \u003C- FindClusters(obj, algorithm = 3, resolution = 0.5)   # algorithm 3 = SLM\n```\n\n## Consensus Peak Calling\n\n**Goal:** Call peaks per cell type and merge into a non-overlapping, reusable feature set, avoiding bias toward abundant cell types.\n\n**Approach:** Pooled bulk calling misses rare-population elements; call per cluster on pseudobulk, then merge. ArchR's fixed-width iterative-overlap set is the most reproducible; Signac's `CallPeaks` is simpler but uses a variable-width union that drops significance metadata.\n\n```r\npeaks \u003C- CallPeaks(obj, group.by = 'seurat_clusters')       # per-group MACS, then GRanges::reduce() union\npeak_counts \u003C- FeatureMatrix(fragments = Fragments(obj), features = peaks, cells = colnames(obj))\nobj[['peaks']] \u003C- CreateChromatinAssay(counts = peak_counts, fragments = Fragments(obj), annotation = Annotation(obj))\n```\n\nFixed-width peaks (ArchR's 501 bp) remove per-peak length normalization and give a stable reusable feature space. ArchR ranks fixed-width candidates by significance, keeps the best, removes overlappers, and requires a peak in >=2 pseudobulk replicates (reproducibility, orthogonal to MACS q-value). Wrapper parameters differ (ArchR shift -75\u002Fextsize 150 with `--nolambda`; Signac\u002FSnapATAC2 shift -100\u002Fextsize 200), which changes which weak peaks survive. Comparing peak sets across datasets requires re-quantifying against a unified set; peak boundaries are not portable.\n\n## Differential Accessibility\n\n**Goal:** Find peaks more accessible in one group, controlling for the depth confounder.\n\n**Approach:** Use a logistic-regression test with total fragments as a latent variable; do not test on a peak set called from the same clustering being compared (double-dipping).\n\n```r\nDefaultAssay(obj) \u003C- 'peaks'\nda \u003C- FindMarkers(obj, ident.1 = 'cluster1', ident.2 = 'cluster2',\n                  test.use = 'LR', latent.vars = 'nCount_peaks')\n```\n\n## chromVAR Motif Deviations\n\n**Goal:** Find which TF motifs vary in accessibility across cells, corrected for GC content and depth.\n\n**Approach:** Attach motif matches, then compute deviations against a GC- and accessibility-matched background; rank with z-scores, never raw deviations.\n\n```r\nlibrary(JASPAR2020); library(TFBSTools); library(motifmatchr)\nlibrary(BSgenome.Hsapiens.UCSC.hg38)\n\npfm \u003C- getMatrixSet(JASPAR2020, opts = list(collection = 'CORE', tax_group = 'vertebrates', all_versions = FALSE))\nobj \u003C- AddMotifs(obj, genome = BSgenome.Hsapiens.UCSC.hg38, pfm = pfm)\nobj \u003C- RunChromVAR(obj, genome = BSgenome.Hsapiens.UCSC.hg38)   # GC-matched background internally\n\nDefaultAssay(obj) \u003C- 'chromvar'\ndiff_motifs \u003C- FindMarkers(obj, ident.1 = 'cluster1', ident.2 = 'cluster2',\n                           mean.fxn = rowMeans, fc.name = 'avg_diff')\n```\n\nchromVAR's deviation is meaningful only against a GC- and accessibility-matched background; an unmatched background manufactures apparent enrichment for GC-rich motifs (most TF motifs are GC-rich). Use z-scores (background-normalized) for cross-motif ranking, raw deviations are not comparable across motifs. Motif != TF: paralogous TFs share near-identical motifs, so an enriched motif implicates a family, not a factor; motif presence != occupancy; and a footprint (TOBIAS, needs pseudobulk) is stronger occupancy evidence than motif-in-peak. Disambiguate with TF expression (Multiome) before claiming \"TF X drives this program\".\n\n## Gene Activity (Cluster-Level Only)\n\n**Goal:** Approximate per-gene accessibility for marker-based annotation and scRNA anchoring.\n\n**Approach:** Sum fragments over the gene body plus a promoter window; treat the output as a cluster-level aid, not measured RNA.\n\n```r\ngene_act \u003C- GeneActivity(obj)              # gene body + 2 kb upstream, flat count, no distance weighting\nobj[['ACT']] \u003C- CreateAssayObject(counts = gene_act)\nobj \u003C- NormalizeData(obj, assay = 'ACT', scale.factor = median(obj$nCount_ACT))\n```\n\n## Doublet Detection: Homotypic vs Heterotypic\n\nTwo strategies catch different doublet classes; run both and combine. Doublet callers are separate from QC metrics (TSS\u002Fnucleosome gate debris, not doublets).\n\n| Tool | Principle | Catches | Key dependency |\n|---|---|---|---|\n| AMULET | >2 fragments overlapping a diploid locus -> Poisson + BH | Homotypic (same-type) | ~25k read pairs\u002Fcell for full recall |\n| ArchR `addDoubletScores` | Simulate doublets -> LSI\u002FUMAP -> kNN; use `DoubletEnrichment` | Heterotypic (different-type) | LSI\u002FUMAP quality; structurally blind to homotypic |\n| scDblFinder ATAC | Simulate on `nfeatures=25` aggregated meta-features | Heterotypic | Embedding quality |\n\nAMULET silently under-calls below ~25k coverage; CNV\u002Faneuploidy breaks its diploid null (amplified loci exceed 2 copies in true singlet cancer cells -> false positives); multinucleate\u002FS-G2-M cells violate the \u003C=2-copies assumption. ArchR prefers `DoubletEnrichment` over `DoubletScore`. scDblFinder uses `nfeatures=25` (not 1000) and its authors recommend against `clamulet`.\n\n## QC Thresholds\n\n| Metric | Signac column | Threshold | Basis |\n|---|---|---|---|\n| TSS enrichment | `TSS.enrichment` | >2-3 (Signac); >4 (ArchR human) | ENCODE signal\u002Fnoise; threshold is annotation-dependent, not portable |\n| Total fragments | `nCount_peaks` \u002F nFrags | >1000 (often >3000) | removes empties\u002Fdebris |\n| Nucleosome signal | `nucleosome_signal` | \u003C4 | banding quality; very low can mean over-transposition |\n| FRiP | `FRiP` | >0.15-0.40 (study-dependent) | signal in peaks; depends on peak set and counting convention |\n\nTSS scores are not comparable across pipelines\u002Fannotations; never port thresholds. `TSSEnrichment(fast=TRUE)` blocks later `TSSPlot()`. FRiP depends on the peak set (circular if the same cells) and counting convention (Signac counts fragments, CellRanger-ATAC counts insertions). Threshold from the joint distributions of the actual data, not copied defaults.\n\n## Common Errors\n\n| Symptom | Cause | Fix |\n|---|---|---|\n| UMAP separates by depth, not biology | Did not drop the depth-correlated LSI component | Run `DepthCor`; drop components above threshold (often #1, verify) |\n| Long flat run of zeros read as \"closed\" | Zeros are sampling-dominated, ambiguous | Interpret at cluster\u002Fpseudobulk level; check effective coverage before structural claims |\n| Gene activity disagrees with RNA for a marker | Repressed\u002Fbivalent promoter is open but silent; distal enhancer outside window | Use gene activity for cluster annotation only; validate with multiome RNA |\n| \"Everything is GC-rich enriched\" in chromVAR | Unmatched background | Use `getBackgroundPeaks`\u002FRunChromVAR GC+accessibility-matched background; report z-scores |\n| Rare cell type never appears | Peaks called from a coarse single-pass clustering missed its elements | Iterative per-cluster peak calling + re-clustering (ArchR iterative LSI) |\n| DA peaks look inflated | Tested on a peak set called from the same clustering (double-dipping) | Call peaks independently of the comparison; treat as ranking |\n| Doublets pass QC | TSS\u002Fnucleosome gate debris, not doublets | Run AMULET (homotypic) and ArchR\u002FscDblFinder (heterotypic) and combine |\n| AMULET finds few doublets in cancer | CNV breaks the diploid null; or coverage \u003C25k pairs\u002Fcell | Use heterotypic callers in aneuploid samples; check per-cell coverage |\n| \"TF X drives this\" from a motif | Motif implicates a family; presence != occupancy | Confirm with TF expression (multiome) and\u002For footprint (TOBIAS, pseudobulk) |\n| QC, gene activity, and motifs all run but look wrong | Peaks, fragments, EnsDb annotation, and BSgenome are on different genome builds; coordinate mismatch is silently wrong (no crash) | Pin every reference to one build (e.g. all hg38); verify TSS enrichment and a known marker before trusting downstream |\n\n## Related Skills\n\n- single-cell\u002Fmultimodal-integration - joining the ATAC modality with RNA (Multiome WNN\u002FMultiVI)\n- single-cell\u002Fpreprocessing - shared QC and filtering concepts from scRNA-seq\n- single-cell\u002Fclustering - clustering and UMAP shared with scRNA-seq\n- single-cell\u002Fdoublet-detection - doublet concepts and rate expectations\n- atac-seq\u002Fatac-peak-calling - bulk ATAC peak-calling background (MACS shift\u002Fextend)\n- atac-seq\u002Fmotif-deviation - chromVAR deviation scoring in depth\n- chip-seq\u002Fmotif-analysis - motif databases (JASPAR\u002FcisBP) and enrichment testing\n\n## References\n\nBuenrostro JD, Giresi PG, Zaba LC, et al. Transposition of native chromatin for fast and sensitive epigenomic profiling (ATAC-seq). Nat Methods 10(12):1213-1218 (2013).\nCusanovich DA, Daza R, Adey A, et al. Multiplex single-cell profiling of chromatin accessibility (TF-IDF\u002FLSI). Science 348(6237):910-914 (2015).\nStuart T, Srivastava A, Madad S, Lareau CA, Satija R. Single-cell chromatin state analysis with Signac. Nat Methods 18:1333-1341 (2021).\nGranja JM, Corces MR, Pierce SE, et al. ArchR is a scalable software package for integrative single-cell chromatin accessibility analysis. Nat Genet 53:403-411 (2021).\nZhang K, Zemke NR, Armand EJ, Ren B. A fast, scalable and versatile tool for analysis of single-cell omics data (SnapATAC2). Nat Methods 21(2):217-227 (2024).\nSchep AN, Wu B, Buenrostro JD, Greenleaf WJ. chromVAR: inferring transcription-factor-associated accessibility from single-cell epigenomic data. Nat Methods 14(10):975-978 (2017).\nMartens LD, Fischer DS, Theis FJ, Buettner F. Modeling fragment counts improves single-cell ATAC-seq analysis. Nat Methods 21(1):28-31 (2024).\nMiao Z, Kim J. Uniform quantification of single-nucleus ATAC-seq data with Paired-Insertion Counting (PIC) and a model-based insertion rate estimator. Nat Methods 21:32-36 (2024).\nThibodeau A, Eroglu A, McGinnis CS, et al. AMULET: a novel read count-based method for effective multiplet detection from single-nucleus ATAC-seq data. Genome Biol 22:252 (2021).\nGermain P-L, Lun A, Garcia Meixide C, Macnair W, Robinson MD. Doublet identification in single-cell sequencing data using scDblFinder. F1000Research 10:979 (2022).\nBentsen M, Goymann P, Schultheis H, et al. ATAC-seq footprinting unravels kinetics of transcription factor binding during zygotic genome activation (TOBIAS). Nat Commun 11:4267 (2020).\n","## Version Compatibility\n\nReference examples tested with: Signac 1.13+, Seurat 5.0+, ArchR 1.0+\n\nBefore using code patterns, verify installed versions match. If versions differ:\n- R: `packageVersion('\u003Cpkg>')` then `?function_name` to verify parameters\n- Python (SnapATAC2 alternative): `pip show snapatac2` then `help(module.function)`\n\nIf code throws ImportError, AttributeError, or TypeError, introspect the installed\npackage and adapt the example to match the actual API rather than retrying.\n\n# scATAC-seq Analysis\n\n**\"Analyze my single-cell ATAC-seq data\"** -> Process fragments, QC on chromatin signal, reduce dimensions with TF-IDF\u002FLSI, cluster, call consensus peaks per cell type, and score TF motif activity.\n- R: `Signac::CreateChromatinAssay()` -> `RunTFIDF()` -> `FindTopFeatures()` -> `RunSVD()` -> `RunChromVAR()`\n- R (large data, on-disk): `ArchR::createArrowFiles()` -> `addIterativeLSI()` -> `addReproduciblePeakSet()`\n- Python (scverse, >1M cells): `snapatac2.pp.add_tile_matrix()` -> `tl.spectral()` -> `tl.macs3()`\n\n## Governing Principle\n\nA zero in the cell-by-peak matrix is epistemically ambiguous: it can mean \"closed in this cell\" (biology) or \"accessible but no Tn5 fragment captured here\" (sampling). With ~2 DNA copies per diploid locus and shallow per-cell coverage, sampling dominates the zeros. The matrix is near-binary by sampling statistics, not by biology; underlying accessibility is continuous but observed as a Bernoulli-like draw.\n\nBinarization is now disfavored. Among non-zero entries the count (1 vs 2 vs >2) is informative, and collapsing to 1 discards it (Martens 2024). Model fragment counts with a count likelihood (Paired-Insertion Counting, SnapATAC2; PoissonVI), never read counts (PCR noise). Caveat: the extra information lives in the count=2 tier, so the benefit scales with sequencing depth; binarized analyses of shallow data are leaving little on the table, deep data more.\n\nPer-cell signal is near-binary by sampling, so single-cell single-gene quantitative claims are unreliable; aggregate to cluster\u002Fpseudobulk for graded signal.\n\nGene-activity scores are a weak cluster-level proxy, structurally not just empirically: (1) enhancer-to-promoter assignment is unknown, and any fixed-distance heuristic (Signac gene body + 2 kb, ArchR exponential decay to 100 kb) is wrong for genes whose enhancers sit outside the window or loop differently by cell type; (2) poised\u002Fbivalent promoters are accessible while the gene is silent, so accessibility-to-expression is not monotone. Use gene activity for cluster-level annotation and scRNA-integration anchoring only, never as a single-cell transcriptome surrogate.\n\nThe peak set depends on which cells called the peaks: peaks are called on cells already grouped, but the grouping used a feature matrix that depends on a peak\u002Ftile choice. This is a circularity. Rare populations unresolved in the first pass never get their peaks called, so their defining elements stay invisible, a self-reinforcing blind spot. This is why iterative per-cluster peak calling (ArchR iterative LSI) exists, and why testing differential accessibility on a peak set called from the same clustering is double-dipping.\n\n## Framework Decision Table\n\nFramework choice is an infrastructure decision (language, memory, multimodal needs), not a statistics decision. Scalability numbers describe each tool's most-optimized path, not every operation.\n\n| Framework | Language \u002F storage | Use when | Fails when |\n|---|---|---|---|\n| Signac | R, in-memory Seurat ChromatinAssay | Seurat-integrated multimodal (WNN), familiar Seurat API | ~10^5+ cells (RAM-bound; `future` workers copy the object) |\n| ArchR | R, on-disk HDF5 Arrow files | Large R workflows (~1M cells), built-in iterative LSI\u002Fpeak\u002FGRN suite | Networked filesystems (HDF5 file-locking); not a portable matrix |\n| SnapATAC2 | Python+Rust, AnnData backed | >1M cells (matrix-free spectral), scverse\u002Fscvi-tools stack | Less turnkey footprinting\u002FGRN; faster-moving 2.x API |\n| muon + scanpy | Python, MuData | Multimodal Python container (RNA+ATAC) | Not ATAC-optimized for the heaviest steps |\n\nR\u003C->Python interop (reticulate, zellkonverter, sceasy) loses information (ChromatinAssay slots, ArchR HDF5 do not round-trip); plan to stay in one ecosystem. Verify the current best-practice default against installed docs before committing.\n\n## Matrix Type: Tile vs Peak vs Gene Activity\n\n| Matrix | What it is | Use when | Caveat |\n|---|---|---|---|\n| Tile\u002Fbin (500 bp) | Genome binned, no prior peaks | Initial LSI\u002Fclustering before peaks exist | Not biology-aware; 500 bp tiles vs 501 bp peaks (off-by-one feature bugs) |\n| Peak (consensus) | Per-cluster MACS peaks merged to fixed width | Final accessibility quantification, DA testing | Requires peaks first; circular with clustering |\n| Gene activity | Accessibility folded to per-gene scalar | Cluster annotation, scRNA-integration anchors | Weak proxy; repressed\u002Fbivalent genes fail; distal enhancers misassigned |\n\n## TF-IDF + LSI: Diagnose the Depth Component\n\n**Goal:** Reduce the sparse, near-binary, depth-confounded matrix without letting technical depth dominate.\n\n**Approach:** Reweight peaks with TF-IDF, reduce with truncated SVD, then drop components that correlate with depth, diagnosed by `DepthCor`, not blindly dropping component 1.\n\n```r\nobj \u003C- RunTFIDF(obj)                       # method 1 (default) = log(TF x IDF), Stuart & Butler\nobj \u003C- FindTopFeatures(obj, min.cutoff = 'q0')\nobj \u003C- RunSVD(obj)                         # writes the 'lsi' reduction\n\nDepthCor(obj, n = 10)                      # per-component Pearson correlation with nCount\n# LSI_1 usually has |corr| > 0.95 with depth, but verify; occasionally it is component 2\u002F3, or none\n```\n\nComponent 1 captures depth ~90% of the time but the rule is symptom-based: compute each component's depth correlation (`DepthCor`, or ArchR `corCutOff = 0.75`) and drop whichever exceed the threshold. ArchR `addIterativeLSI()` recomputes LSI on variable features across clustering passes to reduce depth\u002Fbatch artifacts. A reviewer flags blind `dims = 2:30` with no depth-correlation diagnostic.\n\n## Clustering on LSI\n\n**Goal:** Cluster cells from the depth-cleaned LSI embedding.\n\n**Approach:** Build the neighbor graph and UMAP on the retained LSI dimensions, then cluster.\n\n```r\ndims_use \u003C- 2:30                            # set from DepthCor, not assumed\nobj \u003C- RunUMAP(obj, reduction = 'lsi', dims = dims_use)\nobj \u003C- FindNeighbors(obj, reduction = 'lsi', dims = dims_use)\nobj \u003C- FindClusters(obj, algorithm = 3, resolution = 0.5)   # algorithm 3 = SLM\n```\n\n## Consensus Peak Calling\n\n**Goal:** Call peaks per cell type and merge into a non-overlapping, reusable feature set, avoiding bias toward abundant cell types.\n\n**Approach:** Pooled bulk calling misses rare-population elements; call per cluster on pseudobulk, then merge. ArchR's fixed-width iterative-overlap set is the most reproducible; Signac's `CallPeaks` is simpler but uses a variable-width union that drops significance metadata.\n\n```r\npeaks \u003C- CallPeaks(obj, group.by = 'seurat_clusters')       # per-group MACS, then GRanges::reduce() union\npeak_counts \u003C- FeatureMatrix(fragments = Fragments(obj), features = peaks, cells = colnames(obj))\nobj[['peaks']] \u003C- CreateChromatinAssay(counts = peak_counts, fragments = Fragments(obj), annotation = Annotation(obj))\n```\n\nFixed-width peaks (ArchR's 501 bp) remove per-peak length normalization and give a stable reusable feature space. ArchR ranks fixed-width candidates by significance, keeps the best, removes overlappers, and requires a peak in >=2 pseudobulk replicates (reproducibility, orthogonal to MACS q-value). Wrapper parameters differ (ArchR shift -75\u002Fextsize 150 with `--nolambda`; Signac\u002FSnapATAC2 shift -100\u002Fextsize 200), which changes which weak peaks survive. Comparing peak sets across datasets requires re-quantifying against a unified set; peak boundaries are not portable.\n\n## Differential Accessibility\n\n**Goal:** Find peaks more accessible in one group, controlling for the depth confounder.\n\n**Approach:** Use a logistic-regression test with total fragments as a latent variable; do not test on a peak set called from the same clustering being compared (double-dipping).\n\n```r\nDefaultAssay(obj) \u003C- 'peaks'\nda \u003C- FindMarkers(obj, ident.1 = 'cluster1', ident.2 = 'cluster2',\n                  test.use = 'LR', latent.vars = 'nCount_peaks')\n```\n\n## chromVAR Motif Deviations\n\n**Goal:** Find which TF motifs vary in accessibility across cells, corrected for GC content and depth.\n\n**Approach:** Attach motif matches, then compute deviations against a GC- and accessibility-matched background; rank with z-scores, never raw deviations.\n\n```r\nlibrary(JASPAR2020); library(TFBSTools); library(motifmatchr)\nlibrary(BSgenome.Hsapiens.UCSC.hg38)\n\npfm \u003C- getMatrixSet(JASPAR2020, opts = list(collection = 'CORE', tax_group = 'vertebrates', all_versions = FALSE))\nobj \u003C- AddMotifs(obj, genome = BSgenome.Hsapiens.UCSC.hg38, pfm = pfm)\nobj \u003C- RunChromVAR(obj, genome = BSgenome.Hsapiens.UCSC.hg38)   # GC-matched background internally\n\nDefaultAssay(obj) \u003C- 'chromvar'\ndiff_motifs \u003C- FindMarkers(obj, ident.1 = 'cluster1', ident.2 = 'cluster2',\n                           mean.fxn = rowMeans, fc.name = 'avg_diff')\n```\n\nchromVAR's deviation is meaningful only against a GC- and accessibility-matched background; an unmatched background manufactures apparent enrichment for GC-rich motifs (most TF motifs are GC-rich). Use z-scores (background-normalized) for cross-motif ranking, raw deviations are not comparable across motifs. Motif != TF: paralogous TFs share near-identical motifs, so an enriched motif implicates a family, not a factor; motif presence != occupancy; and a footprint (TOBIAS, needs pseudobulk) is stronger occupancy evidence than motif-in-peak. Disambiguate with TF expression (Multiome) before claiming \"TF X drives this program\".\n\n## Gene Activity (Cluster-Level Only)\n\n**Goal:** Approximate per-gene accessibility for marker-based annotation and scRNA anchoring.\n\n**Approach:** Sum fragments over the gene body plus a promoter window; treat the output as a cluster-level aid, not measured RNA.\n\n```r\ngene_act \u003C- GeneActivity(obj)              # gene body + 2 kb upstream, flat count, no distance weighting\nobj[['ACT']] \u003C- CreateAssayObject(counts = gene_act)\nobj \u003C- NormalizeData(obj, assay = 'ACT', scale.factor = median(obj$nCount_ACT))\n```\n\n## Doublet Detection: Homotypic vs Heterotypic\n\nTwo strategies catch different doublet classes; run both and combine. Doublet callers are separate from QC metrics (TSS\u002Fnucleosome gate debris, not doublets).\n\n| Tool | Principle | Catches | Key dependency |\n|---|---|---|---|\n| AMULET | >2 fragments overlapping a diploid locus -> Poisson + BH | Homotypic (same-type) | ~25k read pairs\u002Fcell for full recall |\n| ArchR `addDoubletScores` | Simulate doublets -> LSI\u002FUMAP -> kNN; use `DoubletEnrichment` | Heterotypic (different-type) | LSI\u002FUMAP quality; structurally blind to homotypic |\n| scDblFinder ATAC | Simulate on `nfeatures=25` aggregated meta-features | Heterotypic | Embedding quality |\n\nAMULET silently under-calls below ~25k coverage; CNV\u002Faneuploidy breaks its diploid null (amplified loci exceed 2 copies in true singlet cancer cells -> false positives); multinucleate\u002FS-G2-M cells violate the \u003C=2-copies assumption. ArchR prefers `DoubletEnrichment` over `DoubletScore`. scDblFinder uses `nfeatures=25` (not 1000) and its authors recommend against `clamulet`.\n\n## QC Thresholds\n\n| Metric | Signac column | Threshold | Basis |\n|---|---|---|---|\n| TSS enrichment | `TSS.enrichment` | >2-3 (Signac); >4 (ArchR human) | ENCODE signal\u002Fnoise; threshold is annotation-dependent, not portable |\n| Total fragments | `nCount_peaks` \u002F nFrags | >1000 (often >3000) | removes empties\u002Fdebris |\n| Nucleosome signal | `nucleosome_signal` | \u003C4 | banding quality; very low can mean over-transposition |\n| FRiP | `FRiP` | >0.15-0.40 (study-dependent) | signal in peaks; depends on peak set and counting convention |\n\nTSS scores are not comparable across pipelines\u002Fannotations; never port thresholds. `TSSEnrichment(fast=TRUE)` blocks later `TSSPlot()`. FRiP depends on the peak set (circular if the same cells) and counting convention (Signac counts fragments, CellRanger-ATAC counts insertions). Threshold from the joint distributions of the actual data, not copied defaults.\n\n## Common Errors\n\n| Symptom | Cause | Fix |\n|---|---|---|\n| UMAP separates by depth, not biology | Did not drop the depth-correlated LSI component | Run `DepthCor`; drop components above threshold (often #1, verify) |\n| Long flat run of zeros read as \"closed\" | Zeros are sampling-dominated, ambiguous | Interpret at cluster\u002Fpseudobulk level; check effective coverage before structural claims |\n| Gene activity disagrees with RNA for a marker | Repressed\u002Fbivalent promoter is open but silent; distal enhancer outside window | Use gene activity for cluster annotation only; validate with multiome RNA |\n| \"Everything is GC-rich enriched\" in chromVAR | Unmatched background | Use `getBackgroundPeaks`\u002FRunChromVAR GC+accessibility-matched background; report z-scores |\n| Rare cell type never appears | Peaks called from a coarse single-pass clustering missed its elements | Iterative per-cluster peak calling + re-clustering (ArchR iterative LSI) |\n| DA peaks look inflated | Tested on a peak set called from the same clustering (double-dipping) | Call peaks independently of the comparison; treat as ranking |\n| Doublets pass QC | TSS\u002Fnucleosome gate debris, not doublets | Run AMULET (homotypic) and ArchR\u002FscDblFinder (heterotypic) and combine |\n| AMULET finds few doublets in cancer | CNV breaks the diploid null; or coverage \u003C25k pairs\u002Fcell | Use heterotypic callers in aneuploid samples; check per-cell coverage |\n| \"TF X drives this\" from a motif | Motif implicates a family; presence != occupancy | Confirm with TF expression (multiome) and\u002For footprint (TOBIAS, pseudobulk) |\n| QC, gene activity, and motifs all run but look wrong | Peaks, fragments, EnsDb annotation, and BSgenome are on different genome builds; coordinate mismatch is silently wrong (no crash) | Pin every reference to one build (e.g. all hg38); verify TSS enrichment and a known marker before trusting downstream |\n\n## Related Skills\n\n- single-cell\u002Fmultimodal-integration - joining the ATAC modality with RNA (Multiome WNN\u002FMultiVI)\n- single-cell\u002Fpreprocessing - shared QC and filtering concepts from scRNA-seq\n- single-cell\u002Fclustering - clustering and UMAP shared with scRNA-seq\n- single-cell\u002Fdoublet-detection - doublet concepts and rate expectations\n- atac-seq\u002Fatac-peak-calling - bulk ATAC peak-calling background (MACS shift\u002Fextend)\n- atac-seq\u002Fmotif-deviation - chromVAR deviation scoring in depth\n- chip-seq\u002Fmotif-analysis - motif databases (JASPAR\u002FcisBP) and enrichment testing\n\n## References\n\nBuenrostro JD, Giresi PG, Zaba LC, et al. Transposition of native chromatin for fast and sensitive epigenomic profiling (ATAC-seq). Nat Methods 10(12):1213-1218 (2013).\nCusanovich DA, Daza R, Adey A, et al. Multiplex single-cell profiling of chromatin accessibility (TF-IDF\u002FLSI). Science 348(6237):910-914 (2015).\nStuart T, Srivastava A, Madad S, Lareau CA, Satija R. Single-cell chromatin state analysis with Signac. Nat Methods 18:1333-1341 (2021).\nGranja JM, Corces MR, Pierce SE, et al. ArchR is a scalable software package for integrative single-cell chromatin accessibility analysis. Nat Genet 53:403-411 (2021).\nZhang K, Zemke NR, Armand EJ, Ren B. A fast, scalable and versatile tool for analysis of single-cell omics data (SnapATAC2). Nat Methods 21(2):217-227 (2024).\nSchep AN, Wu B, Buenrostro JD, Greenleaf WJ. chromVAR: inferring transcription-factor-associated accessibility from single-cell epigenomic data. Nat Methods 14(10):975-978 (2017).\nMartens LD, Fischer DS, Theis FJ, Buettner F. Modeling fragment counts improves single-cell ATAC-seq analysis. Nat Methods 21(1):28-31 (2024).\nMiao Z, Kim J. Uniform quantification of single-nucleus ATAC-seq data with Paired-Insertion Counting (PIC) and a model-based insertion rate estimator. Nat Methods 21:32-36 (2024).\nThibodeau A, Eroglu A, McGinnis CS, et al. AMULET: a novel read count-based method for effective multiplet detection from single-nucleus ATAC-seq data. Genome Biol 22:252 (2021).\nGermain P-L, Lun A, Garcia Meixide C, Macnair W, Robinson MD. Doublet identification in single-cell sequencing data using scDblFinder. F1000Research 10:979 (2022).\nBentsen M, Goymann P, Schultheis H, et al. ATAC-seq footprinting unravels kinetics of transcription factor binding during zygotic genome activation (TOBIAS). Nat Commun 11:4267 (2020).\n",{"name":5,"source":24,"license":15,"tool_type":25,"description":7,"imported_at":26,"source_path":27,"primary_tool":28,"source_repository":29},"https:\u002F\u002Fgithub.com\u002FGPTomics\u002FbioSkills","r","2026-09-20","single-cell\u002Fscatac-analysis\u002FSKILL.md","Signac","GPTomics\u002FbioSkills","main","2d1750717747097b602acf30bd09a7cbd4b4c6ea","awesome_skills\u002Fbiology\u002Fbio-single-cell-scatac-analysis","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous","2026-11-09 11:45:36",{"source":8,"skillName":5,"commands":37,"prompt":47,"zipAvailable":48},[38,41,44],{"tool":39,"command":40},"npx","npx skills add Mr-Nobody-Anonymous\u002FAll-skills --skill bio-single-cell-scatac-analysis",{"tool":42,"command":43},"bunx","bunx skills add Mr-Nobody-Anonymous\u002FAll-skills --skill bio-single-cell-scatac-analysis",{"tool":45,"command":46},"pnpm","pnpm dlx skills add Mr-Nobody-Anonymous\u002FAll-skills --skill bio-single-cell-scatac-analysis","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fbiology\u002Fbio-single-cell-scatac-analysis\u002FSKILL.md",true,[50,56,62],{"path":51,"resourceType":52,"resourceTypeDesc":53,"sizeBytes":54,"sourceHtmlUrl":55},"examples\u002Fscatac_workflow.py","SCRIPT","脚本",2492,"https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fbiology\u002Fbio-single-cell-scatac-analysis\u002Fexamples\u002Fscatac_workflow.py",{"path":57,"resourceType":58,"resourceTypeDesc":59,"sizeBytes":60,"sourceHtmlUrl":61},"examples\u002Fsignac_workflow.R","OTHER","其他",2725,"https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fbiology\u002Fbio-single-cell-scatac-analysis\u002Fexamples\u002Fsignac_workflow.R",{"path":63,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":66,"sourceHtmlUrl":67},"usage-guide.md","REFERENCE","参考文档",7988,"https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fbiology\u002Fbio-single-cell-scatac-analysis\u002Fusage-guide.md",[69,77,84,91,98,105],{"skillNo":70,"name":71,"nameZh":6,"description":72,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":73,"categories":74,"keywords":75,"publishedAt":76},"01M7FFFZPC2025JQQHPHDX154J","dei-assessment","Assess diversity, equity, and inclusion with metrics. TRIGGERS - Use when user needs help with dei-assessment related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fdei-assessment\u002FSKILL.md",[],[],"2026-11-16 10:05:34",{"skillNo":78,"name":79,"nameZh":6,"description":80,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":76},"01M7FFFWN8H4WA7A6Y398QKB6J","dei-action-plan","Create DEI action plans with goals and initiatives. TRIGGERS - Use when user needs help with dei-action-plan related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fdei-action-plan\u002FSKILL.md",[],[],{"skillNo":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":76},"01M7FFFSHTM0QZRVZ2NRJTJ0PY","culture-fit-assessment","Design culture add assessment processes. TRIGGERS - Use when user needs help with culture-fit-assessment related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fculture-fit-assessment\u002FSKILL.md",[],[],{"skillNo":92,"name":93,"nameZh":6,"description":94,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":95,"categories":96,"keywords":97,"publishedAt":76},"01M7FFFMA12RKEQA38KHJSXXPS","cowork-to-code-bridge","Use an already-installed, independently verified cowork-to-code bridge to run narrowly approved actions on the user's own macOS, Linux, or WSL2 machine through a local file queue.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fcowork-to-code-bridge\u002FSKILL.md",[],[],{"skillNo":99,"name":100,"nameZh":6,"description":101,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":102,"categories":103,"keywords":104,"publishedAt":76},"01M7FFFH1F6M8YRGW5V487GH1K","counter-offer-response","Draft counter-offer responses for retention. TRIGGERS - Use when user needs help with counter-offer-response related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fcounter-offer-response\u002FSKILL.md",[],[],{"skillNo":106,"name":107,"nameZh":6,"description":108,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":109,"categories":110,"keywords":111,"publishedAt":76},"01M7FFFDGEHV8Y7J9N40HZXW52","continuous-feedback-system","Design continuous feedback systems. TRIGGERS - Use when user needs help with continuous-feedback-system related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fcontinuous-feedback-system\u002FSKILL.md",[],[]]