Closed wht10 closed 3 years ago
Hi,
Not member of dev team but hopefully can be helpful. merge
is in SeuratObject package so need to call that in code instead of Seurat SeuratObject::merge
Also unless you have another package with merge
function that is masking SeuratObject no need for ::
at all as SeuratObject is attached by default when loading Seurat.
Best, Sam
Hey Sam,
Thanks for pointing that out, but it still returns the same error. I am explicitly defining the package because I wanted to show it wasn't a package overlap issue.
`` library(Seurat) pbmc_small <- pbmc_small SeuratData::InstallData("pbmc3k") data("pbmc3k") SeuratObject::merge(pbmc_small,pbmc3k, add.cell.ids = c("small","3K"))
Hey Sam,
Thanks for pointing that out. I still get the same error when I specify the SeuratObject package. I am explicitly using the SeuratObject package to show it isn't a package overlap issue.
library(Seurat)
pbmc_small <- pbmc_small
SeuratData::InstallData("pbmc3k")
data("pbmc3k")
SeuratObject::merge(pbmc_small,pbmc3k, add.cell.ids = c("small","3K"))
Error: 'merge' is not an exported object from 'namespace:SeuratObject'
lsf.str("package:SeuratObject")
%||% : function (x, y)
%iff% : function (x, y)
AddMetaData : function (object, metadata, col.name = NULL)
as.Graph : function (x, ...)
as.Neighbor : function (x, ...)
as.Seurat : function (x, ...)
as.sparse : function (x, ...)
Assays : function (object, slot = NULL)
AttachDeps : function (deps)
Cells : function (x)
CellsByIdentities : function (object, idents = NULL, cells = NULL, return.null = FALSE)
CheckGC : function (option = "SeuratObject.memsafe")
colMeans : Formal class 'standardGeneric' [package "methods"] with 8 slots
colSums : Formal class 'standardGeneric' [package "methods"] with 8 slots
Command : function (object, ...)
CreateAssayObject : function (counts, data, min.cells = 0, min.features = 0, ...)
CreateDimReducObject : function (embeddings = new(Class = "matrix"), loadings = new(Class = "matrix"), projected = new(Class = "matrix"),
assay = NULL, stdev = numeric(), key = NULL, global = FALSE, jackstraw = NULL,
misc = list())
CreateSeuratObject : function (counts, project = "CreateSeuratObject", assay = "RNA", names.field = 1, names.delim = "_",
meta.data = NULL, ...)
DefaultAssay : function (object, ...)
DefaultAssay<- : function (object, ..., value)
Distances : function (object, ...)
Embeddings : function (object, ...)
FetchData : function (object, vars, cells = NULL, slot = "data")
GetAssayData : function (object, slot, ...)
GetImage : function (object, mode = c("grob", "raster", "plotly", "raw"), ...)
GetTissueCoordinates : function (object, ...)
Graphs : function (object, slot = NULL)
HVFInfo : function (object, selection.method, status = FALSE, ...)
Idents : function (object, ...)
Idents<- : function (object, ..., value)
Images : function (object, assay = NULL)
Index : function (object, ...)
Index<- : function (object, ..., value)
Indices : function (object, ...)
IsGlobal : function (object, ...)
IsMatrixEmpty : function (x)
IsS4List : function (x)
JS : function (object, ...)
JS<- : function (object, ..., value)
Key : function (object, ...)
Key<- : function (object, ..., value)
ListToS4 : function (x)
Loadings : function (object, ...)
Loadings<- : function (object, ..., value)
LogSeuratCommand : function (object, return.command = FALSE)
Misc : function (object, ...)
Misc<- : function (object, ..., value)
Neighbors : function (object, slot = NULL)
Project : function (object, ...)
Project<- : function (object, ..., value)
Radius : function (object)
Reductions : function (object, slot = NULL)
RenameAssays : function (object, ...)
RenameCells : function (object, ...)
RenameIdents : function (object, ...)
ReorderIdent : function (object, var, ...)
rowMeans : Formal class 'standardGeneric' [package "methods"] with 8 slots
RowMergeSparseMatrices : function (mat1, mat2)
rowSums : Formal class 'standardGeneric' [package "methods"] with 8 slots
S4ToList : function (object)
SetAssayData : function (object, slot, new.data, ...)
SetIdent : function (object, ...)
show : Formal class 'standardGeneric' [package "methods"] with 8 slots
SpatiallyVariableFeatures : function (object, selection.method, ...)
StashIdent : function (object, save.name, ...)
Stdev : function (object, ...)
SVFInfo : function (object, selection.method, status, ...)
Tool : function (object, ...)
Tool<- : function (object, ..., value)
UpdateSeuratObject : function (object)
VariableFeatures : function (object, selection.method = NULL, ...)
VariableFeatures<- : function (object, ..., value)
Version : function (object, ...)
WhichCells : function (object, ...)
Hi,
I would first try restarting R and loading Seurat again.
then I would replace this in code as I also just realized the merge you have there isn’t saving back to environment.
merged_obj <- merge(pbmc_small,pbmc3k, add.cell.ids = c("small","3K"))
let me know if that works.
best, Sam
Hey Sam,
It still returns the same error.
library(Seurat)
pbmc_small <- pbmc_small
SeuratData::InstallData("pbmc3k")
data("pbmc3k")
pbmc3k <- pbmc3k.SeuratData::pbmc3k
merged_obj <- SeuratObject::merge(pbmc_small,pbmc3k, add.cell.ids = c("small","3K"))
Error: 'merge' is not an exported object from 'namespace:SeuratObject'
Try without the ::
call.
Due to the way in which merge function in SeuratObject functions
merge
is a function in base R, not Seurat. We define a custom merge method for the Seurat
object class, but the function that's being called first is the function from base R not Seurat. Removing the ::
will solve this issue.
Yes what @timoast said. Brain broke when I said to use SeuratObject:: at first.
I believe the merge function may not be present in Seurat version 4.0.4, which I just freshly installed.