Open vertesy opened 7 months ago
Hi Abel,
Not member of dev team but hopefully can be helpful. I don't know that this is actually an error in FetchData
. FetchData
will not return anything with FetchData(object = obj, vars = "UMAP_1")
if the object does not have a reduction with "UMAP" as key in dimreducs. So that isn't actually returning "meaningless" values but rather the values that it is supposed to return.
test <- FetchData(object = pbmc_small, vars = "UMAP_1")
Error in `FetchData()`:
! None of the requested variables were found: UMAP_1
Run `rlang::last_trace()` to see where the error occurred.
I don't know that there is a way to make that "safe" other than for the user to to know the keys and dimreducs of their object before calling functions.
Also it would seem safer way to get info for what you seem to be looking for to simply retrieve the embeddings user the provided accessor function (Embeddings
) for which you specify the reduction name and will come with the appropriate dim names. This ensures the correct reduction is accessed and correct dimnames and embeddings are returned.
Also just curious how do you get NAs from DiscretePalette
? That isn't something I've ever encountered.
Best, Sam
Hi Sam, thanks for your response, I will try to better explain my original post, but I think you are not referring to a situation that I described.
Dear Seurat Team,
I used
FetchData(object = obj, vars = "UMAP_1")
to retrieve UMAP coordinates inSeurat.utils::AutoNumber.by.UMAP()
.This worked until Seurat v5. After Seurat v5 it still executed without a warning, but the coordinates returned did not correspond to the umap plotted.
What happens?
UMAP_1
got renamed toumap_1
, in@reductions$umap
FetchData
now silently returnsUMAP_1
fromobj@reductions$ref.umap
instead fromobj@reductions$umap
.ref.umap
, and getting values from it is very unexpected when asking for a umap coordinate. I needed to look through 2MB of "str(obj)" output to get this info.FetchData
, bc I rather break the code then get meaningless values to figure out much later.Solutions
break early
.?FetchData
to use as:pc1 <- FetchData(object = pbmc_small, vars = 'PC_1')
, bc apparently you would need to specify thePCA
slot to be sure what to get.Seurat
, where sth is returned without message/warning/error, so this is also a general request to increase prudency. See example: NA values inDiscretePalette
needed to be handled by quick and dirtySeurat.utils::DiscretePaletteSafe()
.Thank you for your time sharing and maintaining the code. Abel