Learn R Programming

SVG (version 1.0.0)

example_svg_data: Example Spatial Transcriptomics Data

Description

A pre-generated example dataset for testing SVG detection methods. Contains 500 spots and 200 genes, with 50 known SVGs.

Arguments

Value

A list containing the example dataset (see Format section).

Format

A list with components:

counts

Integer matrix (200 genes × 500 spots) of raw counts

logcounts

Numeric matrix of log2(counts + 1)

spatial_coords

Numeric matrix (500 spots × 2) of x, y coordinates

gene_info

Data.frame with columns: gene, is_svg, pattern_type

Examples

Run this code
data(example_svg_data)
str(example_svg_data)

# \donttest{
# Run SVG detection (requires RANN package)
if (requireNamespace("RANN", quietly = TRUE)) {
    results <- CalSVG_MERINGUE(
        example_svg_data$counts,
        example_svg_data$spatial_coords,
        verbose = FALSE
    )

    # Check accuracy
    truth <- example_svg_data$gene_info$is_svg
    detected <- results$p.adj < 0.05
    print(table(truth, detected))
}
# }

Run the code above in your browser using DataLab