Entering edit mode
2.0 years ago
abhay.kanodia
▴
10
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
What is inside Directory ?
list.files(path = Directory)
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"
Check if
read.table("path_to_your_file/AK1a_counts.txt", fill=TRUE)
correctly imports the data, otherwise the data might not be correctly formattedI 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
Thank you very much @Basti! I highly appreciate your help. I will check all my files as you suggested.
These files will really import without rownames?
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.
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.