Hi,
I was trying to import the RSEM counts into DESeq2 using DESeqDataSetFromTximport function but for some reason I am getting Error in txi$counts : $ operator is invalid for atomic vectors
. I was just following the instructions in the manual but I am getting this error. Any ideas why?
Here is the full code that I was trying to run:
library(tximportData) library(tximport) library(DESeq2)
dir <- system.file("extdata", package = "tximportData") list.files(dir)
samples <- read.table(file.path(dir, "samples.txt"), header = TRUE) samples
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) head(txi.rsem$counts) colnames((txi.rsem$counts))
sampleTable <- data.frame(condition = factor(rep(c("A", "B"), each = 3))) rownames(sampleTable) <- colnames(txi.rsem$counts) head(sampleTable)
dds <- DESeqDataSetFromTximport(txi.rsem$counts, sampleTable, ~condition)