Purpose
- Build a weighted and directed network of genes based on the Dual RNA seq data generated from the timecourse of Phytophthora cinnamomi and Lupinus angustifolius
- Determine modules (clusters of genes) from the network associated to disease progression (for example, biotrophic or necrotrophic stages)
- Extract the names of the genes from these hubs and compare them to the genes in the literature
- Functionally annotate these genes
Working idea: This network will then be used to identify hub genes for each of the early, middle and late interactions.
Load Libraries
library(WGCNA)
library(DESeq2)
library(GEOquery)
library(tidyverse)
library(gridExtra)
library(reshape2)
library(rtracklayer)
library(dplyr)
library(edgeR)
library("kableExtra")
Test kableExtra
%>% kbl() %>% kable_paper() mtcars
mpg | cyl | disp | hp | drat | wt | qsec | vs | am | gear | carb | |
---|---|---|---|---|---|---|---|---|---|---|---|
Mazda RX4 | 21.0 | 6 | 160.0 | 110 | 3.90 | 2.620 | 16.46 | 0 | 1 | 4 | 4 |
Mazda RX4 Wag | 21.0 | 6 | 160.0 | 110 | 3.90 | 2.875 | 17.02 | 0 | 1 | 4 | 4 |
Datsun 710 | 22.8 | 4 | 108.0 | 93 | 3.85 | 2.320 | 18.61 | 1 | 1 | 4 | 1 |
Hornet 4 Drive | 21.4 | 6 | 258.0 | 110 | 3.08 | 3.215 | 19.44 | 1 | 0 | 3 | 1 |
Hornet Sportabout | 18.7 | 8 | 360.0 | 175 | 3.15 | 3.440 | 17.02 | 0 | 0 | 3 | 2 |
Valiant | 18.1 | 6 | 225.0 | 105 | 2.76 | 3.460 | 20.22 | 1 | 0 | 3 | 1 |
Duster 360 | 14.3 | 8 | 360.0 | 245 | 3.21 | 3.570 | 15.84 | 0 | 0 | 3 | 4 |
Merc 240D | 24.4 | 4 | 146.7 | 62 | 3.69 | 3.190 | 20.00 | 1 | 0 | 4 | 2 |
Merc 230 | 22.8 | 4 | 140.8 | 95 | 3.92 | 3.150 | 22.90 | 1 | 0 | 4 | 2 |
Merc 280 | 19.2 | 6 | 167.6 | 123 | 3.92 | 3.440 | 18.30 | 1 | 0 | 4 | 4 |
Merc 280C | 17.8 | 6 | 167.6 | 123 | 3.92 | 3.440 | 18.90 | 1 | 0 | 4 | 4 |
Merc 450SE | 16.4 | 8 | 275.8 | 180 | 3.07 | 4.070 | 17.40 | 0 | 0 | 3 | 3 |
Merc 450SL | 17.3 | 8 | 275.8 | 180 | 3.07 | 3.730 | 17.60 | 0 | 0 | 3 | 3 |
Merc 450SLC | 15.2 | 8 | 275.8 | 180 | 3.07 | 3.780 | 18.00 | 0 | 0 | 3 | 3 |
Cadillac Fleetwood | 10.4 | 8 | 472.0 | 205 | 2.93 | 5.250 | 17.98 | 0 | 0 | 3 | 4 |
Lincoln Continental | 10.4 | 8 | 460.0 | 215 | 3.00 | 5.424 | 17.82 | 0 | 0 | 3 | 4 |
Chrysler Imperial | 14.7 | 8 | 440.0 | 230 | 3.23 | 5.345 | 17.42 | 0 | 0 | 3 | 4 |
Fiat 128 | 32.4 | 4 | 78.7 | 66 | 4.08 | 2.200 | 19.47 | 1 | 1 | 4 | 1 |
Honda Civic | 30.4 | 4 | 75.7 | 52 | 4.93 | 1.615 | 18.52 | 1 | 1 | 4 | 2 |
Toyota Corolla | 33.9 | 4 | 71.1 | 65 | 4.22 | 1.835 | 19.90 | 1 | 1 | 4 | 1 |
Toyota Corona | 21.5 | 4 | 120.1 | 97 | 3.70 | 2.465 | 20.01 | 1 | 0 | 3 | 1 |
Dodge Challenger | 15.5 | 8 | 318.0 | 150 | 2.76 | 3.520 | 16.87 | 0 | 0 | 3 | 2 |
AMC Javelin | 15.2 | 8 | 304.0 | 150 | 3.15 | 3.435 | 17.30 | 0 | 0 | 3 | 2 |
Camaro Z28 | 13.3 | 8 | 350.0 | 245 | 3.73 | 3.840 | 15.41 | 0 | 0 | 3 | 4 |
Pontiac Firebird | 19.2 | 8 | 400.0 | 175 | 3.08 | 3.845 | 17.05 | 0 | 0 | 3 | 2 |
Fiat X1-9 | 27.3 | 4 | 79.0 | 66 | 4.08 | 1.935 | 18.90 | 1 | 1 | 4 | 1 |
Porsche 914-2 | 26.0 | 4 | 120.3 | 91 | 4.43 | 2.140 | 16.70 | 0 | 1 | 5 | 2 |
Lotus Europa | 30.4 | 4 | 95.1 | 113 | 3.77 | 1.513 | 16.90 | 1 | 1 | 5 | 2 |
Ford Pantera L | 15.8 | 8 | 351.0 | 264 | 4.22 | 3.170 | 14.50 | 0 | 1 | 5 | 4 |
Ferrari Dino | 19.7 | 6 | 145.0 | 175 | 3.62 | 2.770 | 15.50 | 0 | 1 | 5 | 6 |
Maserati Bora | 15.0 | 8 | 301.0 | 335 | 3.54 | 3.570 | 14.60 | 0 | 1 | 5 | 8 |
Volvo 142E | 21.4 | 4 | 121.0 | 109 | 4.11 | 2.780 | 18.60 | 1 | 1 | 4 | 2 |
Session Information
## R version 4.3.0 (2023-04-21)
## Platform: x86_64-pc-linux-gnu (64-bit)
## Running under: Ubuntu 22.04.2 LTS
##
## Matrix products: default
## BLAS: /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.10.0
## LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.10.0
##
## locale:
## [1] LC_CTYPE=en_AU.UTF-8 LC_NUMERIC=C
## [3] LC_TIME=en_AU.UTF-8 LC_COLLATE=en_AU.UTF-8
## [5] LC_MONETARY=en_AU.UTF-8 LC_MESSAGES=en_AU.UTF-8
## [7] LC_PAPER=en_AU.UTF-8 LC_NAME=C
## [9] LC_ADDRESS=C LC_TELEPHONE=C
## [11] LC_MEASUREMENT=en_AU.UTF-8 LC_IDENTIFICATION=C
##
## time zone: Australia/Melbourne
## tzcode source: system (glibc)
##
## attached base packages:
## [1] stats4 stats graphics grDevices utils datasets methods
## [8] base
##
## other attached packages:
## [1] kableExtra_1.3.4 edgeR_3.42.2
## [3] limma_3.56.0 rtracklayer_1.60.0
## [5] reshape2_1.4.4 gridExtra_2.3
## [7] lubridate_1.9.2 forcats_1.0.0
## [9] stringr_1.5.0 dplyr_1.1.2
## [11] purrr_1.0.1 readr_2.1.4
## [13] tidyr_1.3.0 tibble_3.2.1
## [15] ggplot2_3.4.2 tidyverse_2.0.0
## [17] GEOquery_2.68.0 DESeq2_1.40.1
## [19] SummarizedExperiment_1.30.1 Biobase_2.60.0
## [21] MatrixGenerics_1.12.0 matrixStats_0.63.0
## [23] GenomicRanges_1.52.0 GenomeInfoDb_1.36.0
## [25] IRanges_2.34.0 S4Vectors_0.38.1
## [27] BiocGenerics_0.46.0 WGCNA_1.72-1
## [29] fastcluster_1.2.3 dynamicTreeCut_1.63-1
##
## loaded via a namespace (and not attached):
## [1] rstudioapi_0.14 jsonlite_1.8.4 magrittr_2.0.3
## [4] rmarkdown_2.21 BiocIO_1.10.0 zlibbioc_1.46.0
## [7] vctrs_0.6.2 memoise_2.0.1 Rsamtools_2.16.0
## [10] RCurl_1.98-1.12 prettydoc_0.4.1 base64enc_0.1-3
## [13] webshot_0.5.4 htmltools_0.5.5 S4Arrays_1.0.1
## [16] Formula_1.2-5 sass_0.4.5 bslib_0.4.2
## [19] htmlwidgets_1.6.2 plyr_1.8.8 impute_1.74.1
## [22] cachem_1.0.7 GenomicAlignments_1.36.0 lifecycle_1.0.3
## [25] iterators_1.0.14 pkgconfig_2.0.3 Matrix_1.5-4
## [28] R6_2.5.1 fastmap_1.1.1 GenomeInfoDbData_1.2.10
## [31] digest_0.6.31 colorspace_2.1-0 AnnotationDbi_1.62.1
## [34] Hmisc_5.0-1 RSQLite_2.3.1 fansi_1.0.4
## [37] timechange_0.2.0 httr_1.4.5 compiler_4.3.0
## [40] bit64_4.0.5 withr_2.5.0 doParallel_1.0.17
## [43] htmlTable_2.4.1 backports_1.4.1 BiocParallel_1.34.0
## [46] DBI_1.1.3 highr_0.10 DelayedArray_0.26.1
## [49] rjson_0.2.21 tools_4.3.0 foreign_0.8-84
## [52] nnet_7.3-18 glue_1.6.2 restfulr_0.0.15
## [55] grid_4.3.0 checkmate_2.2.0 cluster_2.1.4
## [58] generics_0.1.3 gtable_0.3.3 tzdb_0.3.0
## [61] rmdformats_1.0.4 preprocessCore_1.62.1 data.table_1.14.8
## [64] hms_1.1.3 xml2_1.3.4 utf8_1.2.3
## [67] XVector_0.40.0 foreach_1.5.2 pillar_1.9.0
## [70] splines_4.3.0 lattice_0.21-8 survival_3.5-5
## [73] bit_4.0.5 tidyselect_1.2.0 GO.db_3.17.0
## [76] locfit_1.5-9.7 Biostrings_2.68.0 knitr_1.42
## [79] bookdown_0.33 svglite_2.1.1 xfun_0.39
## [82] stringi_1.7.12 yaml_2.3.7 evaluate_0.20
## [85] codetools_0.2-19 cli_3.6.1 rpart_4.1.19
## [88] systemfonts_1.0.4 munsell_0.5.0 jquerylib_0.1.4
## [91] Rcpp_1.0.10 png_0.1-8 XML_3.99-0.14
## [94] parallel_4.3.0 blob_1.2.4 bitops_1.0-7
## [97] viridisLite_0.4.1 scales_1.2.1 crayon_1.5.2
## [100] rlang_1.1.1 KEGGREST_1.40.0 rvest_1.0.3