chromVAR icon indicating copy to clipboard operation
chromVAR copied to clipboard

chromVAR computeDeviations error: Error in names(res) <- nms

Open mehrankr opened this issue 4 years ago • 8 comments

Hello,

I get the following error when running

dev <- computeDeviations(object = rse, annotations = motif_mm)
Error in names(res) <- nms :
  'names' attribute [386] must be the same length as the vector [302]
In addition: Warning message:
stop worker failed:
  attempt to select less than one element in OneIndex
The 386 comes from the number of motifs, but I am confused where 302 is coming from.

Here is the output of traceback():

8: bplapply(X, FUN, ..., BPREDO = BPREDO, BPPARAM = BPPARAM)
7: bplapply(X, FUN, ..., BPREDO = BPREDO, BPPARAM = BPPARAM)
6: bplapply(peak_indices, compute_deviations_single, counts_mat = counts_mat,
       background_peaks = background_peaks, expectation = expectation)
5: bplapply(peak_indices, compute_deviations_single, counts_mat = counts_mat,
       background_peaks = background_peaks, expectation = expectation)
4: compute_deviations_core(counts(object), peak_indices, background_peaks,
       expectation, colData = colData(object), rowData = colData(annotations))
3: .local(object, annotations, ...)
2: computeDeviations(object = rse, annotations = motif_mm)
1: computeDeviations(object = rse, annotations = motif_mm)

Here is the information about my objects:

> motif_mm
class: RangedSummarizedExperiment
dim: 4446140 386
metadata(0):
assays(1): motifMatches
rownames: NULL
rowData names(2): name bias
colnames(386): MA0025.1_NFIL3 MA0030.1_FOXF2 ... MA0909.1_HOXD13
  MA0914.1_ISL2
colData names(1): name
> rse
class: RangedSummarizedExperiment
dim: 4446140 26263
metadata(0):
assays(1): counts
rownames: NULL
rowData names(2): name bias
colnames(26263): AAACGAATCGCATACA-1 AAACGAATCGTCCCAT-1 ...
  TTTGTGTTCCCAGCAG-1 TTTGTGTTCTCGACCT-1
colData names(2): Cell_Type depth

And here is the session info:

R version 4.0.2 (2020-06-22)
Platform: x86_64-conda_cos6-linux-gnu (64-bit)
Running under: Ubuntu 18.04.4 LTS
other attached packages:
 [1] JASPAR2016_1.16.0                 BSgenome.Hsapiens.UCSC.hg38_1.4.3
 [3] BSgenome_1.56.0                   rtracklayer_1.48.0
 [5] Biostrings_2.56.0                 XVector_0.28.0
 [7] SummarizedExperiment_1.18.2       DelayedArray_0.14.1
 [9] matrixStats_0.56.0                Biobase_2.48.0
[11] motifmatchr_1.10.0                chromVAR_1.10.0
[13] SnapATAC_1.0.0                    rhdf5_2.32.2
[15] Matrix_1.2-18                     Seurat_3.2.0
[17] GenomicRanges_1.40.0              GenomeInfoDb_1.24.2
[19] IRanges_2.22.2                    S4Vectors_0.26.1
[21] BiocGenerics_0.34.0               RColorBrewer_1.1-2
[23] scales_1.1.1                      reshape2_1.4.4
[25] ggplot2_3.3.2

Would appreciate any feedback.

All the best, Mehran

mehrankr avatar Jul 20 '20 13:07 mehrankr

This happens because of bplapply. When I modified bplapply with lapply, although it's not parallel and it took ages, the error didn't occur.

mehrankr avatar Jul 21 '20 14:07 mehrankr

Hello, I encountered the same error as you. But what do you mean by "modified bplapply with lapply"? How do I use lapply to modify bplapply? Look forward to your reply. Many Thanks.

zhaoliyang0429 avatar Oct 26 '20 13:10 zhaoliyang0429

Instead of calling the function, I executed each line of the source code and whenever the bplapply parts were encountering errors, I siwtched them with lapply. You can also use mclapply to use multiple cores instead. Good luck!

mehrankr avatar Oct 26 '20 13:10 mehrankr

Thank you for your help. But after I modified bplapply with lapply, it turned out a new error: Error in isVirtualExt(exti) : trying to get slot "virtual" from an object of a basic class ("NULL") with no slots Do you know what does it mean? Thanks again.

zhaoliyang0429 avatar Oct 28 '20 06:10 zhaoliyang0429

Not really. I had these issues when I was using SnapATAC and running chromVAR on snapATAC output. Probably these errors are all due to differing versions of packages. I switched to ArchR and didn't have these kinds of errors again. It runs chromVAR smoothly too.

mehrankr avatar Oct 28 '20 13:10 mehrankr

Yes, this problem occurred when I used SnapATAC's runChromVAR function. Thank you very much for your reply. I will also try ArchR.

zhaoliyang0429 avatar Oct 29 '20 04:10 zhaoliyang0429

Yes, this problem occurred when I used SnapATAC's runChromVAR function. Thank you very much for your reply. I will also try ArchR.

the same with ArchR

liaoshengyou avatar Nov 22 '20 06:11 liaoshengyou

The error "Error in isVirtualExt(exti) :" comes from the attached library-conflict between snapATAC/ArchR and chromVAR. Starting new R session just loading chromVAR solved the problem.

sckinta avatar Jul 20 '21 13:07 sckinta