all variables in design formula must be columns in colData
1
0
Entering edit mode
2.6 years ago
abradford • 0

Hello,

I am having the hardest time determining what in my original file is misaligned and why this error message persists. Any suggestions? I added the columns "status" and "sample" and those are the only columns that align with the data. I am not sure what is missing .

 #Import data
> getwd()

> samples <- read.table("data/samples_updated.txt", header = TRUE)

> samples

    sample status
1    10007 urgent
2    10018  asymp
3    10037 urgent
4    10045 urgent
5    10047  asymp
6    10049 urgent
7  011811A  asymp
8  051111A  asymp
9  051512A urgent
10 111111A  asymp
11 121511A urgent

> dir <- "data"

> files <- file.path(dir, paste0(samples$sample, ".genes.results"))

> names(files) <- paste0("sample", 1:11)

> all(file.exists(files))
[1] TRUE

> 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 

> head(txi.rsem$counts)
          sample1 sample2 sample3 sample4 sample5 sample6 sample7 sample8 sample9 sample10 sample11
5S_rRNA      0.00    0.00    1.51    0.00    0.00    2.94    1.00    1.00    0.79     1.16     0.00
5_8S_rRNA    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00     0.00     0.00
7SK         60.28   47.00   67.30   33.94   62.29   42.90   78.67   60.04   84.67    56.25   107.75
A1BG        78.08   40.82   75.10   75.24   68.61   53.74   69.94   43.81   61.44    60.16    54.27
A1BG-AS1    90.00   57.00  112.57   93.03   78.98   65.00   72.00   74.00   78.98    32.38    97.00
A1CF         4.10    0.00    2.04    3.11    5.13    1.47    1.41    4.27    3.20     3.68     8.00
> 

> #import into DESeq2

> sampleTable <- data.frame(read.csv("data/samples_updated.txt", header=T))

> rownames(sampleTable) <- colnames(txi.rsem$counts)

> txi.rsem$length <- replace (txi.rsem$length, txi.rsem$length==0,1)

*> dds <- DESeqDataSetFromTximport(txi.rsem, sampleTable, ~Status)
Error in DESeqDataSet(se, design = design, ignoreRank) : 
  all variables in design formula must be columns in colData*
DESeq2 • 4.4k views
ADD COMMENT
1
Entering edit mode
2.6 years ago
iraun 6.2k

It seems you have status as column name and Status in the DESeqDataSetFromTximport command, maybe that is the issue?

ADD COMMENT
0
Entering edit mode

I will try to address that now! Thank you.

ADD REPLY
0
Entering edit mode

I am not sure what I would change - the column or the command?

ADD REPLY
0
Entering edit mode

status with a lowercase leading s in the design, ~status, not ~Status, it must be the same as in the colData.

ADD REPLY
0
Entering edit mode

The issue was that the two input files I was using, one txt and one csv were not matching - the content and names within their columns were not aligned. In case someone has this issue - try this solution.

ADD REPLY

Login before adding your answer.

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