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  "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, ]
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.