azimuth
azimuth copied to clipboard
Error 'could not find function "Key<-"' when using docker
Hi, I followed the introduction of running the app using Docker. In which I git clone the repo and use "docker build -t azimuth ." to create the docker image. I also followed the step of "docker run -it -p 3838:3838 -v /path/to/reference:/reference-data:ro azimuth" to mount the reference to the container. However, when I open the webpage of the app, this error appeared and the webpage turned grey.
> Azimuth::AzimuthApp(reference='/reference-data')
Registered S3 method overwritten by 'SeuratDisk':
method from
as.sparse.H5Group Seurat
Attaching shinyBS
Loading required package: shiny
Listening on http://0.0.0.0:3838
Warning: Overwriting miscellanous data for model
Warning: Adding a dimensional reduction (refUMAP) without the associated assay being present
Warning: Error in <-: could not find function "Key<-"
47: GetPlotRef.AzimuthData
45: LoadReference
41: server
4: runApp
1: Azimuth::AzimuthApp
Error in Key(plotref) <- gsub("\\.", "", Key(plotref)) :
could not find function "Key<-"
Any idea how to fix this? Thank you so much!!
@qianxuans,
I am having also the same issue, when running azimuth inside a Rmd:
future_2 <- future({
set.seed(12345678)
mydata <- RunAzimuth(mydata, reference = '/annotation_pipeline/')
saveRDS(mydata, paste0(tools::file_path_sans_ext(basename(file_name)), '_Azimuth_annotated.rds'))
l=list()
l[[1]]=mydata[["prediction.score.annotation"]]
l[[2]]=subset([email protected], select=c('predicted.annotation','predicted.annotation.score'))
l
})
Quitting from lines at lines 51-197 [runPipeline] (annotation.Rmd)
Error in `Key(plotref) <- gsub("\\.", "", Key(plotref))`:
! could not find function "Key<-"
Backtrace:
1. future::value(future_2)
2. future:::value.Future(future_2)
3. future:::signalConditions(...)
The same chunk of code work inside the R console though. The error suggest Seurat library is not properly loaded but inside that Rmd I am using other Seurat function without errors. Does anyone have a clue?
Best, Andy
The Key function is exported from R package SeuratObject. So I think you should library(Seurat)
before RunAzimuth
. (At least it works for me)