Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions .Rbuildignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
^.*\.Rproj$
^\.Rproj\.user$
^OBS$
^working-scripts-NW$
^working-scripts-MSBR$
^data-raw$
^omnipathr-log$
^doc$
Expand All @@ -13,8 +10,6 @@
^\.claude$
^\.github$
^CLAUDE\.md$
^demo-scripts$
^package management$
^LICENSE\.md$
^vignettes/articles$

^cran-comments\.md$
5 changes: 1 addition & 4 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co

## Package overview

NICHESv2 is an R package for spatial cell-to-cell ligand-receptor communication analysis. It computes LR signaling scores between pairs of cells in spatial and non-spatial single-cell transcriptomics data and organizes results in a memory-efficient S3 object (`NICHESObject`). Version 1.0.0 is being prepared for CRAN, alongside the methods paper. `working-scripts-NW/v1_facts_sheet.md` holds the verified facts that all documents copy.
NICHESv2 is an R package for spatial cell-to-cell ligand-receptor communication analysis. It computes LR signaling scores between pairs of cells in spatial and non-spatial single-cell transcriptomics data and organizes results in a memory-efficient S3 object (`NICHESObject`). Version 1.0.0 is being prepared for CRAN, alongside the methods paper. A facts sheet kept outside the repository holds the verified facts that all documents copy.

## Development commands

Expand Down Expand Up @@ -121,6 +121,3 @@ Custom data frames are also accepted; must have `ligand` and `receptor` columns
- `tests/testthat/` — one test file per source file; `helper-testutils.R` provides shared fixtures
- `vignettes/` — one vignette, `NICHESv2.Rmd`, which runs on bundled data; `vignettes/articles/` holds the website pages and is excluded from the package build
- `.github/workflows/` — `R-CMD-check.yaml` runs the checks; `pkgdown.yaml` builds the website and publishes it from `main`, removing this file first because pkgdown turns top-level Markdown files into pages. Only the Seurat page uses SeuratData; its install steps may fail without stopping the build
- `demo-scripts/` — standalone R scripts demonstrating real-dataset usage (not part of the package build)
- `working-scripts-MSBR/` and `working-scripts-NW/` — exploratory and prototyping scripts; not part of the package
- `package management/` — design documents
2 changes: 0 additions & 2 deletions R/Explore_Radius_Neighborhood.R
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
#' Returned invisibly when \code{show.plot = TRUE}.
#'
#' @examples
#' \donttest{
#' data(NICHESv2_inputs)
#'
#' # Build a coord data.frame from the example metadata
Expand All @@ -53,7 +52,6 @@
#' show.plot = FALSE
#' )
#' head(radius.curve)
#' }
#'
#' @export
Explore_Radius_Neighborhood <- function(
Expand Down
10 changes: 0 additions & 10 deletions R/NICHESObject_class.R
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@ is_NICHESObject <- function(x) inherits(x, "NICHESObject")
#' \code{\link{dim.NICHESObject}}, \code{\link{is_NICHESObject}}.
#'
#' @examples
#' \donttest{
#' # Build a tiny NICHESObject for demonstration
#' set.seed(1L)
#' count.mtx <- Matrix::sparseMatrix(
Expand All @@ -152,7 +151,6 @@ is_NICHESObject <- function(x) inherits(x, "NICHESObject")
#'
#' print(obj)
#' obj # implicit print
#' }
#'
#' @export
print.NICHESObject <- function(x, ...) {
Expand Down Expand Up @@ -247,7 +245,6 @@ print.NICHESObject <- function(x, ...) {
#' @seealso \code{\link{print.NICHESObject}}, \code{\link{dim.NICHESObject}}.
#'
#' @examples
#' \donttest{
#' set.seed(1L)
#' count.mtx <- Matrix::sparseMatrix(
#' i = sample(6L, 30L, replace = TRUE),
Expand All @@ -272,7 +269,6 @@ print.NICHESObject <- function(x, ...) {
#' )
#'
#' summary(obj)
#' }
#'
#' @export
summary.NICHESObject <- function(object, ...) {
Expand Down Expand Up @@ -361,7 +357,6 @@ summary.NICHESObject <- function(object, ...) {
#' \code{\link{summary.NICHESObject}} for a fuller breakdown.
#'
#' @examples
#' \donttest{
#' set.seed(1L)
#' count.mtx <- Matrix::sparseMatrix(
#' i = sample(6L, 30L, replace = TRUE),
Expand All @@ -385,7 +380,6 @@ summary.NICHESObject <- function(object, ...) {
#' )
#'
#' dim(obj)
#' }
#'
#' @export
dim.NICHESObject <- function(x) {
Expand Down Expand Up @@ -414,7 +408,6 @@ dim.NICHESObject <- function(x) {
#' counts together.
#'
#' @examples
#' \donttest{
#' set.seed(1L)
#' count.mtx <- Matrix::sparseMatrix(
#' i = sample(6L, 30L, replace = TRUE),
Expand All @@ -438,7 +431,6 @@ dim.NICHESObject <- function(x) {
#' )
#'
#' length(obj) # 8
#' }
#'
#' @export
length.NICHESObject <- function(x) length(x$cell.list)
Expand Down Expand Up @@ -489,7 +481,6 @@ length.NICHESObject <- function(x) length(x$cell.list)
#' @seealso \code{\link{is_NICHESObject}} to validate the result.
#'
#' @examples
#' \donttest{
#' set.seed(1L)
#' count.mtx <- Matrix::sparseMatrix(
#' i = sample(6L, 30L, replace = TRUE),
Expand All @@ -515,7 +506,6 @@ length.NICHESObject <- function(x) length(x$cell.list)
#' # Subset to the first four cells; only fully-internal edges are kept
#' sub <- obj[paste0("Cell", 1:4)]
#' dim(sub)
#' }
#'
#' @export
`[.NICHESObject` <- function(x, i, ...) {
Expand Down
2 changes: 0 additions & 2 deletions R/add_cell_meta.R
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
#' \code{\link{aggregate_NICHESObject}} to recompute stale aggregations.
#'
#' @examples
#' \donttest{
#' data(NICHESv2_example)
#'
#' # Build a complete replacement metadata table
Expand All @@ -64,7 +63,6 @@
#' # New column propagates to edges
#' head(obj.updated$edge.meta[, c("SendingCell", "ReceivingCell",
#' "Joint.region")])
#' }
#'
#' @export
#' @import data.table
Expand Down
2 changes: 0 additions & 2 deletions R/add_cell_rawcounts.R
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,13 @@
#' from Seurat or AnnData objects.
#'
#' @examples
#' \donttest{
#' data(NICHESv2_inputs)
#' data(NICHESv2_example)
#'
#' # NICHESv2_inputs$count.mtx is the raw count matrix used to build
#' # NICHESv2_example. Attach it as the provenance count column.
#' obj <- add_cell_rawcounts(NICHESv2_example, NICHESv2_inputs$count.mtx)
#' head(obj$cell.data[, c("cell", "gene", "score", "score.norm", "count")])
#' }
#'
#' @export
#' @import data.table
Expand Down
2 changes: 0 additions & 2 deletions R/add_meta_column.R
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
#' \code{\link{aggregate_NICHESObject}} to recompute stale aggregations.
#'
#' @examples
#' \donttest{
#' data(NICHESv2_example)
#'
#' # Add a new numeric column
Expand All @@ -69,7 +68,6 @@
#' obj.updated <- add_meta_column(NICHESv2_example,
#' col.name = "celltype",
#' col.values = new.types)
#' }
#'
#' @export
#' @import data.table
Expand Down
2 changes: 0 additions & 2 deletions R/add_neighborhood_composition.R
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@
#' \code{\link{aggregate_NICHESObject}}
#'
#' @examples
#' \donttest{
#' data(NICHESv2_example)
#'
#' obj <- add_neighborhood_composition(
Expand All @@ -92,7 +91,6 @@
#' include.self = FALSE,
#' normalize = FALSE
#' )
#' }
#'
#' @export
add_neighborhood_composition <- function(
Expand Down
2 changes: 0 additions & 2 deletions R/add_neighborhood_edge_agg.R
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,10 @@
#' \code{\link{aggregate_NICHESObject}}
#'
#' @examples
#' \donttest{
#' data(NICHESv2_example)
#'
#' obj <- add_neighborhood_edge_agg(NICHESv2_example, n.cores = 1L)
#' head(obj$aggregations$neighborhood.edge.agg)
#' }
#'
#' @export
add_neighborhood_edge_agg <- function(
Expand Down
2 changes: 0 additions & 2 deletions R/add_neighborhoods.R
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
#' set on the object.
#'
#' @examples
#' \donttest{
#' data(NICHESv2_example)
#'
#' # Default neighborhood: edges where BOTH endpoints lie in the same
Expand All @@ -43,7 +42,6 @@
#' first.cell <- names(obj.nb$neighborhood.cell.list)[1]
#' obj.nb$neighborhood.cell.list[[first.cell]]
#' obj.nb$neighborhood.edge.list[[first.cell]]
#' }
#'
#' @export
add_neighborhoods <- function(niches.obj,
Expand Down
2 changes: 0 additions & 2 deletions R/aggregate_NICHESObject.R
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@
#' \code{\link{add_neighborhood_composition}}
#'
#' @examples
#' \donttest{
#' data(NICHESv2_example)
#'
#' # Edge aggregation only
Expand All @@ -87,7 +86,6 @@
#' cell.type.col = "celltype",
#' n.cores = 1L
#' )
#' }
#'
#' @export
aggregate_NICHESObject <- function(
Expand Down
2 changes: 0 additions & 2 deletions R/compute_CellToCell.R
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,6 @@
#' \code{\link{load_LRM_database}} for the LR-database loader.
#'
#' @examples
#' \donttest{
#' data(NICHESv2_inputs)
#'
#' # Build a spatial kNN edge list (coord must have row names = barcodes)
Expand Down Expand Up @@ -182,7 +181,6 @@
#' # Spatial edge lists carry coordinates -- they propagate to $edges
#' setdiff(c("x.from", "y.from", "x.to", "y.to"), colnames(result$edges))
#' # character(0) -- all four coordinate columns are present
#' }
#'
#' @export
compute_CellToCell <- function(count.mtx,
Expand Down
2 changes: 0 additions & 2 deletions R/create_NICHESObject.R
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,6 @@
#' \code{\link{aggregate_NICHESObject}} for downstream summarization.
#'
#' @examples
#' \donttest{
#' data(NICHESv2_inputs)
#'
#' # ---- Basic spatial mode (kNN edges) ----
Expand Down Expand Up @@ -194,7 +193,6 @@
#' verbose = FALSE
#' )
#' attr(obj.split, "sample.col") # "sample"
#' }
#'
#' @export
create_NICHESObject <- function(count.mtx,
Expand Down
18 changes: 0 additions & 18 deletions R/data.R
Original file line number Diff line number Diff line change
Expand Up @@ -164,11 +164,9 @@ NULL
#' @keywords datasets
#'
#' @examples
#' \donttest{
#' db <- load_LRM_database("fantom5", species = "human")
#' head(db)
#' nrow(db)
#' }
NULL


Expand Down Expand Up @@ -203,11 +201,9 @@ NULL
#' @keywords datasets
#'
#' @examples
#' \donttest{
#' db <- load_LRM_database("fantom5", species = "human")
#' head(db)
#' nrow(db)
#' }
NULL


Expand Down Expand Up @@ -243,11 +239,9 @@ NULL
#' @keywords datasets
#'
#' @examples
#' \donttest{
#' db <- load_LRM_database("fantom5", species = "mouse")
#' head(db)
#' nrow(db)
#' }
NULL


Expand Down Expand Up @@ -283,11 +277,9 @@ NULL
#' @keywords datasets
#'
#' @examples
#' \donttest{
#' db <- load_LRM_database("fantom5", species = "rat")
#' head(db)
#' nrow(db)
#' }
NULL


Expand Down Expand Up @@ -325,11 +317,9 @@ NULL
#' @keywords datasets
#'
#' @examples
#' \donttest{
#' db <- load_LRM_database("fantom5", species = "pig")
#' head(db)
#' nrow(db)
#' }
NULL


Expand Down Expand Up @@ -375,11 +365,9 @@ NULL
#' @keywords datasets
#'
#' @examples
#' \donttest{
#' db <- load_LRM_database("connectomedb2025", species = "human")
#' head(db)
#' nrow(db)
#' }
NULL


Expand Down Expand Up @@ -409,11 +397,9 @@ NULL
#' @keywords datasets
#'
#' @examples
#' \donttest{
#' db <- load_LRM_database("connectomedb2025", species = "mouse")
#' head(db)
#' nrow(db)
#' }
NULL


Expand Down Expand Up @@ -443,11 +429,9 @@ NULL
#' @keywords datasets
#'
#' @examples
#' \donttest{
#' db <- load_LRM_database("connectomedb2025", species = "rat")
#' head(db)
#' nrow(db)
#' }
NULL


Expand Down Expand Up @@ -479,9 +463,7 @@ NULL
#' @keywords datasets
#'
#' @examples
#' \donttest{
#' db <- load_LRM_database("connectomedb2025", species = "pig")
#' head(db)
#' nrow(db)
#' }
NULL
2 changes: 0 additions & 2 deletions R/load_LRM_database.R
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@
#'
#' @examples
#' # ConnectomeDB2025 is the default -- no db argument needed.
#' \donttest{
#' lrm.human <- load_LRM_database(species = "human")
#' head(lrm.human)
#'
Expand All @@ -87,7 +86,6 @@
#' lrm.user <- load_LRM_database(my.db,
#' ligand.col = "Ligand",
#' receptor.col = "Receptor")
#' }
#'
#' # OmniPath needs internet access, so this runs in interactive sessions only.
#' if (interactive()) {
Expand Down
Loading
Loading