Hi,
I am trying to automate some of my analysis and am pulling in condition and data information from a master experiment design sheet and a HTSeq count table for the entire experiment. Because I am getting the sheet from the investigator and the HTSeq count is in run order using identifiers from the lab, the two sheets might be in different orders. Example:
Note that the first sample in the experiment design sheet is not the first sample on the HTSeq count matrix.
Now I do this:
slim_dds<-DESeqDataSetFromMatrix(countData = slim_HTS_table, colData = slim_expt, design = ~Day)
And wallah, the sample names are now in order, but the count matrix order was preserved, ie samples are now misassigned.
Is there an easy flag to fix this or do I simply need to sort both data frames (by row or column as appropriate) prior to creating the DESeq data set?
I am trying to automate some of my analysis and am pulling in condition and data information from a master experiment design sheet and a HTSeq count table for the entire experiment. Because I am getting the sheet from the investigator and the HTSeq count is in run order using identifiers from the lab, the two sheets might be in different orders. Example:
HTML Code:
slim_expt[,1:2] SampleID Day P3-D1 P3-D1 control P3-D2 P3-D2 control P3-D3 P3-D3 control P3-D4 P3-D4 control P12-D1 P12-D1 treated P12-D2 P12-D2 treated P12-D3 P12-D3 treated P12-D4 P12-D4 treated
HTML Code:
head(slim_HTS_table) P12-D1 P12-D2 P12-D3 P12-D4 P3-D1 P3-D2 P3-D3 P3-D4 ENSMUSG00000000001 1546 1322 1248 1156 2162 2211 2811 2223 ENSMUSG00000000003 0 0 0 0 0 0 0 0 ENSMUSG00000000028 14 23 11 17 42 30 53 55
Now I do this:
slim_dds<-DESeqDataSetFromMatrix(countData = slim_HTS_table, colData = slim_expt, design = ~Day)
And wallah, the sample names are now in order, but the count matrix order was preserved, ie samples are now misassigned.
HTML Code:
head(counts(slim_dds)) P3-D1 P3-D2 P3-D3 P3-D4 P12-D1 P12-D2 P12-D3 P12-D4 ENSMUSG00000000001 1546 1322 1248 1156 2162 2211 2811 2223 ENSMUSG00000000003 0 0 0 0 0 0 0 0 ENSMUSG00000000028 14 23 11 17 42 30 53 55
Comment