tests/testthat/test-quantification.R

test_that("FeatureMatrix works on grange on diff seqnames", {
  fpath <- system.file("extdata", "fragments.tsv.gz", package = "Signac")
  fragments <- CreateFragmentObject(fpath)
  features <- suppressWarnings(c(
    granges(atac_small),
    GenomicRanges::GRanges(
      seqnames = "fake_chr",
      ranges = IRanges::IRanges(start = 1, end = 1000)
    )
  ))
  expect_warning(mat <- FeatureMatrix(
    fragments = fragments,
    features = features,
    verbose = FALSE
  ))
  expect_equal(dim(mat), c(323, 50))
  mat <- FeatureMatrix(
    fragments = fragments,
    features = features,
    keep_all_features = TRUE,
    verbose = FALSE
  )
  expect_equal(dim(mat), c(324, 50))
})

Try the Signac package in your browser

Any scripts or data that you put into this service are public.

Signac documentation built on Aug. 19, 2025, 1:11 a.m.