Nanostring-Biostats / InSituType

An R package for performing cell typing in SMI and other single cell data
Other
29 stars 11 forks source link

bug in chooseClusterNumber #89

Closed patrickjdanaher closed 2 years ago

patrickjdanaher commented 2 years ago

When chooseclusternumber uses a subset that excludes some anchors, it errors out:

nc = chooseClusterNumber(counts = t(as.matrix(raw)[setdiff(rownames(raw), evgenes), ]),
+                          neg = annot$negmean,
+                          anchors = anchors,
+                          #init_clust = init1,
+                          n_clusts = 8:15,
+                          fixed_profiles = ioprofiles.oneT,
+                          nb_size = 10,
+                          subset_size = 2000)
Clustering with n_clust = 8
iter 1
Error in `[<-`(`*tmp*`, temprows, cell, value = 1) : 
  subscript out of bounds

To fix it, make chooseClusterNumber use the same subsetting code as InsituType, and make sure all anchors get included.

patrickjdanaher commented 2 years ago

fixed