Question: How to create "trait data" file for WGCNA
1
gravatar for shalinisonar13
3.7 years ago by
shalinisonar1310 wrote:

Hi,

I have mice microarray time course data. The study design as follows, mice were treated with two different kinds of drugs "a" and "b" for three time points day1, 2, 3, day0 is used as control for both the groups. Further we extracted the RNA from liver and performed microarray. Next we  wanted to do WGCNA analysis. Since we are interested to check the correlation of genes with traits I have created categorical trait but not sure whether it is a right way of doing it or no. So kindly help me with this. I have attached the trait file please have a look.

 

Mice days Treatment Condition
X315_1_1 day0 absent 1
X316_1_1 day0 absent 1
X315_1_2
day1_drug_a Treat1 2
X316_1_2
day1_drug_a Treat1 2
X315_2_4
day2_drug_a Treat1 3
X315_1_3
day2_drug_a Treat1 3
X316_1_3
day3_drug_a Treat1 4
X315_1_4
day3_drug_a Treat1 4
X316_1_4
day1_drug_b Treat2 5
X315_2_1
day1_drug_b Treat2 5
X316_2_1
day1_drug_b Treat2 5
X315_2_2
day2_drug_b Treat2 6
X316_2_2
day2_drug_b Treat2 6
X315_2_3
day3_drug_b Treat2 7
X316_2_3
day3_drug_b Treat2 7

I want to correlate the conditions with genes is it possible?  My question is can I use it as a trait file???

 

Regards,

Shalini

ADD COMMENTlink modified 3.7 years ago by Peter Langfelder2.2k • written 3.7 years ago by shalinisonar1310
Answer: How to create "trait data" file for WGCNA
0
gravatar for etycksen
3.7 years ago by
etycksen0
etycksen0 wrote:

I assume your interested in finding clusters of genes changing over time in response to two different treatments relative to baseline.  If that is the case, turn your data frame into a model matrix using just the days column, like so:

traits <- model.matrix(~day, data = traits.df)

ADD COMMENTlink written 3.7 years ago by etycksen0
Answer: How to create "trait data" file for WGCNA
0
gravatar for shalinisonar13
3.7 years ago by
shalinisonar1310 wrote:

Hi,

I was able to design a trait file. But do you think doing Intramodular analysis is logical?  Because unlike the example analysis my traits are binary. My trait file looks like this.

array day0  day1
xx1 1 0
xx2 1 0
xx3 0 1
xx4 0 1

 

ADD COMMENTlink written 3.7 years ago by shalinisonar1310
Answer: How to create "trait data" file for WGCNA
0
gravatar for Peter Langfelder
3.7 years ago by
United States
Peter Langfelder2.2k wrote:

You can certainly use correlation to relate a binary trait to a module eigengene, to genes, and you can relate intra-modular connectivity to gene-trait association statistics (some people may prefer the Student t-test or Mann-Whitney (for binary traits) or perhaps Kruskal-Wallis (for categorical traits with more than 2 levels)).

The problem with your data is that you only have two observations in most groups (I see one group with 3 observations). That's an incredibly low number to do any binary comparisons on. 

Peter

ADD COMMENTlink written 3.7 years ago by Peter Langfelder2.2k

Hi,

Thank you for the inputs. Actually we started with 3 samples per group, but some samples had issues at RNA level so had to consider only these samples. But do you think using the current sample no are not good enough to do intramodular analysis? o I should draw trait -module relationship and then look for hub gene for the modules which are significantly correlating with traits.

Shalini

ADD REPLYlink written 3.7 years ago by shalinisonar1310

Hi,

I have two modules which are significantly positively correlated with treatment "a" day1 and day2 (obtained from module-trait relationship plot). Since you mentioned my samples numbers are very low i tried to merge both day1 and day2 of treatment "a" and then did intramodular analysis. 

please help me here.

Regards,

Shalini

ADD REPLYlink modified 3.6 years ago • written 3.6 years ago by shalinisonar1310

Hello Peter,

I have a similar problem. I have 1 group of control, 4 groups of treatment (treated for 1, 2, 4, and 8 days). Each treatment/control has 3 replicates. 

If coding control as 0, and all treatment as 1, it might miss some information from treatment as they were treated for different days.

I am wondering if I can code control as 0, treated for 1 days as 2, 2 days as 3, 4 days as 4, 8 days as 6.  Is it too arbitrary?   

Thank you

Chen

ADD REPLYlink written 15 months ago by lingyun830

It depends on what question you want to ask. Do you want to see modules that relate to each treatment group vs. controls? Then create one variable for each treatment group. Call the variables groupVar1, groupVar2, groupVar4, groupVar8. Define the groupVar1 [2,4,8] variable to be 1 if the sample is treated in day 1 [2,4,8], 0 if it is a control, and NA otherwise. Then relate each variable to module eigengenes as a separate trait. 

Your numeric coding makes sense if you want to look for genes that closely follow the (0, 2, 3, 4, 6) pattern. You would miss genes that follow certain patterns of change in the middle days (1,2,4) and then go back to their original expression on day 8.

ADD REPLYlink written 15 months ago by Peter Langfelder2.2k
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 16.09
Traffic: 309 users visited in the last hour