BimberLab / cellhashR

An R package designed to demultiplex cell hashing data
27 stars 6 forks source link

Error in barcodeData; Incorrect number of dimensions #114

Closed mbassalbioinformatics closed 1 year ago

mbassalbioinformatics commented 1 year ago

hi, im trying to run the processCountMatrix function but keep coming up with the following error

10X data contains more than one type and is being returned as a list containing matrices of each type.
Error in barcodeData[which(!(rownames(barcodeData) %in% barcodeBlacklist)),  : 
  incorrect number of dimensions

Ive tried running the following commands, all result in exactly the same error

barcodeData <- ProcessCountMatrix(rawCountData = './', 
                                  minCountPerCell = 5, 
                                  barcodeWhitelist = c('HTO1', 'HTO2', 'HTO3'))

barcodeData <- ProcessCountMatrix(rawCountData = './', 
                                  minCountPerCell = 5, 
                                  barcodeWhitelist = c('HTO1', 'HTO2', 'HTO3'),
                                  barcodeBlacklist = "no_match")

barcodeData <- ProcessCountMatrix(rawCountData = './', 
                                  minCountPerCell = 5, 
                                  barcodeWhitelist = c('HTO1', 'HTO2', 'HTO3'),
                                  barcodeBlacklist = "unmapped")

barcodeData <- ProcessCountMatrix(rawCountData = './', 
                                  minCountPerCell = 5, 
                                  barcodeWhitelist = c('HTO1', 'HTO2', 'HTO3'),
                                  barcodeBlacklist = "total_reads")

barcodeData <- ProcessCountMatrix(rawCountData = './', 
                                  minCountPerCell = 5, 
                                  barcodeWhitelist = c('HTO1', 'HTO2', 'HTO3'),
                                  barcodeBlacklist = NULL)

Any suggestions/ideas as to what im doing wrong?

The current path (./) contains the following files

matrix.mtx.gz
barcodes.tsv.gz
features.tsv.gz

Much appreciated!

bbimber commented 1 year ago

I believe this is showing that cellranger was run in a mode that stores the gene expression, hashing, etc. together. See that message here:

https://www.10xgenomics.com/resources/analysis-guides/tag-assignment-of-10x-Genomics-cellplex-data-using-seurats-htodemux-function

You can also see it from ?Seurat::Read10X. I think I have a fix for this here: https://github.com/BimberLab/cellhashR/pull/115/files

Would you mind installing this version and seeing if it fixes your problem? Note, when you run this version it should detect that the incoming data are multi-assay. It will report the names of those assays and then stop. You can provide the datatypeName argument to ProcessCountMatrix(), and I think it will then work fine.

devtools::install_github(repo = 'bimberlab/cellhashR', ref = 'multiassay')
mbassalbioinformatics commented 1 year ago

Yep! For now seems to be sorted.

Very much appreciated to see bioinformatics tools that are being well supported. Also, very much appreciated how quickly you dealt with this issue!

bbimber commented 1 year ago

No problem. This is merged into the main branch so you or anyone who reads this in the future can use that.

domenico-somma commented 1 year ago

Hello, thanks for this very useful tool! I was wondering if you can release a new package version of this (1.0.4 maybe?) with this update. Would be great to keep track what version we have installed on our server.

Thanks

bbimber commented 1 year ago

sure, done