Skip to content

NAs in wnn matrix using Trex embedding + pca #24

Description

@LinearParadox

Code is as follows:

seur <- runTrex(seur, 
                       chains = "TRA", 
                       method = "encoder", 
                       encoder.model = "VAE", 
                       encoder.input = "AF",
                       reduction.name = "Trex_tra")
seur <- NormalizeData(seur) %>% 
  FindVariableFeatures() %>% 
  quietTCRgenes() %>% 
  ScaleData() %>% 
  RunPCA(verbose = FALSE)
seur <- FindMultiModalNeighbors(seur, 
                                     reduction.list = list("pca", "Trex_trb"), 
                                     dims.list = list(1:50, 1:30), 
                                     modality.weight.name = c("RNA.weight", "TRb_weight"))
seur <- RunUMAP(seur, nn.name = "weighted.nn", 
                reduction.name = "wnn.umap", 
                reduction.key = "wnnUMAP_") #error

I get the error:

00:01:41 UMAP embedding parameters a = 0.9922 b = 1.112
00:01:42 Commencing smooth kNN distance calibration using 1 thread with target n_neighbors = 20
00:01:43 7293 smooth knn distance failures

When I inspect the wnn matrix, using

table(Distances(object = seur[["weighted.nn"]]) %in% "NaN")

I get:

 FALSE   TRUE 
953340   2760 

I'm not sure why I'm getting NaN distances in seurat. I inspected both PCA and TREX embeddings for null values but didn't see any.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions