This is a test version of Biostars. For the public version, visit https://www.biostars.org.
DESeq2 - HTSeq-count txt error

Hi,

I am trying to perform differential analysis on my HT-seq-counts .txt files, using a command below's command,

sampleFiles <- grep("CD39",list.files(directory),value=TRUE)
sampleCondition <- sub("(.*annotated...).*","",sampleFiles)
sampleTable <- data.frame(sampleName = sampleFiles,
                          fileName = sampleFiles,
                          condition = sampleCondition)

ddsHTSeq <- DESeqDataSetFromHTSeqCount(sampleTable = sampleTable,
                                       directory = directory,
                                       design= ~ condition)

But I received the error below:

Error in validObject(.Object) : 
  invalid class “DESeqDataSet” object: levels of factors in the design have non-unique level names after make.names() is applied.
  best to only uobject letters and numbers for levels of factors in the design

Can someone enlighten me please? My output for sample My output for sampleTable is this:

                      sampleName                       fileName condition
1 annotated_SRR7059136_CD39-.txt annotated_SRR7059136_CD39-.txt     CD39-
2 annotated_SRR7059137_CD39+.txt annotated_SRR7059137_CD39+.txt     CD39+
3 annotated_SRR7059138_CD39-.txt annotated_SRR7059138_CD39-.txt     CD39-
4 annotated_SRR7059139_CD39+.txt annotated_SRR7059139_CD39+.txt     CD39+
5 annotated_SRR7059140_CD39-.txt annotated_SRR7059140_CD39-.txt     CD39-
6 annotated_SRR7059141_CD39+.txt annotated_SRR7059141_CD39+.txt     CD39+
7 annotated_SRR7059142_CD39-.txt annotated_SRR7059142_CD39-.txt     CD39-
8 annotated_SRR7059143_CD39+.txt annotated_SRR7059143_CD39+.txt     CD39+

Please advise, thank you!

rna-seq

The error message explicitly told you what to do:

best to only uobject letters and numbers for levels of factors in the design

1 answer

After DESeq2 uses the function make.names() on sampleTable$condition, CD39+ is changed to CD39., and CD39- is also changed to CD39.. Edit sampleTable$condition to avoid this:

sampleTable$condition <- gsub( "[+]", "plus", sampleTable$condition )
sampleTable$condition <- gsub( "[-]", "minus", sampleTable$condition )

Must have been a silly question this one. Thanks h.mon!

Log in to answer this question.