I need to identify genes related to a particular trait. The networkScreening function WGCNA package seemed to be suitable for this purpose. I have provided the expression data where genes correspond to columns and samples correspond to rows, and a trait vector whose length is equal to number of samples. In my data, multiple samples can belong to the same clinical trait. Though the output gives all the values for every gene, I am not being able to understand which trait the gene is associated to, as it has expression values for all samples.
1 answer
Don't use WGCNA for this (unless you actually want to incorporate the module information somehow?) - just perform an independent regression for each gene against the trait in question. This could be of the form:
glm(trait ~ gene, data = data) # continuous trait
glm(trait ~ gene, data = data, family = binomial(link = 'logit')) # categorical trait
Kevin
Log in to answer this question.