Skip to content

Commit

Permalink
Merge branch 'develop' into set_defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
lldelisle authored Jan 16, 2025
2 parents 5c1457a + 51ceab1 commit 82c3f3a
Show file tree
Hide file tree
Showing 73 changed files with 201,991 additions and 534 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/cmd-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
fail-fast: false
matrix:
config:
- { os: ubuntu-latest, r: '4.1', bioc: '3.14', cont: "bioconductor/bioconductor_docker:RELEASE_3_14", rspm: "https://packagemanager.posit.co/cran/__linux__/focal/latest" }
- { os: ubuntu-latest, r: '4.4', bioc: '3.19', cont: "bioconductor/bioconductor_docker:RELEASE_3_19", rspm: "https://packagemanager.posit.co/cran/__linux__/focal/latest" }

env:
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
Expand Down Expand Up @@ -112,7 +112,7 @@ jobs:
- name: Install Linux system dependencies
if: runner.os == 'Linux'
run: |
sysreqs=$(Rscript -e 'Sys.setenv(RSPM_ROOT = "https://packagemanager.posit.co"); cat("apt-get update -y && apt-get install -y", paste(gsub("apt-get install -y ", "", remotes::system_requirements("ubuntu", "20.04")), collapse = " "))')
sysreqs=$(Rscript -e 'cat("apt-get update -y && apt-get install -y", paste(gsub("apt-get install -y ", "", remotes::system_requirements("ubuntu", "20.04")), collapse = " "))')
echo $sysreqs
sudo -s eval "$sysreqs"
Expand Down
16 changes: 8 additions & 8 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: Signac
Title: Analysis of Single-Cell Chromatin Data
Version: 1.10.0
Date: 2023-05-26
Version: 1.14.9002
Date: 2025-01-16
Authors@R: c(
person(given = 'Tim', family = 'Stuart', email = 'stuartt@gis.a-star.edu.sg', role = c('aut', 'cre'), comment = c(ORCID = '0000-0002-3044-0897')),
person(given = 'Avi', family = 'Srivastava', email = 'asrivastava@nygenome.org', role = 'aut', comment = c(ORCID = '0000-0001-9798-2079')),
Expand All @@ -14,12 +14,12 @@ Description: A framework for the analysis and exploration of single-cell chromat
and normalization, visualization, and DNA sequence motif analysis.
Reference: Stuart et al. (2021) <doi:10.1038/s41592-021-01282-5>.
Depends:
R (>= 4.0.0),
R (>= 4.1.0),
methods
License: MIT + file LICENSE
Encoding: UTF-8
LazyData: true
RoxygenNote: 7.2.3
RoxygenNote: 7.3.2
URL: https://github.com/stuart-lab/signac, https://stuartlab.org/signac
BugReports: https://github.com/stuart-lab/signac/issues
LinkingTo: Rcpp
Expand All @@ -30,7 +30,7 @@ Imports:
Matrix,
Rsamtools,
S4Vectors,
SeuratObject (>= 4.0.0),
SeuratObject (>= 5.0.2),
data.table,
dplyr (>= 1.0.0),
future,
Expand All @@ -52,7 +52,8 @@ Imports:
grid,
tidyselect,
vctrs,
rtracklayer
rtracklayer,
lifecycle
Collate:
'RcppExports.R'
'data.R'
Expand All @@ -77,7 +78,7 @@ Collate:
'visualization.R'
'zzz.R'
Suggests:
Seurat (>= 4.0.6),
Seurat (>= 5.0.2),
ggforce,
ggrepel,
ggseqlogo,
Expand All @@ -92,5 +93,4 @@ Suggests:
biovizBase,
Biostrings,
lsa,
qlcMatrix,
MASS
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM satijalab/seurat:latest
FROM satijalab/seurat:5.0.0

RUN apt-get update --fix-missing \
&& apt-get install -y libbz2-dev liblzma-dev \
Expand Down
24 changes: 24 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ S3method("Annotation<-",Seurat)
S3method("Cells<-",Fragment)
S3method("Fragments<-",ChromatinAssay)
S3method("Fragments<-",Seurat)
S3method("LayerData<-",ChromatinAssay)
S3method("Links<-",ChromatinAssay)
S3method("Links<-",Seurat)
S3method("Motifs<-",ChromatinAssay)
Expand All @@ -13,12 +14,14 @@ S3method("[",Motif)
S3method(AddMotifs,Assay)
S3method(AddMotifs,ChromatinAssay)
S3method(AddMotifs,Seurat)
S3method(AddMotifs,StdAssay)
S3method(AddMotifs,default)
S3method(AggregateTiles,ChromatinAssay)
S3method(AggregateTiles,Seurat)
S3method(AggregateTiles,default)
S3method(AlleleFreq,Assay)
S3method(AlleleFreq,Seurat)
S3method(AlleleFreq,StdAssay)
S3method(AlleleFreq,default)
S3method(Annotation,ChromatinAssay)
S3method(Annotation,Seurat)
Expand All @@ -34,9 +37,11 @@ S3method(ConvertMotifID,Assay)
S3method(ConvertMotifID,ChromatinAssay)
S3method(ConvertMotifID,Motif)
S3method(ConvertMotifID,Seurat)
S3method(ConvertMotifID,StdAssay)
S3method(ConvertMotifID,default)
S3method(FindTopFeatures,Assay)
S3method(FindTopFeatures,Seurat)
S3method(FindTopFeatures,StdAssay)
S3method(FindTopFeatures,default)
S3method(Footprint,ChromatinAssay)
S3method(Footprint,Seurat)
Expand All @@ -48,9 +53,11 @@ S3method(GetMotifData,Motif)
S3method(GetMotifData,Seurat)
S3method(IdentifyVariants,Assay)
S3method(IdentifyVariants,Seurat)
S3method(IdentifyVariants,StdAssay)
S3method(IdentifyVariants,default)
S3method(InsertionBias,ChromatinAssay)
S3method(InsertionBias,Seurat)
S3method(LayerData,ChromatinAssay)
S3method(Links,ChromatinAssay)
S3method(Links,Seurat)
S3method(Motifs,ChromatinAssay)
Expand All @@ -67,9 +74,11 @@ S3method(RunChromVAR,ChromatinAssay)
S3method(RunChromVAR,Seurat)
S3method(RunSVD,Assay)
S3method(RunSVD,Seurat)
S3method(RunSVD,StdAssay)
S3method(RunSVD,default)
S3method(RunTFIDF,Assay)
S3method(RunTFIDF,Seurat)
S3method(RunTFIDF,StdAssay)
S3method(RunTFIDF,default)
S3method(SetAssayData,ChromatinAssay)
S3method(SetMotifData,ChromatinAssay)
Expand Down Expand Up @@ -166,6 +175,7 @@ export(RunChromVAR)
export(RunSVD)
export(RunTFIDF)
export(SetMotifData)
export(SortIdents)
export(SplitFragments)
export(StringToGRanges)
export(SubsetMatrix)
Expand All @@ -179,6 +189,7 @@ export(ValidateFragments)
export(ValidateHash)
export(VariantPlot)
export(as.ChromatinAssay)
export(corSparse)
export(theme_browser)
exportClasses(ChromatinAssay)
exportClasses(Fragment)
Expand Down Expand Up @@ -300,15 +311,23 @@ importFrom(S4Vectors,queryHits)
importFrom(S4Vectors,split)
importFrom(S4Vectors,subjectHits)
importFrom(SeuratObject,"Idents<-")
importFrom(SeuratObject,"Key<-")
importFrom(SeuratObject,"LayerData<-")
importFrom(SeuratObject,"VariableFeatures<-")
importFrom(SeuratObject,AddMetaData)
importFrom(SeuratObject,Assays)
importFrom(SeuratObject,Cells)
importFrom(SeuratObject,CheckFeaturesNames)
importFrom(SeuratObject,CreateAssayObject)
importFrom(SeuratObject,CreateDimReducObject)
importFrom(SeuratObject,CreateSeuratObject)
importFrom(SeuratObject,DefaultAssay)
importFrom(SeuratObject,Embeddings)
importFrom(SeuratObject,GetAssayData)
importFrom(SeuratObject,Idents)
importFrom(SeuratObject,Key)
importFrom(SeuratObject,LayerData)
importFrom(SeuratObject,Layers)
importFrom(SeuratObject,Project)
importFrom(SeuratObject,RenameCells)
importFrom(SeuratObject,RowMergeSparseMatrices)
Expand Down Expand Up @@ -373,6 +392,8 @@ importFrom(ggplot2,ylab)
importFrom(ggplot2,ylim)
importFrom(grid,arrow)
importFrom(irlba,irlba)
importFrom(lifecycle,deprecated)
importFrom(lifecycle,is_present)
importFrom(methods,"slot<-")
importFrom(methods,as)
importFrom(methods,callGeneric)
Expand Down Expand Up @@ -401,6 +422,7 @@ importFrom(stats,dist)
importFrom(stats,ecdf)
importFrom(stats,hclust)
importFrom(stats,median)
importFrom(stats,na.omit)
importFrom(stats,p.adjust)
importFrom(stats,phyper)
importFrom(stats,pnorm)
Expand All @@ -414,6 +436,7 @@ importFrom(tools,file_ext)
importFrom(tools,md5sum)
importFrom(utils,globalVariables)
importFrom(utils,head)
importFrom(utils,packageVersion)
importFrom(utils,read.table)
importFrom(utils,setTxtProgressBar)
importFrom(utils,txtProgressBar)
Expand All @@ -425,6 +448,7 @@ importMethodsFrom(GenomicRanges,seqnames)
importMethodsFrom(GenomicRanges,start)
importMethodsFrom(GenomicRanges,strand)
importMethodsFrom(GenomicRanges,width)
importMethodsFrom(Matrix,colMeans)
importMethodsFrom(Matrix,mean)
importMethodsFrom(Matrix,t)
useDynLib(Signac)
66 changes: 65 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,67 @@
# Unreleased

Other changes:

* Improve error messages for `FindMotifs()` ([#1788](https://github.com/stuart-lab/signac/issues/1788))
* Add documentation about the required format for gene annotations, and ensure this format is present when creating the assay ([#1797](https://github.com/stuart-lab/signac/pull/1797); [@lldelisle](https://github.com/lldelisle))

# Signac 1.14.0

New features:

* Added `SortIdents()` function to automatically order cell metadata according
to similarity ([@JavenTyr](https://github.com/JavenTyr))

Other changes:

* Change to SeuratObject v5.0.2 dependency
* Increase R dependency to 4.1
* Deprecate `CoverageBrowser()`
* Add informative error message for `ClosestFeature()` when gene annotations are not present in the object ([#1681](https://github.com/stuart-lab/signac/issues/1681))
* Fix error in `CreateChromatinAssay()` when supplying a pre-computed Motif object ([#1657](https://github.com/stuart-lab/signac/issues/1657))
* Fix error in `CoveragePlot()` when combining `cells` and `group.by` parameters ([#1724](https://github.com/stuart-lab/signac/issues/1724))
* Added warning in `FeatureMatrix()` when requested features are on seqnames not
present in the fragment file ([#1754](https://github.com/stuart-lab/signac/issues/1754))

# Signac 1.13.0

Bug fixes:

* Fix bug in `SetAssayData()` for `ChromatinAssay` objects ([#1538](https://github.com/stuart-lab/signac/issues/1538))
* Fix bug in `TSSEnrichment()` causing error on small example dataset ([#1563](https://github.com/stuart-lab/signac/issues/1563))
* Fix errors when using a CSI index ([#1494](https://github.com/stuart-lab/signac/issues/1494))
* Fix error in `Footprint()` when running on a small number of regions ([#1614](https://github.com/stuart-lab/signac/issues/1614))
* Fix error in `CoveragePlot()` and `PlotFootprint()` when setting both `ident` and `split.by` parameters ([#1660](https://github.com/stuart-lab/signac/issues/1660))
* Fix bug in `MatchRegionStats()` when NA values are present in only some of the feature metadata rows ([#1655](https://github.com/stuart-lab/signac/issues/1655))

Other changes:

* Add ability to plot links for certain genes only in `CoveragePlot()` ([#1459](https://github.com/stuart-lab/signac/issues/1459))
* Add `corSparse()`, remove qlcMatrix from suggested packages ([#1570](https://github.com/stuart-lab/signac/issues/1570))
* Update documentation for `GetLinkedPeaks()` and `GetLinkedGenes()` ([#1654](https://github.com/stuart-lab/signac/issues/1654))

# Signac 1.12.0

Bug fixes:

* Fixed bug in fragment file filtering with `FilterCells()` ([#1509](https://github.com/stuart-lab/signac/issues/1509))

Other changes:

* Add support for SeuratObject v5

# Signac 1.11.0

Bug fixes:

* Fix error when supplying genome string to `AddMotifs()` function ([#1437](https://github.com/stuart-lab/signac/issues/1437))
* Fix error in quantification with multiple fragment files ([#1474](https://github.com/stuart-lab/signac/issues/1474))

Other changes:

* Added `region_extension` parameter to `TSSEnrichment()` function to enable changing the size of the region used to compute TSS enrichment scores ([#1444](https://github.com/stuart-lab/signac/pull/1402); @twmcart)
* Allow fragment files with a CSI index ([#1494](https://github.com/stuart-lab/signac/issues/1494))

# Signac 1.10.0

New functionality:
Expand All @@ -7,7 +71,7 @@ New functionality:

Bug fixes:

* Fixed error in `GetReadsInRegion()` when no fragments present that overlap the region (@rockweiler; [#1348](https://github.com/stuart-lab/signac/pull/1348))
* Fixed error in `GetReadsInRegion()` when no fragments present that overlap the region (@nrockweiler; [#1348](https://github.com/stuart-lab/signac/pull/1348))
* Make motif names unique to avoid errors in motif-related functions ([#1311](https://github.com/stuart-lab/signac/issues/1311))
* Ignore missing seqnames when constructing a Motif object ([#1381](https://github.com/stuart-lab/signac/issues/1381))
* Fixed error in `BigwigTrack()` ([#1389](https://github.com/stuart-lab/signac/issues/1389))
Expand Down
2 changes: 1 addition & 1 deletion R/differential_accessibility.R
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ FoldChange.ChromatinAssay <- function(
no = base
)
fc.name <- SetIfNull(x = fc.name, y = paste0("avg_log", base.text, "FC"))
data <- GetAssayData(object = object, slot = slot)
data <- GetAssayData(object = object, layer = slot)
Seurat::FoldChange(
object = data,
cells.1 = cells.1,
Expand Down
45 changes: 44 additions & 1 deletion R/dimension_reduction.R
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,12 @@ RunSVD.default <- function(
tol = 1e-05,
...
) {
if (is.null(x = rownames(x = object))) {
rownames(x = object) <- seq_len(length.out = nrow(x = object))
}
if (is.null(x = colnames(x = object))) {
colnames(x = object) <- seq_len(length.out = ncol(x = object))
}
n <- min(n, (ncol(x = object) - 1))
if (verbose) {
message("Running SVD")
Expand Down Expand Up @@ -128,7 +134,9 @@ RunSVD.default <- function(
#' @concept dimension_reduction
#' @method RunSVD Assay
#' @examples
#' \dontrun{
#' RunSVD(atac_small[['peaks']])
#' }
RunSVD.Assay <- function(
object,
assay = NULL,
Expand All @@ -142,7 +150,7 @@ RunSVD.Assay <- function(
features <- SetIfNull(x = features, y = VariableFeatures(object = object))
data.use <- GetAssayData(
object = object,
slot = "data"
layer = "data"
)[features, ]
reduction.data <- RunSVD(
object = data.use,
Expand All @@ -157,13 +165,48 @@ RunSVD.Assay <- function(
return(reduction.data)
}

#' @param features Which features to use. If NULL, use variable features
#'
#' @rdname RunSVD
#' @importFrom SeuratObject VariableFeatures GetAssayData
#' @export
#' @concept dimension_reduction
#' @method RunSVD StdAssay
#' @examples
#' \dontrun{
#' RunSVD(atac_small[['peaks']])
#' }
RunSVD.StdAssay <- function(
object,
assay = NULL,
features = NULL,
n = 50,
reduction.key = "LSI_",
scale.max = NULL,
verbose = TRUE,
...
) {
RunSVD.Assay(
object = object,
assay = assay,
features = features,
n = n,
reduction.key = reduction.key,
scale.max = scale.max,
verbose = verbose,
...
)
}

#' @param reduction.name Name for stored dimension reduction object.
#' Default 'svd'
#' @rdname RunSVD
#' @export
#' @concept dimension_reduction
#' @examples
#' \dontrun{
#' RunSVD(atac_small)
#' }
#' @method RunSVD Seurat
RunSVD.Seurat <- function(
object,
Expand Down
Loading

0 comments on commit 82c3f3a

Please sign in to comment.