-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Getting error in buildNhoodGraph #350
Comments
Hi, Even with smaller dataset I get the same error: small_traj_milo <- traj_milo[1:1000, ]
Any help would be appreciated! |
Always provide the output of sessionInfo() and the code leading up to the point of the error. |
Yes Sir. Sorry for my bad! Here is the the code: combined_seurat_obj <- NormalizeData(combined_seurat_obj) thy.sce <- as.SingleCellExperiment(combined_seurat_obj) traj_milo <- buildGraph(traj_milo, k = 4, d = 40) thy.design <- data.frame(colData(traj_milo))[,c("orig.ident", "disease_status")] thy.design <- thy.design[colnames(nhoodCounts(traj_milo)), , drop=FALSE] contrast.1 <- "disease_statusYes" thy.design$disease_status <- factor(thy.design$disease_status, levels = c("No", "Yes")) da_results <- testNhoods(traj_milo, design = ~ disease_status, design.df = thy.design, small_traj_milo <- traj_milo[1:1000, ] traj_milo <- buildNhoodGraph(traj_milo) #####################
####################### Here is the sessionInfo sessionInfo() Matrix products: default locale: time zone: Etc/UTC attached base packages: other attached packages: loaded via a namespace (and not attached): |
Firstly, a k=4 is extremely small for building a kNN-graph given you have >700k cells. You are then using a different value for k in the nhood definition, so you most likely don't have many connections between your cells. Inspect your nhoodSize histogram and aim for ~5xS, where S is the number of experimental samples, OR a median nhood size of ~100 if you have lots of samples, i.e. >20. Secondly, subsetting the Milo object on the rows, subsets on the genes, not the cells. |
Can you run the following code without error:
|
Unfortunately no! Got the same error as before: nh_intersect_mat <- miloR:::.build_nhood_adjacency(nhoods(traj_milo)) Error in if (any(i < 0L)) { : missing value where TRUE/FALSE needed |
Dear Mike, Thanks a lot in advance. |
How many nhoods do you have in this object, and what is the provenance of the data? |
Hi,
I am getting an error while using the buildNhoodGraph function. The error is
Error in if (any(i < 0L)) { : missing value where TRUE/FALSE needed
In addition: Warning message:
In int2i(as.integer(i), n) : NAs introduced by coercion to integer range
However, there is no NA in the object:
any(is.na(reducedDim(traj_milo)))
[1] FALSE
These are the properties of the object:
dim(traj_milo)
[1] 12136 732835
all(colnames(nhoodCounts(traj_milo)) %in% rownames(thy.design))
[1] TRUE
Could anyone help me with this? The size of the dataset could be a problem?
Thanks a lot for your kind help in advance.
The text was updated successfully, but these errors were encountered: