This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Tximport error with Salmon data

When I run this line of code:

txi <- tximport(files, type="salmon", tx2gene=tx2gene[,c("tx_id", "ensgene")], countsFromAbundance="lengthScaledTPM", ignoreTxVersion = TRUE)

I get this error:

Error in tximport(files, type = "salmon", tx2gene = tx2gene[, c("tx_id",  : 
  length(files) > 0 is not TRUE

Why is it saying this error?

rna-seq salmon r

Your files vector/list doesn't have any elements.

This is what I put:

files <- file.path(samples, "quant.sf")
samples <- list.files(path = "./data", full.names = T, pattern="salmon$")

1 answer

Look at samples and files. They should be non-empty. If they are empty, you're doing something wrong.

Log in to answer this question.