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) differs from Dim
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.