Question: Tximport > DESeq2 (sample names)
0
gravatar for b.d237
11 weeks ago by
b.d23740
National University of Ireland, Galway
b.d23740 wrote:

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

rna-seq deseq2 tximport • 233 views
ADD COMMENTlink modified 11 weeks ago • written 11 weeks ago by b.d23740

heatmap image:

ADD REPLYlink modified 11 weeks ago • written 11 weeks ago by b.d23740
2
gravatar for b.d237
11 weeks ago by
b.d23740
National University of Ireland, Galway
b.d23740 wrote:

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 COMMENTlink written 11 weeks ago by b.d23740
Please log in to add an answer.

Help
Access

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