Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
613b837
feat(agreement): add agreement function
jamespeapen Oct 14, 2025
387f809
feat(CompartmentCall): S7 CompartmentCall object and methods
jamespeapen Oct 14, 2025
5ca4704
feat(S7): CompartmapCall object for grouped calls
jamespeapen Oct 14, 2025
35f8557
feat(S7): MultiCompartmentCall object to combine multiple calls/singl…
jamespeapen Oct 14, 2025
57d67e7
fix(S7): add name as a column to the dt slot
jamespeapen Oct 14, 2025
c2c26cd
feat(S7): add subsetting functions to CompartmentCall, MultiCompartme…
jamespeapen Oct 14, 2025
e2df223
fix(S7): allow plotting with coords instead of just index
jamespeapen Oct 14, 2025
23661b7
feat(S7): add print methods
jamespeapen Oct 15, 2025
1493b16
fix(S7): don't print coordinate labels by default to avoid crowding
jamespeapen Oct 15, 2025
88a2172
fix(S7): reset n in @df when subset
jamespeapen Oct 15, 2025
b27cf77
fix(S7): reduce default linewidth
jamespeapen Oct 15, 2025
4a71013
fix(s7): fix MultiCompartmentCall unitarizing
jamespeapen Oct 15, 2025
448c1ec
fix(S7): update @dt print description
jamespeapen Oct 15, 2025
c20a8b7
fix(DESCRIPTION): add data.table imports
jamespeapen Oct 16, 2025
4987aaa
fix(S7): switch all object args to x
jamespeapen Oct 16, 2025
a44ea64
docs(S7): document all generic methods
jamespeapen Oct 16, 2025
1c35e7b
fix(S7): use S7 S7_dispatch so ... args are not needed
jamespeapen Oct 17, 2025
c0663af
fix(S7): add ... placeholder to plotters for s3 compatibility
jamespeapen Oct 17, 2025
145ec24
fix(S7): add methods::initialize for R CMD check
jamespeapen Oct 17, 2025
3efa8c2
fix(S7): remove i-only subset function
jamespeapen Oct 17, 2025
db417f8
fix(S7): remove restriction on single value subsetting
jamespeapen Oct 17, 2025
6eee6eb
fix(S7): renumber the subset MultiCompartmentCall object
jamespeapen Oct 17, 2025
4179cb5
fix(S7): correctly name the subsetting generic
jamespeapen Oct 17, 2025
32453fa
fix(S7): add CompartmentCall@dt column names to global for checks
jamespeapen Oct 17, 2025
03b08f3
fix(S7): allow any xe5/6 values for res, allow vectors
jamespeapen Oct 17, 2025
5175bd5
feat(S7): add SingleCellCompartmentCall
jamespeapen Oct 21, 2025
cff136c
fix(S7): actually unitarize MultiCompartmentCall matrix
jamespeapen Oct 21, 2025
c2e523e
fix(S7): stop on Unsupported resolutions
jamespeapen Oct 21, 2025
6ce1b37
fix(S7): restore lost name after unitarize
jamespeapen Oct 21, 2025
9922110
fix(S7): apply on mat slot
jamespeapen Oct 21, 2025
8b17565
fix(S7): set MultiCompartmentCall col order with order of input
jamespeapen Oct 29, 2025
de4c218
fix(S7): check vector not single of unitarized bools
jamespeapen Nov 4, 2025
81b3042
feat(S7): add barplotting option to plot, refactor `plot`
jamespeapen Nov 4, 2025
b18b506
fix(S7): allow passing arguments to stats::cor from corr
jamespeapen Nov 5, 2025
b8d17b6
fix(S7): facet MultiCompartmentCall bar plot, refactor
jamespeapen Nov 5, 2025
e197ae2
feat(S7): fill in lost bins using a reference bin set
jamespeapen Nov 5, 2025
a59a191
feat(S7): add support for seqlevels and seqinfo
jamespeapen Nov 18, 2025
b06f244
feat(S7): new generic for subsetting by chromosome
jamespeapen Nov 18, 2025
62b5fd5
feat(S7): add findOverlaps for CompartmentCall objects
jamespeapen Nov 20, 2025
362ba9b
feat(S7): add dimension metadata getters
jamespeapen Nov 20, 2025
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
4 changes: 3 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ Imports:
DelayedMatrixStats,
Matrix,
RMTstat,
impute
impute,
data.table,
S7
Suggests:
csaw,
minfi,
Expand Down
34 changes: 34 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,16 +1,30 @@
# Generated by roxygen2: do not edit by hand

S3method("[","compartmap::CompartmentCall")
S3method("[","compartmap::MultiCompartmentCall")
S3method(plot,"compartmap::CompartmentCall")
S3method(plot,"compartmap::MultiCompartmentCall")
export(CompartmapCall)
export(CompartmentCall)
export(DF)
export(MultiCompartmentCall)
export(SingleCellCompartmentCall)
export(agr)
export(agreement)
export(agrestiCoullCI)
export(bootstrapCompartments)
export(condenseRE)
export(condenseSE)
export(corr)
export(estRMT)
export(extractOpenClosed)
export(fexpit)
export(fill_missing)
export(filterCompartments)
export(filterOpenSea)
export(fisherZ)
export(fixCompartments)
export(flip)
export(flogit)
export(getABSignal)
export(getATACABsignal)
Expand All @@ -28,27 +42,33 @@ export(getOpenSeas)
export(getSVD)
export(getSeqLengths)
export(getShrinkageTargets)
export(get_name)
export(hdf5TFIDF)
export(ifisherZ)
export(importBigWig)
export(imputeKNN)
export(is_unitarized)
export(meanSmoother)
export(plotAB)
export(plotCorMatrix)
export(precomputeBootstrapMeans)
export(preprocessArrays)
export(removeEmptyBoots)
export(resolution)
export(scCompartments)
export(shrinkBins)
export(sparseToDenseMatrix)
export(subset_chr)
export(summarizeBootstraps)
export(transformTFIDF)
export(unitarize)
import(DelayedArray)
import(DelayedMatrixStats)
import(GenomicRanges)
import(HDF5Array)
import(Matrix)
import(RaggedExperiment)
import(S7)
import(SummarizedExperiment)
importFrom(BiocSingular,IrlbaParam)
importFrom(BiocSingular,runSVD)
Expand All @@ -60,17 +80,30 @@ importFrom(GenomeInfoDb,seqlengths)
importFrom(GenomeInfoDb,seqlevels)
importFrom(S4Vectors,queryHits)
importFrom(S4Vectors,subjectHits)
importFrom(data.table,":=")
importFrom(data.table,.I)
importFrom(data.table,.N)
importFrom(data.table,as.data.table)
importFrom(data.table,data.table)
importFrom(data.table,dcast)
importFrom(data.table,melt)
importFrom(data.table,rbindlist)
importFrom(ggplot2,aes)
importFrom(ggplot2,element_blank)
importFrom(ggplot2,element_text)
importFrom(ggplot2,geom_bar)
importFrom(ggplot2,geom_line)
importFrom(ggplot2,geom_raster)
importFrom(ggplot2,ggplot)
importFrom(ggplot2,scale_fill_gradient2)
importFrom(ggplot2,scale_y_continuous)
importFrom(ggplot2,theme)
importFrom(ggplot2,theme_minimal)
importFrom(graphics,abline)
importFrom(graphics,barplot)
importFrom(graphics,par)
importFrom(methods,as)
importFrom(methods,initialize)
importFrom(methods,is)
importFrom(parallel,mclapply)
importFrom(rlang,.data)
Expand All @@ -80,4 +113,5 @@ importFrom(stats,median)
importFrom(stats,optim)
importFrom(stats,sd)
importFrom(stats,weighted.mean)
importFrom(utils,combn)
importFrom(utils,data)
26 changes: 26 additions & 0 deletions R/analysis.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#' Compute sign agreement of a matrix of singular values
#' @param mat A matrix of compartment calls where each column is a single-cell
#' or grouped set of singular values
#' @importFrom utils combn
#' @export
agreement <- function(mat) {
cmbs <- combn(1:ncol(mat), 2)
ncols <- ncol(mat)
agrmat <- matrix(nrow = ncols, ncol = ncols)
for (cidx in seq(ncol(cmbs))) {
i <- cmbs[, cidx][1]
j <- cmbs[, cidx][2]
res <- .agreement(mat[, i], mat[, j])
agrmat[i, j] <- res
agrmat[j, i] <- res
}
dimnames(agrmat) <- list(colnames(mat), colnames(mat))
diag(agrmat) <- 1
agrmat
}

.agreement <- function(v1, v2) {
b1 <- v1 > 0
b2 <- v2 > 0
sum(b1 == b2) / length(v1)
}
Loading