This is a test version of Biostars. For the public version, visit https://www.biostars.org.
DESeq2 for DEG in R

I want to do DSEQ2 in R. I have the following files

transcript  Control_R1  Control_R2  Control_R3  Day1_R1 Day1_R2 Day1_R3 Day2_R1 Day2_R2 Day2_R3 Day3_R1 Day3_R2 Day3_R3 Day5_R1 Day5_R2 Day5_R3
TraesCS1A02G007700.1    0   1   0   0   0   0   0   0   0   0   0   0   0   0   0
TraesCS1A02G007800.1    19  30  26  13  8   1   10  10  19.4163 21  17  16  27  32  18
TraesCS1A02G007900.1    0   0   0   0   0   0   0   0   0   0   0   0   0   0   0
TraesCS1A02G007934.1    0   0   0   0   0   0   0   0   0   0   0   0   0   0   0
TraesCS1A02G008000.1    0   0   0   0   0   0   0   0   0   0   0   0   0   0   0
TraesCS1A02G008100.1    28.8806 38.5978 26.63   13.2727 14.65   10.259  24.8453 18.6404 47.969  24.6252 30.2632 25.7821 38.0815 27.1873 21.4213
TraesCS1A02G008200.1    2.78727 1.53136 5.38526 0   3.47021 3.78439 3.49165 1.80285 1.06531 1.99845 0   1.51613 2.0538  1.42314 0

my condition file is

Control_R1  Control
Control_R2  Control
Control_R3  Control
Day1_R1 Day1
Day1_R2 Day1
Day1_R3 Day1
Day2_R1 Day2
Day2_R2 Day2
Day2_R3 Day2
Day3_R1 Day3
Day3_R2 Day3
Day3_R3 Day3
Day5_R1 Day5
Day5_R2 Day5
Day5_R3 Day5

whenever I try to read my file using this code: just.raw.counts = read.delim("Raw_counts_input.txt", row.names=1) head(just.raw.counts)

I get a

Error in read.table(file = file, header = header, sep = sep, quote = quote, : duplicate 'row.names' are not allowed

however, for my condition file it doesn't give this error, and I have tried all possible means to resolve this

Please how can I resolve this?

rna-seq

Remove row.names from the read argument, read the entire file as is and then figure out why there are duplicates, and deal with that. Column1 is what you used ass rownames, it is on you to know why there are duplicates (which are not allowed in R for rownames).

i I have tried it but brought another error

Error in DESeqDataSetFromMatrix(countData = just.raw.counts, colData = meta.data, : ncol(countData) == nrow(colData) is not TRUE

ok thanks. I apologize for this. I just need a solution to the problem real quick. My sincere apologies

The error you get there is self explanatory. The dataframe can't be parsed because you have duplicated elements in the column you want to specify as rownames. What you could do is to build the dataframe without specifying the rownames attribute (so you will have the gene id in a regular column) and then check which rows are duplicated.

thanks, I finally got it. I needed to remove the genes from my transcriptomic data that were not differentially expressed thus having zero as they showed no expression and this was the reason R was giving the complaint.

Well, actually you can feed to DESeq2 genes with 0 counts and the algorithm will handle it. The error you provided comes from base R, it was complaining because you were trying to assign duplicated values as rownames.

0 answers

No answers yet.

Log in to answer this question.