Hello,
I would like to filter the resulting txi file generated from tximport of Salmon files to exclude columns where there are >=4 0s in 'counts'.
I did: txi <-tximport(files, type = "salmon", txOut = TRUE)
this yields txi, a large list of 4 elements, where:
attributes(txi) $names [1] "abundance" "counts" "length" "countsFromAbundance"
I want to remove/exclude columns where there are >=4 0s in "counts." Counts are in columns 22-41.
To do this, I did:
txi_subset = txi[!rowSums(txi[, c(22:41)] == 0) >=4, ]
I get:
Error in h(simpleError(msg, call)) : error in evaluating the argument 'x' in selecting a method for function 'rowSums': incorrect number of dimensions
Any help would be appreciated. Thank you.
Right. Recommend tximeta package and function which will give a SummarizedExperiment.
Most users who want a Bioc-like object benefit from tximeta over tximport, the former calls the latter anyway.
Thanks, I'm not totally sure this will work to resolve the need to remove 0's. Regardless, I'm getting:
Error: lexical error: invalid char in json text. ./cmd_info.json (right here) ------^
I restarted R Studio and got the same error.
That error has been resolved by previous users here by using up to date package versions.