I need to do a weighted correlation network analysis on a dataset made of gene expression data of 169 samples (patients) that I downloaded from GEO, and I am trying to use the WGCNA package on R.
A colleague told me I have to collapse the probesets to genes.
I have tried to do it through the collapseRows() function, but I'm experiencing some errors.
Here's my function call:
result <- collapseRows(datET=combat_edata,
combat_edata dataframe is my output from the
ComBat() function that I used for batch correction, while the
combat_edata_genes list is the result of the retrieval of the genes associated to
"combat_edata in the
hsapiens_gene_ensembl mart, through the getBM() function.
As you can see, I used
combat_edata as my main input data, and I set
rowGroup as the list of unique genes. I set
rowID as the row names of the dataframe (features of the GEO dataset).
My call to collapseRows() returns an error:
Error: rowGroup and rowID not the same length"
Which is true. Here are the lengths of the variables:
The number of rows of my dataframe (the features of the GEO dataset) and the number of genes are different. I don't know how to handle the situation...
Do you have any idea on how to handle this issue?
How can I solve perform the collapsing of the probesets to genes correctly?
EDIT: I don't necessarily have to use collapseRows(); if you know another method and you can explain me how to use it easily, you're welcome to propose it. Thanks