Question: Tximport > DESeq2 (sample names)
0
gravatar for b.d237
7 months ago by
b.d237120
National University of Ireland, Galway
b.d237120 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 • 524 views
ADD COMMENTlink modified 7 months ago • written 7 months ago by b.d237120

heatmap image:

ADD REPLYlink modified 7 months ago • written 7 months ago by b.d237120
2
gravatar for b.d237
7 months ago by
b.d237120
National University of Ireland, Galway
b.d237120 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 7 months ago by b.d237120
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: 1624 users visited in the last hour