korsunskylab / rcna

R implementation of the Reshef and Rumker CNA method (https://github.com/immunogenomics/cna)
13 stars 5 forks source link

Length zero for k argument error in association.Seurat #5

Open ewouddt opened 2 years ago

ewouddt commented 2 years ago

Thank you very much for writing this nice package to apply cna!

I am currently trying to apply the method on a Seurat dataset, but I am receiving following error on k:

data_cna1 <- association.Seurat(seurat_object = data, test_var = "COHORTcontrastNum", samplem_key = "sample", graph_use="RNA_nn")

Build NAM PCs stopping after 4 steps only one unique batch supplied to qc only one unique batch supplied to prep Perform association testing Error in if (k == max(ks)) { : argument is of length zero

Any suggestions on how to proceed?

france-hub commented 1 year ago

same error. Were you able to fix it? Thanks

ewouddt commented 1 year ago

Unfortunately not yet. This error appeared on a large dataset, but on smaller data I have not run into the error again.

davidlieb commented 1 month ago

[a couple years later...] I had the problem and discovered it was caused by NAs in the attribute I was testing. Removing the NAs fixed it.