Tximport for kallisto abundance.tsv files prior to DESeq analysis (RNASeq)
Hello, I am very new to RNASeq analysis and need help figuring out how to prep abundance.tsv files (kallisto output files) for eventual DESeq2 analysis
I have a sample annotation file that contains the file name, build id and subject names called samples.csv. I also have abundance.tsv files for each subject. I am having trouble running tximport using the following code:
library(tximportData)
directory <- C:/Users/xyz/Downloads
samples <- read.table(file.path(directory, "samples.csv"))
files <- file.path(directory, "kallisto", samples$V1, "Subject1.abundance.tsv")
names(files) <- paste0("sample", 1:4)
library(TxDb.Hsapiens.UCSC.hg19.knownGene)
txdb <- TxDb.Hsapiens.UCSC.hg19.knownGene
k <- keys(txdb, keytype = "TXNAME")
tx2gene <- select(txdb, k, "GENEID", "TXNAME")
library(readr)
tx2gene <- read_csv(file.path(dir, "tx2gene.gencode.v27.csv"))
txi.kallisto.tsv <- tximport(files, type = "kallisto", tx2gene = tx2gene, ignoreAfterBar = TRUE)
I got error: Error in tximport(files, type = "kallisto", tx2gene = tx2gene, ignoreAfterBar = TRUE) : all(file.exists(files)) is not TRUE.
Please help, I am not sure what I'm doing wrong.
• 3,282 views
•
link
0 answers
No answers yet.
Log in to answer this question.
tximport says it can't find your sample files - basically there is a problem with how the link to your sample files is structured in 'files' if you just check what the output of 'files' is, you should be able to spot the problem?