welch-lab / liger

R package for integrating and analyzing multiple single-cell datasets
GNU General Public License v3.0
392 stars 78 forks source link

Error when performing the Wilcoxon test on the peak counts #312

Open zhangyz1997 opened 6 months ago

zhangyz1997 commented 6 months ago

Hello everyone. Thank you for the excellent tool that integrates multiple modalities. I am attempting to identify marker peaks across various clusters by following the section "Inferring linkage between ATAC and RNA data" in the vignette and executing the corresponding code. runWilcoxon(int.bmmc, useDatasets = "atac", usePeak = TRUE) It threw out error "unused arguments (useDatasets = "atac", usePeak = TRUE)". When I tried using runMarkerDEG instead runMarkerDEG(int.bmmc, useDatasets = "atac", usePeak = TRUE) It threw out error: Error in match.arg(slot) : 'arg' should be one of “rawData”, “normData”, “scaleData”, “scaleUnsharedData”, “H”, “V”, “U”, “A”, “B”, “W”, “H.norm” Calls: runMarkerDEG -> .runDEG -> getMatrix -> getMatrix -> match.arg So how could we complete the marker identification step?

mvfki commented 6 months ago

Hi Yuanzhe,

It looks like a bug from a rare case that we failed to pay attention to in our tests. Thanks for pointing it out and we will get it fixed ASAP.

Currently, I can share you some work around for this issue:

# You can include as many other datasets to use here
peakDatasets <- c("atac") 
# Extract `ligerDataset` class objects requested
datasetObjList <- datasets(int.bmmc)[peakDatasets]
# Extract the peak matrices
# Make sure these datasets are of "atac" modality so it has the slots, otherwise it'll show you an error
rawPeakList <- lapply(datasetObjList, slot, "rawPeak")
peakLiger <- createLiger(rawPeakList)
peakLiger <- normalize(peakLiger)

# Transfer the cluster labels from the original object to the new temporary object for marker calling
peakLiger$cluster <- cellMeta(int.bmmc, "leiden_cluster", useDatasets = "atac")
defaultCluster(peakLiger) <- "cluster"

# It should work this time to run marker detection now
markerTable <-  runMarkerDEG(peakLiger)

Hope this works for you! Please feel free to reach out if there's still any issues.

Best, Yichen