GreenleafLab / ArchR

ArchR : Analysis of Regulatory Chromatin in R (www.ArchRProject.com)
MIT License
388 stars 140 forks source link

error with GetMarkerFeatures after subsetting #1547

Closed yamihn closed 2 years ago

yamihn commented 2 years ago

Hello, I subsetted my object and I performed the integration with scRNAseq, then I called the peaks, but, when I was trying to find the markers from peak matrix, I got this error:

markersPeaks_int <- getMarkerFeatures( ArchRProj = archr, useMatrix = "PeakMatrix", groupBy = "predictedGroup", #clusters found after integration bias = c("TSSEnrichment", "log10(nFrags)"), testMethod = "wilcoxon" ) ArchR logging to : ArchRLogs/ArchR-getMarkerFeatures-9a447e451dd-Date-2022-08-09_Time-14-21-49.log If there is an issue, please report to github with logFile! 2022-08-09 14:40:42 : Matching Known Biases, 0.006 mins elapsed. 2022-08-09 14:40:43 : Found less than 100 cells for background matching, Lowering k to 0 Errore in nabor::knn(data = data, query = query, k = k, ...) : Cloud has no points

ArchR-getMarkerFeatures-9a446eeef2a-Date-2022-08-09_Time-14-21-49.log

When I do the analysis with the whole archr object, it works fine

rcorces commented 2 years ago

Hi @yamihn! Thanks for using ArchR! Please make sure that your post belongs in the Issues section. Only bugs and error reports belong in the Issues section. Usage questions and feature requests should be posted in the Discussions section, not in Issues.
Before we help you, you must respond to the following questions unless your original post already contained this information: 1. If you've encountered an error, have you already searched previous Issues to make sure that this hasn't already been solved? 2. Can you recapitulate your error using the tutorial code and dataset? If so, provide a reproducible example. 3. Did you post your log file? If not, add it now. 4. Remove any screenshots that contain text and instead copy and paste the text using markdown's codeblock syntax (three consecutive backticks). You can do this by editing your original post.

rcorces commented 2 years ago

It looks like you have subsetted your project in such a way that some or many of the groups indicated by predictedGroup have fewer than 100 cells in them and this is causing failure.

yamihn commented 2 years ago

yes, I have subsetted the archr project removing half of cells in the way of retain only the ones in common with my scRNAseq object from Seurat. I saw that groups C12 and C13 are the problem, but in Seurat these groups are the smaller ones, and I don't them anyway. My idea is to remove this groups from getmarkersfeatures using the parameter useGroup=.

rcorces commented 2 years ago

you may also need to remove these problematic groups from the background groups via bgdGroups

yamihn commented 2 years ago

Ok, but if I only set useGroup, without setting the background, It Will perform a differential Analysis using only the group choosen? I don't want to compare specific clusters, I Need Just to find the markers of selected ones

rcorces commented 2 years ago

I was mistaken before. you only need to set useGroups. If you dont set bgdGroups, it will be set to the same groups as useGroups. The function will identify marker features for all of the groups in useGroups.