Skip to content

Commit

Permalink
merge fix
Browse files Browse the repository at this point in the history
  • Loading branch information
AustinHartman committed Nov 18, 2022
2 parents f6824c8 + dfd6713 commit 418d494
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 6 deletions.
8 changes: 5 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: Seurat
Version: 4.2.1.9001
Date: 2022-11-09
Version: 4.3.0
Date: 2022-11-18
Title: Tools for Single Cell Genomics
Description: A toolkit for quality control, analysis, and exploration of single cell RNA sequencing data. 'Seurat' aims to enable users to identify and interpret sources of heterogeneity from single cell transcriptomic measurements, and to integrate diverse types of single cell data. See Satija R, Farrell J, Gennert D, et al (2015) <doi:10.1038/nbt.3192>, Macosko E, Basu A, Satija R, et al (2015) <doi:10.1016/j.cell.2015.05.002>, Stuart T, Butler A, et al (2019) <doi:10.1016/j.cell.2019.05.031>, and Hao, Hao, et al (2020) <doi:10.1101/2020.10.12.335331> for more details.
Authors@R: c(
Expand All @@ -10,8 +10,10 @@ Authors@R: c(
person(given = "Jeff", family = "Farrell", email = "[email protected]", role = "ctb"),
person(given = "Christoph", family = "Hafemeister", email = "[email protected]", role = "ctb", comment = c(ORCID = "0000-0001-6365-8254")),
person(given = "Yuhan", family = "Hao", email = "[email protected]", role = "ctb", comment = c(ORCID = "0000-0002-1810-0822")),
person(given = "Austin", family = "Hartman", email = "[email protected]", role = "ctb", comment = c(ORCID = "0000-0001-7278-1852")),
person(given = "Paul", family = "Hoffman", email = "[email protected]", role = c("aut", "cre"), comment = c(ORCID = "0000-0002-7693-8957")),
person(given = "Jaison", family = "Jain", email = "[email protected]", role = "ctb", comment = c(ORCID = "0000-0002-9478-5018")),
person(given = "Madeline", family = "Kowalski", email = "[email protected]", role = "ctb", comment = c(ORCID = "0000-0002-5655-7620")),
person(given = "Efthymia", family = "Papalexi", email = "[email protected]", role = "ctb", comment = c(ORCID = "0000-0001-5898-694X")),
person(given = "Patrick", family = "Roelli", email = "[email protected]", role = "ctb"),
person(given = "Rahul", family = "Satija", email = "[email protected]", role = "ctb", comment = c(ORCID = "0000-0001-9448-8833")),
Expand Down Expand Up @@ -96,7 +98,7 @@ Collate:
'tree.R'
'utilities.R'
'zzz.R'
RoxygenNote: 7.2.1
RoxygenNote: 7.2.2
Encoding: UTF-8
Suggests:
ape,
Expand Down
10 changes: 9 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
# Seurat 4.2.1 (2022-11-07)
# Seurat 4.3.0 (2022-11-18)

## Added
- Add support for imaging-based spatial datasets

## Changes
- Fix bug in `FindMarkers()` when run post Integration/Transfer ([#6856](https://github.com/satijalab/seurat/issues/6586))

# Seurat 4.2.1 (2022-11-08)

## Changes
- Replaced import from `spatstat.core` with `spatstat.explore`
Expand Down
11 changes: 9 additions & 2 deletions R/differential_expression.R
Original file line number Diff line number Diff line change
Expand Up @@ -989,9 +989,16 @@ FindMarkers.Seurat <- function(
command = norm.command,
value = "normalization.method"
)
} else {
} else if (length(x = intersect(x = c("FindIntegrationAnchors", "FindTransferAnchors"), y = Command(object = object)))) {
command <- intersect(x = c("FindIntegrationAnchors", "FindTransferAnchors"), y = Command(object = object))[1]
Command(
object = object,
command = command,
value = "normalization.method"
)
} else {
NULL
}
}
de.results <- FindMarkers(
object = data.use,
slot = slot,
Expand Down
28 changes: 28 additions & 0 deletions tests/testthat/test_differential_expression.R
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,34 @@ test_that("FindAllMarkers works as expected", {
expect_equal(rownames(results.pseudo)[1], "HLA-DPB1")
})


# Tests for running FindMarkers post integration/transfer
ref <- pbmc_small
ref <- FindVariableFeatures(object = ref, verbose = FALSE, nfeatures = 100)
query <- CreateSeuratObject(
counts = GetAssayData(object = pbmc_small[['RNA']], slot = "counts") + rpois(n = ncol(pbmc_small), lambda = 1)
)
query2 <- CreateSeuratObject(
counts = GetAssayData(object = pbmc_small[['RNA']], slot = "counts")[, 1:40] + rpois(n = ncol(pbmc_small), lambda = 1)
)
query.list <- list(query, query2)
query.list <- lapply(X = query.list, FUN = NormalizeData, verbose = FALSE)
query.list <- lapply(X = query.list, FUN = FindVariableFeatures, verbose = FALSE, nfeatures = 100)
query.list <- lapply(X = query.list, FUN = ScaleData, verbose = FALSE)
query.list <- suppressWarnings(lapply(X = query.list, FUN = RunPCA, verbose = FALSE, npcs = 20))

anchors <- suppressMessages(suppressWarnings(FindIntegrationAnchors(object.list = c(ref, query.list), k.filter = NA, verbose = FALSE)))
object <- suppressMessages(IntegrateData(anchorset = anchors, k.weight = 25, verbose = FALSE))
object <- suppressMessages(ScaleData(object, verbose = FALSE))
object <- suppressMessages(RunPCA(object, verbose = FALSE))
object <- suppressMessages(FindNeighbors(object = object, verbose = FALSE))
object <- suppressMessages(FindClusters(object, verbose = FALSE))
markers <- FindMarkers(object = object, ident.1="0", ident.2="1")
test_that("FindMarkers recognizes log normalizatio", {
expect_equal(markers[1, "p_val"], 1.598053e-14)
expect_equal(markers[1, "avg_log2FC"], -2.614686, tolerance = 1e-6)
})

# Tests for FindConservedMarkers
# -------------------------------------------------------------------------------

Expand Down

0 comments on commit 418d494

Please sign in to comment.