Hello,
I am importing kallisto output files into R through tximport package and then using DESeqDataSetFromTximport() funstion. I am following the DESeq2 tutorial (http://bioconductor.org/packages/devel/bioc/vignettes/DESeq2/inst/doc/DESeq2.html).
So, first to construct the tx2gene table for linking transcripts to genes, I did as below (based on Tximport vignette):
library(tximportData)
dir <- system.file("extdata", package = "tximportData")
list.files(dir)
tx2gene <- read_csv(file.path(dir, "tx2gene.gencode.v27.csv"))
Parsed with column specification: cols( TXNAME = col_character(), GENEID = col_character() ) #
Then, I did as below to read my meta data file:
datadir <- "/scratch/fs/ye/"
meta <- read.delim(paste0(datadir, "/ye_meta.txt"),
header = TRUE, as.is = TRUE)
rownames(meta) <- meta$names
meta$trt <- factor(meta$trt)
meta$cell <- factor(meta$cell)
Finally, to do tximport, I ran as follows, however, I got the below Error:
kallistofiles <- file.path(datadir,"/kallisto/", meta$names, ".*-abundance.tsv")
names(kallistofiles) <- meta$names
txi <- tximport(kallistofiles, type="kallisto", tx2gene=tx2gene)
Error in tximport(kallistofiles, type = "kallisto", tx2gene = tx2gene) : all(file.exists(files)) is not TRUE
So, I performed file.exists() as suggested in another post:
file.exists("tx2gene")
[1] FALSE
file.exists(kallistofiles)
[1] FALSE FALSE FALSE FALSE FALSE FALSE
However, when I only run kallistofiles, it can read my kallistofiles:
kallistofiles
SRR6822797 "/scratch/fs/ye///kallisto//SRR6822797/.*-abundance.tsv" SRR6822798 "/scratch/fs/ye///kallisto//SRR6822798/.*-abundance.tsv" SRR6822799 "/scratch/fs/ye///kallisto//SRR6822799/.*-abundance.tsv" SRR6822800 "/scratch/fs/ye///kallisto//SRR6822800/.*-abundance.tsv" SRR6822801 "/scratch/fs/ye///kallisto//SRR6822801/.*-abundance.tsv" SRR6822802 "/scratch/fs/ye///kallisto//SRR6822802/.*-abundance.tsv"
I would highly appreciate if you can help me how to solve this Error. Thanks you so much.
.*-abundance.tsv
are not file names. What are the names of the files under each folder? You may useto check the names.
Thank you very much for your guide.