This is a test version of Biostars. For the public version, visit https://www.biostars.org.
What's wrong with my data or code?

I have already had a set of RSEM data, and want to calculate the expression difference. My code is shown below, but I don't know what's wrong with it. It always tells me all(file.exists(files)) is not TRUE. How can I fix this problem?

library(tximport)
library(DESeq2)
dir <- c("~/sy/Desktop/Course/2019-2020/Bioinformatics/Assignment2/RSEM")
samples <- c("Ap03","Ap07","CLP2700","CLP2701","KW1750","KW1996","KW2031","KW2035","MM0024")
samples <- sort(samples)
files <- file.path(dir,paste0(samples,".genes.results"))
names(files) <- samples
txi.rsem <- tximport(files,type = "rsem", txIn=FALSE, txOut = FALSE)
head(txi.rsem$counts)
sampleTable <- data.frame(condition = factor(c(rep("A",5),rep("J",5))))
rownames(sampleTable) <- colnames(txi.rsem$counts)
dds <- DESeqDataSetFromTximport(txi.rsem, sampleTable, ~condition)
dds <- DESeq(dds)
res <- results(dds, contrast=c("condition","A","J"))
res <- res[order(res$pvalue),]
summary(res)
write.csv(res, file="results.csv")
rna-seq

Also what are the actual contents of files?

what part of the code is throwing error? In each step, try to check the object, start with samples, followed by other objects such as files, sampleTable and further downstream. @ ys19f

Hi, I got the same problem. Did you manage to fix it?

0 answers

No answers yet.

Log in to answer this question.