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?
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?
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
Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
read.table()
andcbind()
I guess.