You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I traced it to an issue in LogSeuratCommand with parsing sys.calls(), line 12 below.
time.stamp<- Sys.time()
object<- UpdateSlots(object=object)
#capture function namewhich.frame<- sys.nframe() -1if (which.frame<1) {
stop("'LogSeuratCommand' cannot be called at the top level", call.=FALSE)
}
if (as.character(x= sys.calls()[[1]])[1] =="do.call") {
call.string<- deparse(expr= sys.calls()[[1]])
command.name<- as.character(x= sys.calls()[[1]])[2]
} else {
command.name<- as.character(x= deparse(expr= sys.calls()[[which.frame]])) #THE ISSUE IS HEREcommand.name<- gsub(
pattern="\\.Seurat",
replacement="",
x=command.name
)
call.string<-command.namecommand.name<- ExtractField(
string=command.name,
field=1,
delim="\\("
)
}
If I add a second exception for handling IntegrateData, it works normally and returns command information for IntegrateData as I would expect.
time.stamp<- Sys.time()
object<- UpdateSlots(object=object)
#capture function namewhich.frame<- sys.nframe() -1if (which.frame<1) {
stop("'LogSeuratCommand' cannot be called at the top level", call.=FALSE)
}
if (as.character(x= sys.calls()[[1]])[1] =="do.call") {
call.string<- deparse(expr= sys.calls()[[1]])
command.name<- as.character(x= sys.calls()[[1]])[2]
} elseif(as.character(x= sys.calls()[[1]])[1] =="IntegrateData") {
call.string<- deparse(expr= sys.calls()[[1]])
command.name<- as.character(x= sys.calls()[[1]])[1]
} else {
command.name<- as.character(x= deparse(expr= sys.calls()[[which.frame]]))
command.name<- gsub(
pattern="\\.Seurat",
replacement="",
x=command.name
)
call.string<-command.namecommand.name<- ExtractField(
string=command.name,
field=1,
delim="\\("
)
}
Not sure if that's the most stable or robust solution, but would it be possible to look into the issue and fix it? Happy to submit a PR if you'd like. I'm using the latest versions of Seurat (5.1.0) and SeuratObject (5.0.2). I also saw the issue when I went back to versions 5.0.1 for both packages, and using the standard NormalizeData/ScaleData/FindVariableFeatures approach instead of SCTransform.
The text was updated successfully, but these errors were encountered:
jernest1
changed the title
Bug in LogSeuratCommand when called by Seurat IntegrateData
Bug (and fix) in LogSeuratCommand when called by Seurat IntegrateData
Aug 2, 2024
When I run
Seurat
IntegrateData()
, thecommands
slot of the resultingSeurat
object containswithCallingHandlers
rather thanIntegrateData
.I traced it to an issue in
LogSeuratCommand
with parsingsys.calls()
, line 12 below.If I add a second exception for handling
IntegrateData
, it works normally and returns command information forIntegrateData
as I would expect.Not sure if that's the most stable or robust solution, but would it be possible to look into the issue and fix it? Happy to submit a PR if you'd like. I'm using the latest versions of
Seurat
(5.1.0) andSeuratObject
(5.0.2). I also saw the issue when I went back to versions 5.0.1 for both packages, and using the standard NormalizeData/ScaleData/FindVariableFeatures approach instead ofSCTransform
.The text was updated successfully, but these errors were encountered: