Error when running getPeakMatrix
nadine-ships opened this issue · 7 comments
Hi,
I am trying convert an ArchR project to a Seurat object.
However, when I run pkm <- getPeakMatrix(test), I get the following error:
[1] "In Progress:"
[1] "Get Matrix From ArchRProject"
ArchR logging to : ArchRLogs/ArchR-getMatrixFromProject-1512966a1b01f-Date-2023-08-02_Time-13-31-04.log
If there is an issue, please report to github with logFile!
2023-08-02 13:31:21 : Organizing colData, 0.291 mins elapsed.
2023-08-02 13:31:21 : Organizing rowData, 0.293 mins elapsed.
2023-08-02 13:31:21 : Organizing rowRanges, 0.293 mins elapsed.
2023-08-02 13:31:21 : Organizing Assays (1 of 1), 0.293 mins elapsed.
2023-08-02 13:31:21 : Constructing SummarizedExperiment, 0.295 mins elapsed.
2023-08-02 13:31:23 : Finished Matrix Creation, 0.319 mins elapsed.
Error in (function (classes, fdef, mtable) :
unable to find an inherited method for function ‘seqnames’ for signature ‘"NULL"’
Do you know what might be causing this error?
Thanks,
Nadine
Hello @nadine-ships, Thanks for using the ArchRtoSignac package. It's a bit hard to interpret what caused this error with only this step. Would you mind sharing your code starting from creating ArchRProject? This will help me to better understand the problem. Thank you!
Hello! @nadine-ships and I are coworkers and we followed the ArchR documentation verbatim (also pasted below).
What data or data column is being used for "seqnames"? Perhaps the name of the data column is different than what ArchRtoSignac is trying to recognize for "seqnames"?
Code:
Project <- ArchRProject(
ArrowFiles = ArrowFiles,
outputDirectory = "scATAC",
copyArrows = TRUE
)
Project <- filterDoublets(ArchRProj = Project)
Project <- addClusters(
input = Project,
reducedDims = "IterativeLSI",
method="Seurat",
name="Clusters",
resolution=0.8,
force=TRUE
)
Project <- addGroupCoverages(ArchRProj = Project, groupBy = "Clusters",force=TRUE)
pathToMacs2 <- # path to Macs2
Project <- addReproduciblePeakSet(
ArchRProj = Project,
groupby = "Clusters",
peakMethod = "Macs2",
pathToMacs2 = pathToMacs2,
force=TRUE
)
Project <- addPeakMatrix(Project)
@nadine-ships and @libell1, seqnames()
is a function also used by the function in ArchR. Let's break down this getPeakMatrix()
step by step to find out where your error is coming from.
But please run the following code:
I would like to see what matrix you have first.
getAvailableMatrices(your_ArchRProject)
Get peak matrix
peak_matrix <- ArchR::getMatrixFromProject(your_ArchRProject, useMatrix='PeakMatrix')
pm <- assays(peak_matrix)$PeakMatrix # peaks sparse martix
Formating
rownames(pm) <- paste0(as.character(seqnames(your_ArchRProject@peakSet)), '-', as.character(start(your_ArchRProject@peakSet)), '-', as.character(end(your_ArchRProject@peakSet)))
Thank you for you help!
getAvailableMatrices(my_ArchRproject)
[1] "GeneScoreMatrix" "PeakMatrix" "TileMatrix"
peak_matrix <- ArchR::getMatrixFromProject(my_ArchRproject, useMatrix='PeakMatrix')
ArchR logging to : ArchRLogs/ArchR-getMatrixFromProject-13e7e121ce483-Date-2023-08-04_Time-13-27-41.log
If there is an issue, please report to github with logFile!
2023-08-04 13:28:27 : Organizing colData, 0.767 mins elapsed.
2023-08-04 13:28:27 : Organizing rowData, 0.768 mins elapsed.
2023-08-04 13:28:27 : Organizing rowRanges, 0.769 mins elapsed.
2023-08-04 13:28:27 : Organizing Assays (1 of 1), 0.769 mins elapsed.
2023-08-04 13:28:27 : Constructing SummarizedExperiment, 0.779 mins elapsed.
2023-08-04 13:28:33 : Finished Matrix Creation, 0.876 mins elapsed.
pm <- assays(peak_matrix)$PeakMatrix # peaks sparse martix
rownames(pm) <- paste0(as.character(seqnames(my_ArchRproject@peakSet)), '-', as.character(start(my_ArchRproject@peakSet)), '-', as.character(end(my_ArchRproject@peakSet)))
Error in (function (classes, fdef, mtable) :
unable to find an inherited method for function ‘seqnames’ for signature ‘"NULL"’
Hello,
I realized the peak set for my ArchR project was not stored. I re-ran the code for making a reducible peak set, then tried to run "pkm <- getPeakMatrix(test)" again and got a new error for Dimnames. Any help problem solving this new error would be great, thanks!
pkm <- getPeakMatrix(my_ArchRproject)
[1] "In Progress:"
[1] "Get Matrix From ArchRProject"
ArchR logging to : ArchRLogs/ArchR-getMatrixFromProject-13e7ea9aaf0a-Date-2023-08-04_Time-14-36-06.log
If there is an issue, please report to github with logFile!
2023-08-04 14:36:48 : Organizing colData, 0.705 mins elapsed.
2023-08-04 14:36:48 : Organizing rowData, 0.706 mins elapsed.
2023-08-04 14:36:48 : Organizing rowRanges, 0.706 mins elapsed.
2023-08-04 14:36:48 : Organizing Assays (1 of 1), 0.706 mins elapsed.
2023-08-04 14:36:49 : Constructing SummarizedExperiment, 0.717 mins elapsed.
2023-08-04 14:36:55 : Finished Matrix Creation, 0.83 mins elapsed.
Error in dimnamesGets(x, value) :
length of Dimnames[[1]] (176570) is not equal to Dim[1] (178677)
Error in dimnamesGets(x, value) :
length of Dimnames[[1]] (176570) is not equal to Dim[1] (178677)
Hello @libell1 Unfortunately, I am not sure about this one. I've never seen this error before and don't have much to go off of. Maybe can you clarify what you've done differently than the standard pipeline using ArchR? Maybe subsetting or something?
Closing inactive issues, Feel free to reopen it if needed