Error in DESeqDataSetFromHTSeqCount
0
0
Entering edit mode
11 weeks ago

I am using HTseq pipeline for DESeq2:

Directory = "/Users/abhaykanodia/Desktop/smallRNA/"

condition = c("WT1", "WT2", "WT3",
              "NTC1", "NTC2", "NTC3)

sampleFiles= c("AK1a_counts.txt","AK2a_counts.txt","AK3a_counts.txt","
AK4a_counts.txt","AK5a_counts.txt","AK6a_counts.txt")

sampleName = c("AK1", "AK2", "AK3", "AK4", "AK5", "AK6")

sampleTable <- data.frame(sampleName = sampleName, fileName = sampleFiles, condition = condition)
sampleTable

The output is:

sampleName         fileName           condition
1         AK1  AK1a_counts.txt                 WT1
2         AK2  AK2a_counts.txt                 WT2
3         AK3  AK3a_counts.txt                 WT3
4         AK4  AK4a_counts.txt                NTC1
5         AK5  AK5a_counts.txt                NTC2
6         AK6  AK6a_counts.txt                NTC3

Now, when I use:

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

It gives the following error:

Error in `colnames<-`(`*tmp*`, value = sampleTable[, 1]) : 
  attempt to set 'colnames' on an object with less than two dimensions
DESeq2 RNA-seq HTseq • 539 views
ADD COMMENT
0
Entering edit mode

What is inside Directory ? list.files(path = Directory)

ADD REPLY
0
Entering edit mode

Hi @Basti,

Thanks for your response. Here is the output of list.files(path = Directory) :

[1] "AK1a_counts.txt" [2] "AK2a_counts.txt"
[3] "AK3a_counts.txt"
[4] "AK4a_counts.txt"
[5] "AK5a_counts.txt"
[6] "AK6a_counts.txt"

ADD REPLY
0
Entering edit mode

Check if read.table("path_to_your_file/AK1a_counts.txt", fill=TRUE) correctly imports the data, otherwise the data might not be correctly formatted

ADD REPLY
0
Entering edit mode
 The output of read.table("/Users/abhaykanodia/Desktop/smallRNA/AK1a_counts.txt", fill=TRUE) is:
           V1                   V2
1         ENSG00000000003.15  2
2          ENSG00000000005.6  0
3         ENSG00000000419.14 21
4         ENSG00000000457.14  0
5         ENSG00000000460.17  2
6         ENSG00000000938.13  0
ADD REPLY
0
Entering edit mode

I see no problem on this file and everything seems to work fine when taking this dataset as example. It is likely that some of your files have problem of data structure. You may need to check if every file is correctly formatted, try to see if it works with only some files or not etc

ADD REPLY
0
Entering edit mode

Thank you very much @Basti! I highly appreciate your help. I will check all my files as you suggested.

ADD REPLY
0
Entering edit mode

These files will really import without rownames?

ADD REPLY
0
Entering edit mode

Hi @swbarnes2,

Thanks for your response. Can you please explain your question, i didn't understand. Whatever I have posted is the actual output I got from R.

ADD REPLY
0
Entering edit mode

Do you have rownames or not? I've never used that particular import method, but I've always imported metadata files where the sample names were the rownames, and count data where the gene names were the rownames, and t don't think that's what you have. Since things are not working as you have them, it's worth checking to see if that is the issue.

ADD REPLY

Login before adding your answer.

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