Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Seurat v4.0.1 #4247

Merged
merged 119 commits into from
Mar 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
119 commits
Select commit Hold shift + click to select a range
e158bf1
Update visualization.R
hoondy Feb 1, 2021
057c999
better cell naming consistency in Read10X
andrewwbutler Feb 5, 2021
dacb092
update NEWS, bump version
andrewwbutler Feb 5, 2021
734d38f
Merge pull request #520 from satijalab/fix/Read10X_names
mojaveazure Feb 5, 2021
1b26c1d
Add documentation
saketkc Feb 5, 2021
bd9c5f5
Merge remote-tracking branch 'upstream/develop' into patch-1
saketkc Feb 5, 2021
749e247
bump version; update NEWS
saketkc Feb 5, 2021
1b9cc77
Merge pull request #4005 from hoondy/patch-1
saketkc Feb 5, 2021
ca25b9c
Track feature1 parameters in feature.attributes of SCTAssay
saketkc Feb 6, 2021
303c195
Merge branch 'master' into develop
mojaveazure Feb 8, 2021
02099f8
Merge branch 'develop' into feat/sctassay_step1
yuhanH Feb 9, 2021
a439660
bump version
yuhanH Feb 9, 2021
964585b
Add concept
timoast Feb 9, 2021
02a99e9
Merge pull request #522 from satijalab/feat/sctassay_step1
yuhanH Feb 9, 2021
53e8f53
Add spatial concept
timoast Feb 9, 2021
02ae1bc
Fix anchor filtration
timoast Feb 9, 2021
21bf24c
Merge branch 'develop' into fix/annotateanchors
timoast Feb 9, 2021
964780e
Update release notes"
timoast Feb 9, 2021
90823af
Merge branch 'develop' into doc/annotateanchors
timoast Feb 10, 2021
3885f2c
Merge pull request #524 from satijalab/fix/annotateanchors
andrewwbutler Feb 10, 2021
9a92d06
Merge branch 'develop' into doc/annotateanchors
andrewwbutler Feb 10, 2021
265d6c1
Merge pull request #523 from satijalab/doc/annotateanchors
andrewwbutler Feb 10, 2021
9f36cb4
HVFInfo for SCTAssay
yuhanH Feb 12, 2021
1d277bd
fix bug for all variable genes
yuhanH Feb 12, 2021
e498503
Add documentation
mojaveazure Feb 12, 2021
8197bf1
Bump develop version
mojaveazure Feb 12, 2021
f3d8725
Merge pull request #525 from satijalab/feat/HVFInfo_SCTAssay
yuhanH Feb 13, 2021
4d8ad0b
change negihbor default name
yuhanH Feb 13, 2021
4437c0e
update tests neighbor name
yuhanH Feb 13, 2021
54d6a63
Modify Read10X for GEO compatibility
samuel-marsh Feb 18, 2021
ebb33fd
Merge branch 'master' into develop
andrewwbutler Feb 18, 2021
e0084ef
fix pseudocount in FindMarkers.Assay
lldelisle Feb 19, 2021
3863336
fix mean.fxn and fc.name in FindMarkers.DimReduc
lldelisle Feb 19, 2021
0b0345b
Update reference.reduction documentation
timoast Feb 19, 2021
b6db683
pass assay param properly
andrewwbutler Feb 19, 2021
a66226a
Merge pull request #529 from satijalab/docs/refreduc
timoast Feb 19, 2021
216e794
Merge pull request #4111 from lldelisle/fixPseudoCount
timoast Feb 22, 2021
b3375dc
Merge branch 'develop' of github.com:satijalab/seurat into develop
timoast Feb 22, 2021
299070d
Increase dev version
timoast Feb 22, 2021
4028b49
Merge branch 'develop' of github.com:satijalab/seurat-private into de…
timoast Feb 22, 2021
adc4ae0
Merge branch 'develop' into fix/RunLDA
epapalexi Feb 22, 2021
a975e99
Merge pull request #533 from satijalab/doc/releasenotes
andrewwbutler Feb 22, 2021
08f7709
Merge branch 'develop' into fix/RunLDA
andrewwbutler Feb 22, 2021
5c5dfb3
bump version, update NEWS
andrewwbutler Feb 22, 2021
52fc3da
Merge pull request #530 from satijalab/fix/RunLDA
andrewwbutler Feb 22, 2021
186f75d
redev
samuel-marsh Feb 25, 2021
221b34b
redev2
samuel-marsh Feb 25, 2021
8ed8264
Add cols param JackStrawPlot
samuel-marsh Feb 25, 2021
d563a9a
fix manual entry
samuel-marsh Feb 25, 2021
88c86dd
Changed order=T behavior in SingleDimPlot - Order first by NAs and on…
GreenGilad Feb 25, 2021
cf16a26
Merge branch 'master' into develop
andrewwbutler Feb 25, 2021
645c1ae
check nn.name input type
yuhanH Feb 26, 2021
20388c4
format update
yuhanH Feb 26, 2021
3abec01
Merge branch 'develop' into feat/neighbors_name
yuhanH Feb 26, 2021
b439ff7
bump version
yuhanH Feb 26, 2021
8233603
change return neighbor message
yuhanH Feb 26, 2021
7ad9e3f
Merge pull request #526 from satijalab/feat/neighbors_name
yuhanH Feb 26, 2021
781293b
Merge branch 'develop' into feat/check_nn.name
yuhanH Feb 26, 2021
d2809d7
check neighbors and graph
yuhanH Feb 26, 2021
c33ae3d
Update documentation for FindNeighbors; #4155
timoast Feb 26, 2021
7e88987
Merge branch 'develop' of github.com:satijalab/seurat into develop
andrewwbutler Feb 26, 2021
918326f
Merge branch 'develop' into JackStrawPlot_Color
andrewwbutler Feb 26, 2021
336a67f
run docs
andrewwbutler Feb 26, 2021
bdfdf41
bump version, update NEWS
andrewwbutler Feb 26, 2021
c5f0e9d
Merge pull request #4149 from samuel-marsh/JackStrawPlot_Color
andrewwbutler Feb 27, 2021
3175cc8
Merge branch 'develop' into nas_first_plots
andrewwbutler Feb 27, 2021
4a96c09
bump version, update NEWS
andrewwbutler Feb 27, 2021
ef18950
Merge pull request #4153 from GreenGilad/nas_first_plots
andrewwbutler Feb 27, 2021
d9ecef2
Add ReadMtx() to read local and remote mtx files
saketkc Feb 27, 2021
8dbf8d6
Update doc
saketkc Feb 27, 2021
63ba26f
Shorten doc example
saketkc Feb 27, 2021
a17e100
Fix local file support
saketkc Feb 27, 2021
1f7e17f
Merge branch 'develop' into doc/find_neighbors
andrewwbutler Mar 1, 2021
7ad04c0
Merge branch 'develop' into feat/check_nn.name
mojaveazure Mar 1, 2021
930bb00
Minor style fixes
mojaveazure Mar 1, 2021
2d41550
Bump develop version
mojaveazure Mar 1, 2021
29e5018
Merge pull request #537 from satijalab/doc/find_neighbors
timoast Mar 3, 2021
e93aaee
Reduce code duplication
mojaveazure Mar 4, 2021
2989d57
Fixes for Online
mojaveazure Mar 4, 2021
67500da
Fixes for Online
mojaveazure Mar 4, 2021
4fdde35
Merge branch 'develop' into feat/check_nn.name
mojaveazure Mar 4, 2021
ab04794
Bump develop version
mojaveazure Mar 4, 2021
08b3b20
Fix variable name for data
saketkc Mar 4, 2021
8e93cd8
Update NEWS
mojaveazure Mar 4, 2021
82e843b
Fix swapped feature/cell, add text=T for gzcon
saketkc Mar 4, 2021
1fac8c3
use equality thresholds in FindMarkers
jaisonj708 Mar 5, 2021
1466909
Increase min.pct in test
jaisonj708 Mar 5, 2021
c8be04b
Remove on.exit as connections autoclose
saketkc Mar 5, 2021
e594038
Merge branch 'develop' into feat/ReadMtx
saketkc Mar 5, 2021
2d4e1d2
Clean up
saketkc Mar 6, 2021
8e22856
Merge branch 'feat/ReadMtx' of github.com:satijalab/seurat-private in…
saketkc Mar 6, 2021
8fc52a5
Add tests
saketkc Mar 6, 2021
9441185
Swap test
saketkc Mar 6, 2021
bb52f35
Fix test
saketkc Mar 6, 2021
b4d9355
Dont specify
alanocallaghan Mar 12, 2021
52e5739
Update NEWS.md
jaisonj708 Mar 12, 2021
658c31f
bump version
jaisonj708 Mar 12, 2021
04dabdd
Merge pull request #539 from satijalab/fix/diffexp.thresholds
andrewwbutler Mar 12, 2021
a81090c
Merge remote-tracking branch 'upstream/develop'
alanocallaghan Mar 12, 2021
eea2fc0
fix imports with spatstat update
andrewwbutler Mar 15, 2021
afac3e4
bump version, update NEWS
andrewwbutler Mar 15, 2021
b328d0c
Merge pull request #4216 from Alanocallaghan/master
andrewwbutler Mar 15, 2021
330c31a
Merge branch 'develop' into fix/spatstat
andrewwbutler Mar 15, 2021
93d402e
bump version, update NEWS
andrewwbutler Mar 15, 2021
3cdc4bb
Merge pull request #540 from satijalab/fix/spatstat
andrewwbutler Mar 15, 2021
3285a7a
merge
andrewwbutler Mar 15, 2021
855e271
Merge pull request #535 from satijalab/feat/check_nn.name
andrewwbutler Mar 15, 2021
b1a9b80
Merge branch 'develop' into feat/ReadMtx
andrewwbutler Mar 15, 2021
539d168
Style fixes
mojaveazure Mar 15, 2021
06b6333
devtools::document updated this
mojaveazure Mar 15, 2021
3bf40b6
Minor fixes
mojaveazure Mar 15, 2021
4aa73fc
Attempt to trigger GH Actions
mojaveazure Mar 15, 2021
c5ad8a7
bump version, update NEWS
andrewwbutler Mar 16, 2021
d15f7d9
skip ReadMtx tests on CRAN
andrewwbutler Mar 16, 2021
7787dde
Merge pull request #538 from satijalab/feat/ReadMtx
andrewwbutler Mar 16, 2021
9fcacd9
Prep release 4.0.1
mojaveazure Mar 17, 2021
3c4044d
Fix line length in documentation
mojaveazure Mar 17, 2021
43041c3
Update link to Travis CI
mojaveazure Mar 17, 2021
e17c94d
Merge pull request #541 from satijalab/release/4.0.1
mojaveazure Mar 17, 2021
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: 4 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: Seurat
Version: 4.0.0
Date: 2021-01-27
Version: 4.0.1
Date: 2021-03-17
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 Down Expand Up @@ -68,7 +68,8 @@ Imports:
sctransform (>= 0.3.2),
SeuratObject,
shiny,
spatstat,
spatstat.core,
spatstat.geom,
stats,
tibble,
tools,
Expand Down
8 changes: 6 additions & 2 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ S3method(GetImage,VisiumV1)
S3method(GetTissueCoordinates,STARmap)
S3method(GetTissueCoordinates,SlideSeq)
S3method(GetTissueCoordinates,VisiumV1)
S3method(HVFInfo,SCTAssay)
S3method(IntegrateEmbeddings,IntegrationAnchorSet)
S3method(IntegrateEmbeddings,TransferAnchorSet)
S3method(MappingScore,AnchorSet)
Expand Down Expand Up @@ -261,6 +262,7 @@ export(Radius)
export(Read10X)
export(Read10X_Image)
export(Read10X_h5)
export(ReadMtx)
export(ReadSlideSeq)
export(Reductions)
export(RegroupIdents)
Expand Down Expand Up @@ -555,7 +557,9 @@ importFrom(grid,unit)
importFrom(grid,viewport)
importFrom(httr,GET)
importFrom(httr,accept_json)
importFrom(httr,build_url)
importFrom(httr,content)
importFrom(httr,parse_url)
importFrom(httr,status_code)
importFrom(httr,timeout)
importFrom(ica,icafast)
Expand Down Expand Up @@ -636,8 +640,8 @@ importFrom(shiny,sliderInput)
importFrom(shiny,stopApp)
importFrom(shiny,updateSelectInput)
importFrom(shiny,verbatimTextOutput)
importFrom(spatstat,markvario)
importFrom(spatstat,ppp)
importFrom(spatstat.core,markvario)
importFrom(spatstat.geom,ppp)
importFrom(stats,aggregate)
importFrom(stats,anova)
importFrom(stats,approxfun)
Expand Down
27 changes: 23 additions & 4 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,23 @@
# Seurat 4.0.0 (2020-01-27)
# Seurat 4.0.1 (2020-03-17)
## Added
- Expose `FoldChange()` component in `FindMarkers()`.
- Add direction option to `PlotClusterTree()`
- Add `cols` parameter to `JackStrawPlot()`
- Add `ReadMtx()` to read local and remote mtx files with associated cell and feature name files

## Changes
- Equality added to differential expression thresholds in `FindMarkers` (e.g, >= logfc.threshold rather than >)
- `Read10X()` now prepends dataset number for first dataset when reading multiple datasets
- Bug fix for `subset.AnchorSet()`
- Bug fix for fold change values in `FindMarkers()` when setting a different pseudocount ([#4111](https://github.com/satijalab/seurat/pull/4111))
- Bug fix for `RunLDA()` related to proper passing of assay parameter.
- When using `order=TRUE` in `SingleDimPlot()`, print NA points under all others.
- Remove default parameter value for `data.dir` in `Read10X()`
- Import spatstat fxns from subpackages (spatstat.core, spatstat.geom)
- `RunUMAP` now checks for graph/neighbor consistency

# Seurat 4.0.0 (2020-01-27)
## Added
- Expose `FoldChange()` component in `FindMarkers()`.
- Add the `merge.DimReduc` method
- Add `IntegrateEmbeddings()` to correct embeddings of `DimReduc`s
- Add `ProjectUMAP()` to project query cells into a reference UMAP space
Expand All @@ -11,27 +28,29 @@
- Add `FindSubCluster()` to further cluster existing clusters
- Add supervised PCA functionality via `RunSPCA()`
- Add functionality to enable weighted nearest neighbor analyses via `FindMultiModalNeighbors()`
- Add neighbor visualization plot via `NNPlot()`.
- Add neighbor visualization plot via `NNPlot()`.
- Add `PredictAssay()` to impute expression or embeddings from nearest neighbors
- Add `Graphs()` function to access the names of the stored Graph objects or pull a specific one
- Add checks for NA, NaN, logical, non-integer, and infinite values during CreateAssayObject and NormalizeData.default
- Add `AnnotateAnchors()` to aid in AnchorSet interpretation as well as `subset.AnchorSet()`
- Add flexibility of choice for cell column in `Read10X()`
- Add rasterization option to `FeatureScatter()` and `VariableFeaturePlot()`
- Add step1 feature parameters in the SCTModel via `PrepVSTResults()`

## Changes
- Default neighbor finding algorithm changed from "rann" to "annoy"
- Default `ncells` parameter in `SCTransform()` changed to 5000
- Default fold change in `FindMarkers()` changed from ln to log2
- Implementation improvements to `AverageExpression()`
- `AnchorSet` class re-implemented as a virtual class from which `IntegrationAnchorSet` and `TransferAnchorSet` now inherit.
- `AnchorSet` class re-implemented as a virtual class from which `IntegrationAnchorSet` and `TransferAnchorSet` now inherit.
- Point size in `VlnPlot()` now set automatically if not specified
- Return the sample.tree properly when integrating with a single reference dataset
- Replace `as.character.quosure` usage with `as_label` due to deprecation
- Minor changes to the exact calculation of the anchor weight matrix
- Default rasterization limit in `DimPlot()` and `FeaturePlot()` changed from 50,000 to 100,000
- `SCTransform()` now returns a formalized `Assay` subclass `SCTAssay()`
- When using `normalization.method='SCT'` in `FindTransferAnchors()`, normalize query using reference SCT model when possible.
- Change default Neighbor name in `FindNeighbors` to `Assay.nn`

## Removed
- `CreateGeneActivityMatrix` replaced by `Signac::GeneActivity()`
Expand Down
21 changes: 19 additions & 2 deletions R/clustering.R
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,11 @@ FindNeighbors.default <- function(
# find the k-nearest neighbors for each single cell
if (!distance.matrix) {
if (verbose) {
message("Computing nearest neighbor graph")
if (return.neighbor) {
message("Computing nearest neighbors")
} else {
message("Computing nearest neighbor graph")
}
}
nn.ranked <- NNHelper(
data = object,
Expand Down Expand Up @@ -709,6 +713,11 @@ FindNeighbors.dist <- function(
#' @param do.plot Plot SNN graph on tSNE coordinates
#' @param graph.name Optional naming parameter for stored (S)NN graph
#' (or Neighbor object, if return.neighbor = TRUE). Default is assay.name_(s)nn.
#' To store both the neighbor graph and the shared nearest neighbor (SNN) graph,
#' you must supply a vector containing two names to the \code{graph.name}
#' parameter. The first element in the vector will be used to store the nearest
#' neighbor (NN) graph, and the second element used to store the SNN graph. If
#' only one name is supplied, only the NN graph is stored.
#'
#' @importFrom igraph graph.adjacency plot.igraph E
#'
Expand Down Expand Up @@ -787,7 +796,15 @@ FindNeighbors.Seurat <- function(
if (length(x = neighbor.graphs) == 1) {
neighbor.graphs <- list(nn = neighbor.graphs)
}
graph.name <- graph.name %||% paste0(assay, "_", names(x = neighbor.graphs))
graph.name <- graph.name %||%
if (return.neighbor) {
paste0(assay, ".", names(x = neighbor.graphs))
} else {
paste0(assay, "_", names(x = neighbor.graphs))
}
if (length(x = graph.name) == 1) {
message("Only one graph name supplied, storing nearest-neighbor graph only")
}
for (ii in 1:length(x = graph.name)) {
if (inherits(x = neighbor.graphs[[ii]], what = "Graph")) {
DefaultAssay(object = neighbor.graphs[[ii]]) <- assay
Expand Down
2 changes: 2 additions & 0 deletions R/convenience.R
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ PCAPlot <- function(object, ...) {

#' @rdname SpatialPlot
#' @concept convenience
#' @concept spatial
#' @export
#'
SpatialDimPlot <- function(
Expand Down Expand Up @@ -82,6 +83,7 @@ SpatialDimPlot <- function(

#' @rdname SpatialPlot
#' @concept convenience
#' @concept spatial
#' @export
#'
SpatialFeaturePlot <- function(
Expand Down
14 changes: 9 additions & 5 deletions R/differential_expression.R
Original file line number Diff line number Diff line change
Expand Up @@ -513,14 +513,14 @@ FindMarkers.default <- function(
# feature selection (based on percentages)
alpha.min <- pmax(fc.results$pct.1, fc.results$pct.2)
names(x = alpha.min) <- rownames(x = fc.results)
features <- names(x = which(x = alpha.min > min.pct))
features <- names(x = which(x = alpha.min >= min.pct))
if (length(x = features) == 0) {
warning("No features pass min.pct threshold; returning empty data.frame")
return(fc.results[features, ])
}
alpha.diff <- alpha.min - pmin(fc.results$pct.1, fc.results$pct.2)
features <- names(
x = which(x = alpha.min > min.pct & alpha.diff > min.diff.pct)
x = which(x = alpha.min >= min.pct & alpha.diff >= min.diff.pct)
)
if (length(x = features) == 0) {
warning("No features pass min.diff.pct threshold; returning empty data.frame")
Expand All @@ -531,9 +531,9 @@ FindMarkers.default <- function(
total.diff <- fc.results[, 1] #first column is logFC
names(total.diff) <- rownames(fc.results)
features.diff <- if (only.pos) {
names(x = which(x = total.diff > logfc.threshold))
names(x = which(x = total.diff >= logfc.threshold))
} else {
names(x = which(x = abs(x = total.diff) > logfc.threshold))
names(x = which(x = abs(x = total.diff) >= logfc.threshold))
}
features <- intersect(x = features, y = features.diff)
if (length(x = features) == 0) {
Expand Down Expand Up @@ -627,6 +627,7 @@ FindMarkers.Assay <- function(
cells.1 = cells.1,
cells.2 = cells.2,
features = features,
pseudocount.use = pseudocount.use,
mean.fxn = mean.fxn,
fc.name = fc.name,
base = base
Expand Down Expand Up @@ -680,6 +681,7 @@ FindMarkers.DimReduc <- function(
min.cells.group = 3,
pseudocount.use = 1,
mean.fxn = rowMeans,
fc.name = NULL,
...

) {
Expand All @@ -705,7 +707,9 @@ FindMarkers.DimReduc <- function(
object = object,
cells.1 = cells.1,
cells.2 = cells.2,
features = features
features = features,
mean.fxn = mean.fxn,
fc.name = fc.name
)
# subsample cell groups if they are too large
if (max.cells.per.ident < Inf) {
Expand Down
20 changes: 19 additions & 1 deletion R/dimensional_reduction.R
Original file line number Diff line number Diff line change
Expand Up @@ -1654,9 +1654,27 @@ RunUMAP.Seurat <- function(
call. = FALSE
)
}
} else if (!is.null( x = nn.name)){
} else if (!is.null(x = nn.name)) {
if (!inherits(x = object[[nn.name]], what = "Neighbor")) {
stop(
"Please specify a Neighbor object name, ",
"instead of the name of a ",
class(object[[nn.name]]),
" object",
call. = FALSE
)
}
data.use <- object[[nn.name]]
} else if (!is.null(x = graph)) {
if (!inherits(x = object[[graph]], what = "Graph")) {
stop(
"Please specify a Graph object name, ",
"instead of the name of a ",
class(object[[graph]]),
" object",
call. = FALSE
)
}
data.use <- object[[graph]]
} else {
stop("Please specify one of dims, features, or graph")
Expand Down
40 changes: 21 additions & 19 deletions R/integration.R
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,8 @@ FindIntegrationAnchors <- function(
#' }
#' @param reference.reduction Name of dimensional reduction to use from the
#' reference if running the pcaproject workflow. Optionally enables reuse of
#' precomputed reference dimensional reduction.
#' precomputed reference dimensional reduction. If NULL (default), use a PCA
#' computed on the reference object.
#' @param project.query Project the PCA from the query dataset onto the
#' reference. Use only in rare cases where the query dataset has a much larger
#' cell number, but the reference dataset has a unique assay for transfer. In
Expand Down Expand Up @@ -627,25 +628,25 @@ FindTransferAnchors <- function(
if (normalization.method == "SCT") {
# ensure all residuals required are computed
query <- suppressWarnings(expr = GetResidual(object = query, assay = query.assay, features = features, verbose = FALSE))
if (is.null(x = reference.reduction)) {
reference <- suppressWarnings(expr = GetResidual(object = reference, assay = reference.assay, features = features, verbose = FALSE))
features <- intersect(
x = features,
y = intersect(
x = rownames(x = GetAssayData(object = query[[query.assay]], slot = "scale.data")),
y = rownames(x = GetAssayData(object = reference[[reference.assay]], slot = "scale.data"))
if (is.null(x = reference.reduction)) {
reference <- suppressWarnings(expr = GetResidual(object = reference, assay = reference.assay, features = features, verbose = FALSE))
features <- intersect(
x = features,
y = intersect(
x = rownames(x = GetAssayData(object = query[[query.assay]], slot = "scale.data")),
y = rownames(x = GetAssayData(object = reference[[reference.assay]], slot = "scale.data"))
)
)
)
reference[[reference.assay]] <- as(
object = CreateAssayObject(
data = GetAssayData(object = reference[[reference.assay]], slot = "scale.data")[features, ]),
Class = "SCTAssay"
)
reference <- SetAssayData(
object = reference,
slot = "scale.data",
assay = reference.assay,
new.data = as.matrix(x = GetAssayData(object = reference[[reference.assay]], slot = "data"))
reference[[reference.assay]] <- as(
object = CreateAssayObject(
data = GetAssayData(object = reference[[reference.assay]], slot = "scale.data")[features, ]),
Class = "SCTAssay"
)
reference <- SetAssayData(
object = reference,
slot = "scale.data",
assay = reference.assay,
new.data = as.matrix(x = GetAssayData(object = reference[[reference.assay]], slot = "data"))
)
}
query[[query.assay]] <- as(
Expand Down Expand Up @@ -2675,6 +2676,7 @@ TransferData <- function(
#' @rdname AnnotateAnchors
#' @export
#' @method AnnotateAnchors default
#' @concept integration
#'
AnnotateAnchors.default <- function(
anchors,
Expand Down
3 changes: 2 additions & 1 deletion R/mixscape.R
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ RunLDA.default <- function(
#'
RunLDA.Assay <- function(
object,
assay,
assay = NULL,
labels,
features = NULL,
verbose = TRUE,
Expand Down Expand Up @@ -595,6 +595,7 @@ RunLDA.Seurat <- function(
assay.data <- GetAssay(object = object, assay = assay)
reduction.data <- RunLDA(
object = assay.data,
assay = assay,
labels = labels,
features = features,
verbose = verbose,
Expand Down
Loading