Question: DGElist ERROR: Negative counts not allowed !
0
gravatar for XBria
17 months ago by
XBria70
germany
XBria70 wrote:

Hi,

I am having a problem when using DGElist. Can anyone suggest a solution for this type of error ? There are no negative numbers in the count_found_new_2 (all>0)

Thanks,

sample_info=read.table(file = "sample_info3new.txt",sep =',',row.names = 1,header = TRUE)
group_ <- as.factor(sample_info[,"condition"])
genes_=rownames(count_found_new_2)
data=DGEList(count_found_new_2,samples = sample_info, group =group_,genes = genes_ )
dgelist R • 1.3k views
ADD COMMENTlink modified 17 months ago • written 17 months ago by XBria70

Same problem occurred last week as well here on Biostars. The problem was then that the count matrix (data frame) also contained factors (instead of only possitive integers). Can you check your data frame?

str(count_found_new_2)
ADD REPLYlink modified 17 months ago • written 17 months ago by Benn8.0k

Can you please clarify where exactly do I need to make changes ? should I write so:

    data=DGElist(str(count_found_new_2),samples=sample_info,group=group_,genes=genes_)

data is like: Name of columns : N168 N145 ...

Name of rows: ENS00001
ENS00002

and values for each sample

ADD REPLYlink modified 17 months ago • written 17 months ago by XBria70

Can you check your data frame with this code, please? See if you have only integers in your data frame.

str(count_found_new_2)
ADD REPLYlink written 17 months ago by Benn8.0k

This is for one sample $ N0531 : int 1573 25 965 322 89 1095 8874 1534 3199 763 ...

ADD REPLYlink written 17 months ago by XBria70

Yeah, now you check if there is any row that isn't an int but for example a factor.

Or check it this way, and see if there is a FALSE somewhere:

apply(count_found_new_2, 2, function(x) is.integer(x))
ADD REPLYlink modified 17 months ago • written 17 months ago by Benn8.0k

I just checked. They are all integer.

sapply(count_found_new_2, typeof)

ADD REPLYlink modified 17 months ago • written 17 months ago by XBria70

Okay, then that's not the problem. Sorry I cannot help you further.

ADD REPLYlink written 17 months ago by Benn8.0k

All are FALSE. I think the TRUE value is what you mean.

ADD REPLYlink written 17 months ago by XBria70

They should all be TRUE.

ADD REPLYlink written 17 months ago by Benn8.0k

Benn,

This is what I changed and saw no error

data=DGEList(count_found_new_2[,-1],samples = sample_info, group =group_,genes = genes_ )

It seems that the first column is where the problem occurs. the name of genes I mean (ENS0000,...) Do you now have any suggestion ?

ADD REPLYlink written 17 months ago by XBria70

Okay, that was exactly what I suspected, a column in your data frame that did contain something else than integers. Be sure you only have positive integers, good luck with further analysis.

Your problem is solved, my suggestion is continue your analysis ;-)

ADD REPLYlink modified 17 months ago • written 17 months ago by Benn8.0k

Thanks :) ......................

ADD REPLYlink written 17 months ago by XBria70

Thanks :) ......................

ADD REPLYlink written 17 months ago by XBria70
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: 1601 users visited in the last hour
_