Entering edit mode
3.9 years ago
reara
▴
30
I am getting a "list" error when I try to input my values in WGCNA. I have FPKM values in my expression matrix some of which are negative (with a negative sign in front). Unsure of how to resolve this issue. Any help is appreciated.
Sorry just to clarify-these are post normalization values. Do i take it that WGCNA cannot handle negative values?
It can handle negative values, but, what I was implying was that there is perhaps something else 'wrong' with your data based on the fact that a negative FPKM expression value makes no sense, unless these are logged FPKM expression levels.
The error itself also alludes to a data structure issue. Can you show your code that produces that error, and also the output of the
str()
function run on your input expression matrix?Yes, I see what you mean. Here is what str() gave:
(However even the default WGCNA data has MMT00000044 so im not sure what is happening with my data)
Here is a photo of what my expression matrix actually looks like-
https://ibb.co/v3KdP2K
Well, there may be the problem. Your data frame is encoded categorically, i.e., as factors. You need to convert it to a data matrix or to keep it as a data frame but with everything encoded numerically.
So i tried to convert it to a numeric dataframe but this is what i got-
datExpr0 = as.data.frame(t(femData))
datExpr0 = data.matrix(datExpr0)
str(datExpr0)
also how do i get rid of the V1, V2 that R automatically seems to insert when making a dataframe?
Evidently, your object, femData, contains data that is non-numerical. You need to remove these.
Can you please confirm that you have first completed the WGCNA tutorial? Which part of the tutorial is this?
Yes, I have completed the tutorial. This is the part im having trouble with:
I see, but, if you look at the tutorial code, columns 1 to 8 are being removed via
-c(1:8)
. These are likely non-numerical columns.Yes the issue appears to be that headers (V1, V2...) which get added when you make a dataframe are causing the issue as they then make the gene IDs a non-numeric component of the df itself. I was just trying out different ways to do this, but it appears the tutorial is the only/best way to subvert this issue.
I have a pheno/triat file with only the fields i need, but still when I run the datTraits im getting NA values in my table-could this be a similar issue as above?
--remove columns that hold information we do not need.
--Form a data frame analogous to expression data that will hold the clinical traits.
Without seeing input and output for each step, I am limited in what I can do. All that I can say is to be sure that your input data has the same format as that used by the tutorial, i.e., to avoid issues elsewhere throughout the tutorial itself