Entering edit mode
3.8 years ago
lmck0705
•
0
Hi, I am new to R and trying to carry out unsupervised hierarchical clustering on an RNA-seq data set (30 different gene.result files).
I am inputting this code:
samples<-read.table("RNAseq_sample3.txt",sep="\t",header=T, fill=TRUE)
files <- list.files("./",pattern=".genes.results")
names(files) <-samples$sample
txi.rsem <- tximport(files, type = "rsem", txIn = FALSE, txOut = FALSE)
txi.rsem$length[txi.rsem$length == 0] <- 1
ddsTxi <- DESeqDataSetFromTximport(txi.rsem, countData = colData = samples,design = ~ Condition)
ddsLRT <- DESeq(ddsTxi, test="LRT", reduced= ~ 1)
resLRT <- results(ddsLRT)
resOrdered <- resLRT[order(resLRT$padj),]
topgenes <- head(rownames(resOrdered),100)
mat <- assay(vsd)[topgenes,]
mat <- mat - rowMeans(mat)
pheatmap(mat,color = colorRampPalette(c("darkblue", "white", "darkred"))(100),border_color = NA,cluster_cols = T,fontsize_row=5,fontsize_col=6)
head(as.data.frame(resOrdered),100)
And this is being returned:
txi.rsem <- tximport(files, type = "rsem", txIn = FALSE, txOut = FALSE) reading in files with read_tsv 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
txi.rsem$length[txi.rsem$length == 0] <- 1
ddsTxi <- DESeqDataSetFromTximport(txi.rsem,colData = samples,design = ~ Condition)
Error in DESeqDataSetFromMatrix(countData = counts, colData = colData, : ncol(countData) == nrow(colData) is not TRUE
I have googled around why I might be getting this error with the DESeq package but can't seem to work out why...
Any help would be much appreciated!
Output of
colnames(txi.rsem$counts)
and the content ofsamples
? It is pretty simple, the colData (samples) must have the same numbers of rows as txi has columns, because colData must describe each sample in txi, so what the samples are in terms of group information (=which group does each sample belong to, and which samples are replicates for the same group).Sorry, I made a mistake. My input was this:
Follow-up on why this condition is not returning TRUE:
In your code, these objects are: