Question: What's wrong with my data or code?
gravatar for ys19f
9 months ago by
ys19f0 wrote:

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?

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)
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),]
write.csv(res, file="results.csv")
rna-seq • 315 views
ADD COMMENTlink modified 9 months ago by ATpoint44k • written 9 months ago by ys19f0

According to the manual ( 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 REPLYlink written 9 months ago by ATpoint44k

Also what are the actual contents of files?

ADD REPLYlink written 9 months ago by Kevin Blighe69k

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 REPLYlink written 9 months ago by cpad011214k

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

ADD REPLYlink written 6 months ago by weichengz0
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1049 users visited in the last hour