This is a test version of Biostars. For the public version, visit https://www.biostars.org.
DESeq input preparation

I have 6 txt files that I get from HTseq-count. How can I merge the column that contains the integer results in one file using R?

deseq

1 answer

You can just use DESeqDataSetFromHTSeqCount() (see help(DESeqDataSet)). This is assuming that you're using DESeq2, which you should be. This will also take care of removing the last 5 lines of the input files, which should be ignored.

Does DESeqDataSetFromHTSeqCount take account of the half-empty first lines of htseq-count output files?

           0
A1BG       6
A1BG-AS1   25
A1CF       0
A2M        6
A2M-AS1    383
A2ML1      0

If I leave the first row in the files, then I get an error:

> ddsHTSeqFull <- DESeqDataSetFromHTSeqCount(sampleTable=sampleTableFull, directory=directoryFullFiles, design= ~familyID+condition)
Error in `colnames<-`(`*tmp*`, value = 1:8) : 
  attempt to set 'colnames' on an object with less than two dimensions

This works fine when I use a version of the files where I have deleted the first row.

Please let me know if I have got this right, or whether there is an issue with my htseq-count files?

Thanks,
Matt

  1. You should post things like this as new questions in the future rather than as comments on things posted almost a year ago.
  2. You have a problem with the output of htseq-count. It does not normally produce files with half empty lines, which suggests that your GTF files has problems.

Log in to answer this question.