Tximport > DESeq2 (sample names)
1
0
Entering edit mode
6.0 years ago
Barry Digby ★ 1.3k

Using R and tximport, I have read in 6 t_data.ctab files to create a DESeqDataSet by using DESeqDataSetFromTximport.

When plotting heatmaps etc, the sample names are '1', '2', '3', '4', '5', '6'. I suspect it has something to do with reading in the ctab files, when i run txi$counts the column headers are:

     [,1]  [,2]  [,3]  [,4]  [,5]  [,6]
  

I'm basing this on the bioconductor vignette: "The user should make sure the rownames of sampleTable align with the colnames of txi$counts, if there are colnames."

data <- c("/Users/Desktop/read_tables/H84S2Ctrl_S7/t_data.ctab",
      "/Users/Desktop/read_tables/H84WTCtrl_S1/t_data.ctab",
      "/Users/Desktop/read_tables/H85S2Ctrl_S8/t_data.ctab",
      "/Users/Desktop/read_tables/H85WTCtrl_S2/t_data.ctab",
      "/Users/Desktop/read_tables/H86S2Ctrl_S9/t_data.ctab",
      "/Users/Desktop/read_tables/H86WTCtrl_S3/t_data.ctab")

tmp <- read.table(data[1], header = TRUE)

tx2gene <- tmp[, c("t_name", "gene_name")]

txi <- tximport(data, type = "stringtie", tx2gene = tx2gene)

sampleNames <- c("S2Ctrl_7", "WTCtrl_1", "S2Ctrl_8", "WTCtrl_2", "S2Ctrl_9", "WTCtrl_3")

sampleGroup <- c("S2", "WT", "S2", "WT", "S2", "WT")

sampleTable <- data.frame(sampleName = sampleNames, type = sampleGroup)

rownames(sampleTable) <- colnames(txi$counts)

ddsTxi <- DESeqDataSetFromTximport(txi, sampleTable, design = ~ type)

dds <- DESeq(ddsTxi)

How can I assign the correct sample names and not 1, 2, 3, 4....?

Thank you in advance for your time

DESeq2 tximport RNA-Seq • 5.1k views
ADD COMMENT
0
Entering edit mode

heatmap image:

ADD REPLY
3
Entering edit mode
6.0 years ago
Barry Digby ★ 1.3k

Adding:

names(data) <- c("S2Ctrl_7", "WTCtrl_1", "S2Ctrl_8", "WTCtrl_2", "S2Ctrl_9", "WTCtrl_3")

below 'data' did the trick for anyone who has the same problem down the line..

ADD COMMENT

Login before adding your answer.

Traffic: 1089 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