DGElist ERROR: Negative counts not allowed !
0
0
Entering edit mode
4.8 years ago
XBria ▴ 90

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 • 4.8k views
ADD COMMENT
0
Entering edit mode

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 REPLY
0
Entering edit mode

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 REPLY
0
Entering edit mode

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 REPLY
0
Entering edit mode

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

ADD REPLY
0
Entering edit mode

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 REPLY
0
Entering edit mode

I just checked. They are all integer.

sapply(count_found_new_2, typeof)

ADD REPLY
0
Entering edit mode

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

ADD REPLY
0
Entering edit mode

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

ADD REPLY
0
Entering edit mode

They should all be TRUE.

ADD REPLY
0
Entering edit mode

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 REPLY
0
Entering edit mode

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 REPLY
0
Entering edit mode

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

ADD REPLY
0
Entering edit mode

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

ADD REPLY

Login before adding your answer.

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