seurat icon indicating copy to clipboard operation
seurat copied to clipboard

Error while running FindTransferAnchors on Seurat V5

Open melodyyazdi opened this issue 10 months ago • 1 comments

Hi! I am trying to run FindTransferAnchors on my single cell object(day14og) and my spatial object(day14controlspatial). It keeps on giving the following error;

< anchors <- FindTransferAnchors(reference = day14og, query = day14controlspatial) 
Performing PCA on the provided reference using 12 features as input.
Warning in irlba(A = t(x = object), nv = npcs, ...) :
  You're computing too large a percentage of total singular values, use a standard svd instead.
Warning in irlba(A = t(x = object), nv = npcs, ...) :
  did not converge--results might be invalid!; try increasing work or maxit
Projecting cell embeddings
Error in (function (cond)  : 
  error in evaluating the argument 'x' in selecting a method for function 't': subscript out of bounds >

I ran the following commands before running the FindTransferAnchors.

day14og <- CreateSeuratObject(counts = day14og, project = "day14original")
day14og <- NormalizeData(day14og, normalization.method = "LogNormalize")
day14og <- FindVariableFeatures(day14og, selection.method = "vst", nfeatures = 2000)
all.genes <- rownames(day14og)
day14og <- ScaleData(day14og, features = all.genes)
day14og <- RunPCA(day14og)
day14og <- FindNeighbors(day14og, dims = 1:30)
day14og <- FindClusters(day14og, resolution = 0.5)
day14og <- RunUMAP(day14og, dims = 1:30)

#spatial 
day14controlspatial <- Load10X_Spatial('day14spatial',
                                       filename = `"sampleb2filtered_feature_bc_matrix.h5",`
                                       assay = "Spatial",
                                       slice = "slice1",
                                       filter.matrix = TRUE,
                                       to.upper = FALSE,
                                       image = NULL,)
day14controlspatial <- NormalizeData(day14controlspatial, normalization.method = "LogNormalize")
day14controlspatial <- FindVariableFeatures(day14controlspatial, selection.method = "vst", nfeatures = 2000)
all.genesspatial <- rownames(day14controlspatial)
day14controlspatial <- ScaleData(day14controlspatial, features = all.genesspatial)
day14controlspatial <- RunPCA(day14controlspatial)
day14controlspatial <- FindNeighbors(day14controlspatial, dims = 1:30)
day14controlspatial <- FindClusters(day14controlspatial, resolution = 0.5)
day14controlspatial <- RunUMAP(day14controlspatial, dims = 1:30)

I have been stuck on this problem for some time. Any help would be greatly appreciated. Thank you!

melodyyazdi avatar Apr 19 '24 04:04 melodyyazdi

Hi, can you show the outputs if you just run day14og and day14controlspatial? The error message shows that you have 12 features in your reference, which seems odd.

igrabski avatar Apr 25 '24 19:04 igrabski

Hi @melodyyazdi ,

Thank you for reaching out! We’re always grateful when folks take the time to help make Seurat better 🙂

Unfortunately, with the details provided, we cannot reproduce your issue. To help us better understand and resolve this issue, please ensure that you provide the following information when reporting a bug:

  1. Describe your issue:

    • A clear and concise description of what the bug is — avoid just pasting in the error message.
  2. Reproducing Code Example:

    • Provide a minimal reproducible example that demonstrates the issue using one of the datasets available through SeuratData. Paste the code in a code block.
    • The code example should make use of pbmc_small or one of the datasets available through SeuratData.
  3. Error Message:

    • If any, paste the full error message (starting from line Traceback) in a code block.
    • If no error is raised, consider writing a simple test case that explicitly raises an error if the
  4. System Information:

    • Run sessionInfo() and paste the result in a code block.

We’re going to go ahead and close this issue for now, but once you’ve gathered these details, we strongly encourage you repost and we will be more than happy to help you resolve the problem.

dcollins15 avatar Jun 24 '24 15:06 dcollins15