Entering edit mode
7.0 years ago
Tania
▴
180
Hello everyone I am doing tximport one file by one then pass them to edgeR dgelist, and I feel this is wrong:
samples <- read.table(file.path("pathhere/salmon", "samples.txt"), header = FALSE)
files <- file.path("path here/", "salmon", samples$V1, "quant.sf")
names(files) <- paste0("sample", 1:20)
tx2gene <- read.csv(file.path("pathhere/salmon", "tx2gene.csv"))
txi.salmon1 <- tximport(files[1], type = "salmon", tx2gene = tx2gene, ignoreTxVersion = TRUE)
write.csv(txi.salmon1$counts, "spquant1.counts")
txi.salmon2 <- tximport(files[2], type = "salmon", tx2gene = tx2gene, ignoreTxVersion = TRUE)
write.csv(txi.salmon2$counts, "spquant2.counts")
Any help how can I Read all my files and use in tximport directly, tried this but not working:
txi_salmon <- tximport(files = files, type = "salmon", txOut = FALSE, tx2gene = tx2gene)reading in files with read_tsv
Thanks Sharon. That works