Question: duplicate 'row.names' are not allowed
0
gravatar for barrypraveen
10 months ago by
barrypraveen20
barrypraveen20 wrote:

I have RNA-SEQ data i wanted to do DESeq (DEseq2 i am using). When i try to open my file it shows duplicate 'row.names' are not allowed like that. I already have gone through all kinds of possible ways which were discussed before but nothing worked.

This is my data

Tb927_01_v5.1     54039 54154   Novel   0   +   28     123  1   101 96  16  155 27  14  9   11

(I just highlighted every alternative tabs for your vision. I am not able to represent my data in a nice way sorry for that)

rna-seq R software error • 748 views
ADD COMMENTlink modified 3 months ago by paul.boisseaux0 • written 10 months ago by barrypraveen20
3

This must be one of the times when R error message are actually accurate and tell you what's wrong :')

You tell R to take column 1 as row names (row.names=1)
R tells you that there are duplicates in those row names

ADD REPLYlink written 10 months ago by WouterDeCoster38k
1

What file is that? A count matrix? Please give some more details.

ADD REPLYlink written 10 months ago by ATpoint15k

I am trying to find some new novel transcript from my sequencing file so i did multicov from bed tools to get the read counts. bedtools multicov -bams DS1.bam DS2.bam -bed transcript_I.bed > all_transcripts_I.tsv From that i took multicov output as a DESeq2 input file (all_transcripts_I.tsv).

R function i Uesd : countdata <- read.table("file5.tsv", header=TRUE, row.names=1)

The error i got : Error in read.table("file5.tsv", header = TRUE, row.names = 1) : duplicate 'row.names' are not allowed

My input file:

Tb927_01_v5.1   55903   56066   Novel_2 0   -   8   0   29  115 57  83  42  465 41  6   8   2
Tb927_01_v5.1   74188   74343   Novel_3 0   +   0   29  265 5   249 326 41  326 106 143 65  23
Tb927_01_v5.1   83979   84150   Novel_4 0   +   0   64  16  44  103 39  20  107 27  37  8   20
Tb927_01_v5.1   85231   85459   Novel_5 0   -   10  166 490 96  746 523 1186    1611    1384    809 511 216
Tb927_01_v5.1   90185   90292   Novel_6 0   +   0   25  118 2   81  117 13  131 33  33  21  7
ADD REPLYlink modified 10 months ago • written 10 months ago by barrypraveen20
5

Because your rownames (First row) are same and you asked R to read the file by considering first row as rownames (row.names=1). Because of indexing issue R cannot take same name for multiple rows.

In your case it looks like your fourth column seems to be non-repetitive. You can consider using row.names=4

ADD REPLYlink modified 10 months ago • written 10 months ago by EagleEye6.2k

@OP: remove row.names=1.

ADD REPLYlink modified 10 months ago • written 10 months ago by cpad011211k
1

Please provide reproducible example data, maybe paste output of dput(head(MyData)). Also, post the command you are using that is causing the error.

ADD REPLYlink written 10 months ago by zx87547.1k

Report the R function you used to read your file. Also provide exact error message.

ADD REPLYlink written 10 months ago by EagleEye6.2k

R function i Uesd : countdata <- read.table("file5.tsv", header=TRUE, row.names=1)

The error i got : Error in read.table("file5.tsv", header = TRUE, row.names = 1) : duplicate 'row.names' are not allowed

ADD REPLYlink written 10 months ago by barrypraveen20
5
gravatar for Benn
10 months ago by
Benn6.6k
Netherlands
Benn6.6k wrote:

The question is also duplicate

How To Deal With Duplicate Row Names Error In R

ADD COMMENTlink written 10 months ago by Benn6.6k
1
gravatar for Prakash
10 months ago by
Prakash920
India
Prakash920 wrote:

If you still want to use first column as rownames , use Check.name= FALSE

ADD COMMENTlink written 10 months ago by Prakash920
0
gravatar for bruce.moran
10 months ago by
bruce.moran570
Ireland
bruce.moran570 wrote:

R will not allow you to have rownames that are the same for each row. Using a rowname in the first place is unnecessary. There is, IMHO, a better convention for data handling in R.

Install the 'tidyverse', load the library, read the count data into a tibble. The R 'base' offers a lot, but so does 'tidyverse'. Beginners should at least be aware of and try it out, and also try to understand what 'tidy' data looks like, and why it might be a good idea.

install.packages('tidyverse') 
library('tidyverse') 
countdata <- read_tsv("file5.tsv")
ADD COMMENTlink modified 10 months ago • written 10 months ago by bruce.moran570
0
gravatar for paul.boisseaux
3 months ago by
paul.boisseaux0 wrote:

If it can help someone: I had the same error message:

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

when importing my file :

phenodata = "C:/Users/.../phenodata.txt"
read.delim(phenodata, row.name=1)

The .txt file was beforehand generated from Excel. I don't know why but there was a bug: you just have to copy-paste in excel your matrix to a new excel sheet, then to convert to a .txt file and re-try the import process. It should work ! Good luck,

ADD COMMENTlink written 3 months ago by paul.boisseaux0
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 792 users visited in the last hour