lkmklsmn / empty_nn

Learning empty droplets in scRNAseq
5 stars 2 forks source link

Input to emptyNN #3

Open Hartecky opened 1 year ago

Hartecky commented 1 year ago

Hello, just found out emptyNN tool however I am confused about the input. When I am using count matrix without transpoze (when rows are genes, are columns are cell barcodes) everything works fine. But when I will transpoze it as described here, it results in an error

Error in emptynn(t(counts)) : Please transpose counts matrix before running EmptyNN rows are barcodes, columns are genes

Am I doing something wrong, or there such an issue under the package?

Code I am using below:

counts <- as.data.frame(GetAssayData(object = seu_obj, slot = "counts"))

counts[1:5, 1:5] BM1_AAAGTCTCAAAC BM1_AAATTTCCATTG BM1_AAGGTTCCATAA BM1_ACACCGATAATG BM1_ACACGTGCGCAA A1BG 0 0 0 0 0 A1BG-AS1 0 0 0 0 0 A2M 0 0 0 0 0 A2M-AS1 0 0 0 0 0 A4GALT 0 0 0 0 0

Not working:

nn.res <- emptynn(t(counts), threshold = 100, k = 10, iteration = 5, verbose = TRUE)

Error in emptynn(t(counts)) : Please transpose counts matrix before running EmptyNN rows are barcodes, columns are genes

Working:

nn.res <- emptynn(counts, threshold = 100, k = 10, iteration = 5, verbose = TRUE) [1] "there are 5789 in P set" [1] "there are 9898 in U set" [1] "Samples in U set were split into 5 folds" [1] "data normalization" [1] "start training" [1] "iteration 1" [1] "training fold 1"

Thank you in advance for explanation!