Closed hgb1111 closed 5 years ago
Ah sorry it should be GetAssayData
instead of AssayData
. Let me know if that works!
It still did not work :/
`
AssayData(se.obj, slot = "counts") <- FilterData(GetAssayData(se.obj, slot = "counts"), min.samples.frac = 0.0025, min.nonzero.features = 200, trim = 0.0025)
could not find function "AssayData<-"
GetAssayData(se.obj, slot = "counts") <- FilterData(GetAssayData(se.obj, slot = "counts"), min.samples.frac = 0.0025, min.nonzero.features = 200, trim = 0.0025)
could not find function "GetAssayData<-"`
Are you sure you have Seurat V3 installed? Also it should be:
SetAssayData(se.obj, slot = "counts") <- FilterData(GetAssayData(se.obj, slot = "counts"), min.samples.frac = 0.0025, min.nonzero.features = 200, trim = 0.0025)
> SetAssayData(se.obj, slot = "counts") <- FilterData(GetAssayData(se.obj, slot = "counts"), min.samples.frac = 0.0025, min.nonzero.features = 200, trim = 0.0025)
#Error in SetAssayData(se.obj, slot = "counts") <- FilterData(GetAssayData(se.obj, :
could not find function "SetAssayData<-"
> packageVersion("Seurat")
[1] ‘3.0.2’
I do not think you can use the AssayData() commands in the way you have described above.
I have also tried running through the Gene Expression Quickstart with Seurat, but run into an error where the "RunSWNE" does not seem to be compatible with a seurat v3 object.
## Load object
load("/path/Ma_Vasc_6_res0.75.Robj")
obj <- Ma_Vasc_6_res0.75
## Extract clusters
clusters <- obj$seurat_clusters
## Select genes to embed
genes.embed <- c("Aplnr", "Apln", "Cryab", "Gata5", "Pi16")
## Run SWNE
swne.embedding <- RunSWNE(obj, k = 16, genes.embed = genes.embed)
Error in UseMethod("RunSWNE") :
no applicable method for 'RunSWNE' applied to an object of class "Seurat"
packageVersion("Seurat")
# ‘3.0.2’
packageVersion("swne")
# ‘0.2.21’
Ahh sorry you're right. For the filtering it should be something more like:
counts <- FilterData(GetAssayData(se.obj, slot = "counts"), min.samples.frac = 0.0025, min.nonzero.features = 200, trim = 0.0025)
se.obj <- SetAssayData(se.obj, slot = "counts", new.data = counts)
Oh so the latest version of swne should be 0.5.6. Can you try reinstalling it and see if RunSWNE
works then?
Certainly, is swne 0.5.6 only available for R version 3.6.1? I just tried installing on R 3.5.1 and R 3.5.3 and neither worked.
Thanks!
Ah sorry yeah I built it on R3.6 so I think >= R3.6.1 is necessary for installation
I updated to R version 3.6.1 (2019-07-05) -- "Action of the Toes" but am unfortunately still encountering the same error :/
install.packages("swne")
Warning in install.packages :
package ‘swne’ is not available (for R version 3.6.1)
This does not appear to be a problem with other packages (Seurat, ggplot2)
swne
is not on CRAN so you can't use install.packages. You can install it with devtools using the instructions on this github page
Ahh, that fixed the issue - my mistake for not seeing that earlier. I was able to work through swne with a seurat v3 object.
Thanks!
Great! Let me know if you have any other issues!
I ran the code you sent
AssayData(se.obj, slot = "counts") <- FilterData(AssayData(se.obj, slot = "counts"), min.samples.frac = 0.0025, min.nonzero.features = 200, trim = 0.0025)
and got the following error
Error in AssayData(se.obj, slot = "counts") : could not find function "AssayData"
I have loaded swne, Seurat, Matrix, ggplot2. what package isnt loaded?