This is a test version of Biostars. For the public version, visit https://www.biostars.org.
FindTransferAnchors error: "No features to use in finding transfer anchors" when using CELLxGENE `.h5ad` reference with Seurat

I downloaded the dataset from the study “A single-cell and spatially resolved atlas of human breast cancers” from CELLxGENE:

https://cellxgene.cziscience.com/collections/dea97145-f712-431c-a223-6b5f565f362a

Download command:

wget -c https://datasets.cellxgene.cziscience.com/0e3974a1-9488-4987-9767-21d4e389fac7.h5ad

I converted the .h5ad file into a Seurat object and attempted to use it as a reference for label transfer.

Code used:

library(Seurat)
library(sceasy)
library(schard)

# load h5ad as Seurat
reference = schard::h5ad2seurat("0e3974a1-9488-4987-9767-21d4e389fac7.h5ad")

gene_symbols <- reference@assays$RNA@meta.features$feature_name

# replace empty values
gene_symbols[gene_symbols == "" | is.na(gene_symbols)] <- rownames(reference)

# update assay matrix rownames
rownames(reference@assays$RNA@counts) <- make.unique(gene_symbols)
rownames(reference@assays$RNA@data) <- make.unique(gene_symbols)

# update Seurat object rownames
rownames(reference) <- make.unique(gene_symbols)

tma1 = readRDS("tma1_umap.rds")

anchors <- FindTransferAnchors(reference = reference, query = tma1, dims = 1:20)

However, the following error occurs:

Error: No features to use in finding transfer anchors. 
To troubleshoot, try explicitly providing features to the features parameter and ensure that they are present in both reference and query assays.

Reference object:

28468 features across 100064 cells

Query object (tma1):

18065 features across 64665 cells

Has anyone successfully used this CELLxGENE dataset as a Seurat reference for label transfer? What could be causing the FindTransferAnchors error in this case?

scanpy seurat scrnaseq findtransferanchors

From the top of my head, I think you need to normalize and find the variable genes of your dataset that will be used as anchors in FindTransferAnchors.

the data is performed with all the steps till generating seurat clusters. tma1 = readRDS("tma1_umap.rds")

What is your gene overlap between your objects ?

What assay/layer do you have in each object ?

Thanks got it. Overlap of the genes is very very less between two objects.

0 answers

No answers yet.

Log in to answer this question.