SCArray.verbose (TRUE/FALSE): Global option to enable displaying debug information during SCArray operations.
dimred: The name of the reduced dimension slot to plot in plotReducedDim (e.g., "PCA", "UMAP").
Best Practices
Use scRunPCA instead of scater::runPCA for large-scale datasets to avoid high memory usage from realizing the full matrix in memory.
Enable verbose debugging with options(SCArray.verbose=TRUE) to track GDS-backed matrix operations.
Keep the GDS file connection closed when not in use by calling scClose if manually opened with scOpen.
Common Pitfalls
Attempting to run standard memory-intensive functions (like scater::runPCA) on very large GDS-backed objects, which triggers in-memory realization and defeats the out-of-memory benefit. Use scRunPCA instead.
Forgetting that GDS-backed matrices are DelayedMatrix objects, meaning operations are delayed until explicitly realized.
Alternatives
HDF5Array: For HDF5-backed out-of-memory data storage and manipulation.
TileDBArray: For TileDB-backed multi-dimensional array storage.
LoomExperiment: For Loom-backed single-cell data storage.
1---2name: scarray3description: scarray4---56# scarray78## Workflows910### Standard Workflow1112Convert single-cell data to GDS format, load it as a GDS-backed SingleCellExperiment, and perform memory-efficient downstream analysis.1314```r15library(SCArray)16library(SingleCellExperiment)17library(scuttle)18library(scater)1920# Load example SingleCellExperiment21fn <- system.file("extdata", "example.rds", package="SCArray")22sce <- readRDS(fn)2324# Convert to GDS file25scConvGDS(sce, "test.gds")2627# Load SingleCellExperiment from GDS28sce_gds <- scExperiment("test.gds")2930# Normalize counts31sce_gds <- logNormCounts(sce_gds)3233# Row and column summarization34col_mean <- colMeans(assays(sce_gds)$counts)35mvar <- scRowMeanVar(assays(sce_gds)$counts)3637# Memory-efficient PCA and UMAP38sce_gds <- scRunPCA(sce_gds)39sce_gds <- runUMAP(sce_gds)4041# Plot PCA42plotReducedDim(sce_gds, dimred="PCA")43```44Input: A SingleCellExperiment object or matrix; Output: A GDS-backed SingleCellExperiment object with normalized counts and reduced dimensions.4546## When to Use47- To convert large-scale single-cell datasets (matrices or `SingleCellExperiment` objects) to GDS format using `scConvGDS`.48- To load and manipulate single-cell data out-of-memory as a GDS-backed `SingleCellExperiment` using `scExperiment`.49- To perform memory-efficient row/column summarization (e.g., `colMeans`, `rowMeans`, `scRowMeanVar`) on GDS-backed `DelayedMatrix` objects.50- To run memory-efficient PCA on large-scale single-cell datasets using `scRunPCA`.5152## When NOT to Use53- When the dataset is small enough to fit comfortably in memory and standard in-memory matrices are preferred.54- For non-array-oriented genomic data (e.g., raw FASTQ or BAM files).5556## Data Requirements57- Input single-cell datasets as a `SingleCellExperiment` object or a dense/sparse matrix (e.g., `dgCMatrix`).58- Output GDS files (`.gds`) containing compressed assay data.5960## Key Parameters61- **SCArray.verbose** (`TRUE`/`FALSE`): Global option to enable displaying debug information during SCArray operations.62- **dimred**: The name of the reduced dimension slot to plot in `plotReducedDim` (e.g., `"PCA"`, `"UMAP"`).6364## Best Practices65- Use `scRunPCA` instead of `scater::runPCA` for large-scale datasets to avoid high memory usage from realizing the full matrix in memory.66- Enable verbose debugging with `options(SCArray.verbose=TRUE)` to track GDS-backed matrix operations.67- Keep the GDS file connection closed when not in use by calling `scClose` if manually opened with `scOpen`.6869## Common Pitfalls70- Attempting to run standard memory-intensive functions (like `scater::runPCA`) on very large GDS-backed objects, which triggers in-memory realization and defeats the out-of-memory benefit. Use `scRunPCA` instead.71- Forgetting that GDS-backed matrices are `DelayedMatrix` objects, meaning operations are delayed until explicitly realized.7273## Alternatives74- `HDF5Array`: For HDF5-backed out-of-memory data storage and manipulation.75- `TileDBArray`: For TileDB-backed multi-dimensional array storage.76- `LoomExperiment`: For Loom-backed single-cell data storage.7778## Citations79- Zheng et al. (GDS format and gdsfmt package).8081## References82- Homepage: bioconductor.org/packages/SCArray83- Vignette: https://bioconductor.org/packages/release/bioc/vignettes/SCArray/inst/doc/SCArray.html
Run npx skillmds@latest add biomate-ai/scarray in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
scarray It is listed under Coding & Dev Tools on SkillMD.
This skill has not completed SkillMD's automated safety review yet. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
biomate-ai (@biomate-ai) published this skill. Their other Agent Skills are listed on their SkillMD profile.