DeSeq2 "some values in assay are negative"
0
0
Entering edit mode
2.1 years ago
Morris_Chair ▴ 370

Hello everyone, I'm back again with RNA-seq data analysis and I encountered an error that seems to be common for the work that I'm doing

dds <- DESeqDataSetFromMatrix(countdata, coldata, design=~condition)

Error in DESeqDataSet(se, design = design, ignoreRank) : some values in assay are negative

I tried this solve in this way:

mat <- countdata[,-1]

rownames(mat) <- countdata[,1]

message: non-unique values when setting 'row.names': ‘0’, ‘1’, ‘2’, ‘3’, ‘4’, ‘5’, ‘6’, ‘7’, ‘8’, ‘9’, ‘10’, ‘11’, ‘12’, ‘13’, ‘14’, ‘15’, ‘16’, ‘17’, ‘18’, ‘19’, ‘20’, ‘21’, ‘22’, ‘23’, ‘24’, ‘25’, ‘26’, ‘27’, ‘28’, ‘29’, ‘30’, ‘31’, ‘32’, ‘33’, ‘34’, ‘35’, ‘36’, ‘37’, ‘38’, ‘39’, ‘40’, ‘41’, ‘42’, ‘43’, ‘44’, ‘45’, ‘46’, ‘47’, ‘48’, ‘49’, ‘50’, ‘51’, ‘52’, ‘53’, ‘54’, ‘55’, ‘56’, ‘57’, ‘58’, ‘59’, ‘60’, ‘61’, ‘62’, ‘63’, ‘64’, ‘65’, ‘66’, ‘67’, ‘68’, ‘69’, ‘70’, ‘71’, ‘72’, ‘73’, ‘74’, ‘75’, ‘76’, ‘77’, ‘78’, ‘79’, ‘80’, ‘81’, ‘82’, ‘83’, ‘84’, ‘85’, ‘86’, ‘87’, ‘88’, ‘89’, ‘90’, ‘91’, ‘92’, ‘93’, ‘94’, ‘95’, ‘96 [... truncated]duplicate 'row.names' are not allowed In addition: WarningError in .rowNamesDF<-(x, value = value) :

but I can't find duplicated rows...

I accept any suggestion and thank you for help

RNAseq • 2.8k views
ADD COMMENT
0
Entering edit mode

head(countdata)

head(coldata)

ADD REPLY
0
Entering edit mode

Hi ATpoint,

here is the result

 > head(countdata)
                   SRR5088824_starReadsPerGene.out.tab.x SRR5088825_starReadsPerGene.out.tab.x
ENSG00000000003.10                                    70                                    70
ENSG00000000005.5                                      0                                     0
ENSG00000000419.8                                     83                                    83
ENSG00000000457.9                                     62                                    62
ENSG00000000460.12                                    39                                    39
                   SRR5088834_starReadsPerGene.out.tab.x SRR5088835_starReadsPerGene.out.tab.x
ENSG00000000003.10                                    70                                    70
ENSG00000000005.5                                      0                                     0
ENSG00000000419.8                                     83                                    83
ENSG00000000457.9                                     62                                    62
ENSG00000000460.12                                    39                                    39
                   SRR5088842_starReadsPerGene.out.tab.x SRR5088843_starReadsPerGene.out.tab.x
ENSG00000000003.10                                    70                                    70
ENSG00000000005.5                                      0                                     0
ENSG00000000419.8                                     83                                    83
ENSG00000000457.9                                     62                                    62
ENSG00000000460.12                                    39                                    39
                   SRR5088844_starReadsPerGene.out.tab.x SRR5088859_starReadsPerGene.out.tab.x
ENSG00000000003.10                                    70                                    70
ENSG00000000005.5                                      0                                     0
ENSG00000000419.8                                     83                                    83
ENSG00000000457.9                                     62                                    62
ENSG00000000460.12                                    39                                    39
                   SRR5088860_starReadsPerGene.out.tab.x SRR5088861_starReadsPerGene.out.tab.x
ENSG00000000003.10                                    70                                    70
ENSG00000000005.5                                      0                                     0
ENSG00000000419.8                                     83                                    83
ENSG00000000457.9                                     62                                    62
ENSG00000000460.12                                    39                                    39


 getOption("max.print") -- omitted 1 rows ]


> > head(coldata)

   condition 
SRR5088824_starReadsPerGene.out.tab.x responsive
SRR5088825_starReadsPerGene.out.tab.x responsive
SRR5088834_starReadsPerGene.out.tab.x responsive
SRR5088835_starReadsPerGene.out.tab.x responsive
SRR5088842_starReadsPerGene.out.tab.x responsive
SRR5088843_starReadsPerGene.out.tab.x responsive

I shorted the countdata list

Thank you

ADD REPLY
0
Entering edit mode

Please format data and code with the code button, not as a quote, it's messy and unreadable that way. The counts must be a numeric matrix. Rows being genes and columns being samples.

ADD REPLY
0
Entering edit mode

even if I convert the data.frame as matrix doesn't help

countdata<-as.matrix(countdata)
dds <- DESeqDataSetFromMatrix(countdata, coldata, design=~condition)
>Error in DESeqDataSet(se, design = design, ignoreRank) : 
>some values in assay are negative
ADD REPLY
0
Entering edit mode

Did you make sure that:

all(rownames(coldata) == colnames(count_matrix))

?

ADD REPLY
0
Entering edit mode

Hi Marco, It comes as "TRUE "

all(rownames(coldata) == colnames(countdata))
>[1] TRUE

thanks

ADD REPLY
0
Entering edit mode

Have you tried the workaround suggested here?

ADD REPLY
0
Entering edit mode

yes I did it but without success :(

ADD REPLY
0
Entering edit mode

When you want to reassign rownames, try this way:

mat <- countdata[,-1]
names_countdata <- countdata[,1]
rownames(mat) <- make.names(names_countdata, unique=TRUE)
ADD REPLY
0
Entering edit mode

Hi Marco I think I found the error, the problem is on my merged files which duplicates values in the same boxes and does some more errors..

Thank you for your answers :)

ADD REPLY

Login before adding your answer.

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