Closed getanid123 closed 4 years ago
Hi,
thanks for your interest in kBET. For troubleshooting, you can set verbose=TRUE
. Your problem is that you have very few cells and thus, the neighbourhood size k0
is lower than 10.
I introduced a check of the input neighbourhood size:
if (k0 < 10) {
if (verbose){
warning(
"Your dataset has too few samples to run a heuristic.\n",
"Return NA.\n",
"Please assign k0 and set heuristic=FALSE."
)
}
return(NA)
Actually, I test for it twice:
if (k0 < 10 & is.null(knn)) {
if (verbose){
warning(
"Your dataset has too few samples to run a heuristic.\n",
"Return NA.\n",
"Please assign k0 and set heuristic=FALSE."
)
}
return(NA)
}
You may adapt the function such that it ignores the small k0
, but I am not sure if the results are reasonable.
Hi mbuttner,
Thank you so much for your help and insight.
As per your suggestion, I changed k0 to 10 and the program ran like before without errors, but there was no output. The verbose=TRUE is already set, but I do not see any messages when I run in R?
Thanks for your time in advance!!
Hi,
what does the call
test_result <- kBET(df=df, batch=batch)
return?
Hi
Thank you so much for getting back and sorry for the delay in responding. I tried the call you mentioned and another call using FNN library, Please find the details below:
library(devtools) install_github('theislab/kBET',force = TRUE) library(kBET) scdata<-read.csv("counts.txt", skip=1,row.names = 1, header=FALSE, sep='\t') df<- t(scdata) batch<-factor (c(1,1,1,1,1,1,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3)) test_result <- kBET(df=df, batch=batch) test_result --->[the result was NA]
When I tried along with FNN library I got the result below: library(devtools) install_github('theislab/kBET',force = TRUE) scdata<-read.csv("counts.txt", skip=1,row.names = 1, header=FALSE, sep='\t') df<- t(scdata) batch<-factor (c(1,1,1,1,1,1,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3)) library('FNN') k0=6 knn <- get.knn(df, k=k0, algorithm = 'cover_tree') batch.estimate <- kBET(df, batch, k = k0, knn = knn, heuristic = FALSE) ---> I got a Rejection rate plot. Rplot.pdf
OK, the batch.estimate
variable contains the result of kBET that you are looking for.
Yes, got it. Thank you!!
Hi I am trying out kBET for my counts data from alignment for three single cell RNA seq batches with [6,8,17cells] respectively. I used the following Code and it executed perfectly without any errors [ after I troubleshooted previous errors I faced using some answered issues]. But I am not able to generate any output file. Can you please help as I want to know how the batch corrected files can be obtained? Thanks so much for your time and in advance!!
session_info_kbet.docx