# HG changeset patch # User spficklin # Date 1574387227 0 # Node ID 01ace2c8a5939c13e24b52b6ce10f6d405899f42 # Parent 26bc5ed5d4894a57b408117225d7c11aa36d6f41 Uploaded diff -r 26bc5ed5d489 -r 01ace2c8a593 aurora_wgcna_trait.Rmd --- a/aurora_wgcna_trait.Rmd Fri Nov 22 01:46:52 2019 +0000 +++ b/aurora_wgcna_trait.Rmd Fri Nov 22 01:47:07 2019 +0000 @@ -7,7 +7,7 @@ --- ```{r setup, include=FALSE, warning=FALSE, message=FALSE} -knitr::opts_chunk$set(error = TRUE, echo = FALSE) +knitr::opts_chunk$set(error = FALSE, echo = FALSE) ``` ```{r} # Load the data from the previous step. @@ -57,13 +57,17 @@ datatable(trait_data) ``` -# Module-Condition Association. +# Module-Condition Association + Now that we have trait/phenotype data, we can explore if any of the network modules are asociated with these features. First, is an empirical exploration by viewing again the sample dendrogram but with traits added and colored by category or numerical intensity, as appropriate. If groups of samples with similar expression also share similar annotations then the same colors will appear "in blocks" under the clustered samples. This view does not indicate associations but can help visualize when some modules might be associated. ```{r fig.align='center', fig.width=8, fig.height=9} # Determine the column types within the trait annotation data. trait_types = sapply(trait_data, class) + +# So that we can merge colors together with a cbind, create a +# data frame with an empty column trait_colors = data.frame(empty = rep(1:dim(trait_data)[1])) # Set the colors for the quantitative data. @@ -93,6 +97,8 @@ trait_colors = cbind(trait_colors, ordinal_colors) } +# Remove the empty column from teh trait_colors dataframe and +# reorder the colors to match the same order of columns in the trait_data df. trait_colors = subset(trait_colors, select=-c(empty)) trait_colors = trait_colors[,colnames(trait_data)] options(repr.plot.width=15, repr.plot.height=10)