Error using tximport on Salmon with sparseMatrix on scaledTPM option
1
0
Entering edit mode
noorpratap • 0
@noorpratap-15054
Last seen 3 months ago
United States

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.

tximport Salmon sparse • 882 views
ADD COMMENT
2
Entering edit mode
@mikelove
Last seen 10 hours ago
United States

Thanks for the report, I've updated the code at mikelove/tximport so you can pull that version with devtools::install_github() now (1.17.1).

There was actually a unit test for sparse=TRUE and countsFromAbundance="scaledTPM", but the error only showed up if the last file or last gene did not contain a positive count I believe.

ADD COMMENT
0
Entering edit mode

I pushed to 1.16.1 as well (should show up in 1-2 days).

ADD REPLY
0
Entering edit mode

Yes it had a zero count. Thanks for the update though.

ADD REPLY

Login before adding your answer.

Traffic: 810 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6