I am trying to import the Salmon quantified transcripts with the following code snippet by using scaledTPM option and returning a sparseMatrix:
txiSalmon <- tximport(files, type = "salmon", tx2gene = annFile, countsFromAbundance = "scaledTPM", txOut=T, sparse = T)
However, I get the following error:
invalid class “dgTMatrix” object: length(Dimnames[1]) differs from Dim[1]
Looking at the source code, I find that dims parameter has not been set for the if condition checking scaledTPM when creating the sparseMatrix. https://github.com/mikelove/tximport/blob/master/R/tximport.R#L556. Hopefully, that is the only reason it is failing. Setting, the above parameter in the locally downloaded code from the github repository seems to make the above code snippet work for me.
I pushed to 1.16.1 as well (should show up in 1-2 days).
Yes it had a zero count. Thanks for the update though.