Closed ccruizm closed 3 years ago
Hi ccruizm,
Thanks for using the tool!
I assume this issue might be related to your cluster annotations - Squidpy seems a bit picky about this. Perhaps, if you share them I can check on my side.
Thanks for the quick reply!
These are the cluster names I am using:
'AC-like','MES-like','OPC-like','NPC-like', 'Astrocyte','Oligodendrocyte','OPC','RG','Neuron','Mono','TAM-BDM','TAM-MG','DC',
'CD4/CD8','Reg. T','Prolif. T','NK','B cell','Plasma B','Mast','Pericyte','Endothelial'
I have run sq.pl.ligrec
using the same cell annotation and didn't encounter any issue. But this was loading the data directly in Scanpy running a python kernel. Maybe there is an issue using reticulate? Let me know if you need anything else I can provide to troubleshoot this part.
Thanks!
Hi,
I think it's related to the way that call_squidpy obtains the annotations (I got the same error when I did not appropriately set the Idents in Seurat).
Please try setting the idents in Seurat to an existing column in the metadata (e.g. Idents(seurat_object) <- metadata[[column]])
, or alternatively pass the appropriate name to the cluster column to squidpy /w cluster_key = "column"
.
I hope it works!
Hello!
Thanks for the suggestion. I have tried both but get the next error:
Error in UseMethod("select"): no applicable method for 'select' applied to an object of class "character"
Traceback:
1. call_squidpy(reference, op_resource = select_resource("OmniPath")[[1]],
. .seed = 1004)
2. map(op_resource, function(x) x %>% select(uniprot_source = source,
. unprot_target = target, source = source_genesymbol, target = target_genesymbol,
. category_intercell_source, category_intercell_target)) %>%
. unname()
3. unname(.)
4. map(op_resource, function(x) x %>% select(uniprot_source = source,
. unprot_target = target, source = source_genesymbol, target = target_genesymbol,
. category_intercell_source, category_intercell_target))
5. .f(.x[[i]], ...)
6. x %>% select(uniprot_source = source, unprot_target = target,
. source = source_genesymbol, target = target_genesymbol, category_intercell_source,
. category_intercell_target)
7. select(., uniprot_source = source, unprot_target = target, source = source_genesymbol,
. target = target_genesymbol, category_intercell_source, category_intercell_target)
The commands I am using are:
call_squidpy(seu_obj,
op_resource = select_resource('OmniPath')[[1]],
cluster_key = 'celltype_squidpy',
.seed = 1004)
or
Idents(seu_obj) <- seu_obj[['celltype_squidpy']]
call_squidpy(seu_obj,
op_resource = select_resource('OmniPath')[[1]],
.seed = 1004)
Hopefully, we can figure out where the problem is. Thanks!
Hi Christian,
I think in this case, it's an inconsistency that I fixed recently. Squidpy used to take a list as op_resource
, so you should run it as:
call_squidpy(seu_obj, op_resource = select_resource('OmniPath'), .seed = 1004)
I have changed this in one of the latest commits to the master branch, but this should also work.
Regards, Daniel
It works now! thanks for your help!!!
Seeing that this is a reoccurring issue, I will implement an informative error message when this happens.
Good day,
Thanks for developing this tool. I am trying to use squidpy but got the error below, either calling the function independently
call_squidpy
or withinliana_wrap
:Other tools work as expected (have tested connectome and cellchat). Any idea where the problem might be?
Thanks in advance!
My session info: