This is a test version of Biostars. For the public version, visit https://www.biostars.org.
getting error when transfer labels for my scRNAseq data using FindTransferAnchors

I am trying to use FindTransferAnchorsfor label transfer. I normalized my scRNAseq data using LogNormalizeand got the reference for cell labelingfrom Azimuth. I used the following codes in R to transfer labels:

alldata <- readRDS("clustered_data.rds")
sample1<- alldata[, alldata$orig.ident == "sample1"]

reference <- readRDS('labelling_reference_azimuth/ref.Rds')
sample1 <- SetIdent(sample1, value = "CCA.0.5")

sample1 <- sample1 %>%
    NormalizeData() %>%
    FindVariableFeatures() %>%
    ScaleData() %>%
    RunPCA(verbose = F) %>%
    RunUMAP(dims = 1:30)

transfer.anchors <- FindTransferAnchors(reference = reference, query = sample1, dims = 1:30)

when I run the last command I will get this error:

Error: An SCT assay (refAssay) was provided for reference.assay but normalization.method was set as LogNormalize.

do you know how I can solve the problem?

scrnaseq

1 answer

The message is self explanatory: The reference and the query have been normalised differently. One with SCT and the other with LogNormalise.

Either use SCT when processing sample1 or set DefaultAssay of the reference to RNA.

For the second option to work, you might need to run FindVariableMarkers and LogNormalise on the reference first.

Log in to answer this question.