What's wrong with my data or code?
0
0
Entering edit mode
4.0 years ago
ys19f • 0

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 • 1.1k views
ADD COMMENT
0
Entering edit mode

According to the manual (https://bioconductor.org/packages/release/bioc/vignettes/tximport/inst/doc/tximport.html#rsem) the RSEM outputs are gzipped, is this the case here?

files <- file.path(dir, "rsem", samples$run, paste0(samples$run, ".genes.results.gz"))
names(files) <- paste0("sample", 1:6)
txi.rsem <- tximport(files, type = "rsem", txIn = FALSE, txOut = FALSE)
ADD REPLY
0
Entering edit mode

Also what are the actual contents of files?

ADD REPLY
0
Entering edit mode

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

ADD REPLY
0
Entering edit mode

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

ADD REPLY

Login before adding your answer.

Traffic: 2996 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6