diff --git a/articles/HybridExpress.html b/articles/HybridExpress.html index 2f90a24..bc1b974 100644 --- a/articles/HybridExpress.html +++ b/articles/HybridExpress.html @@ -259,19 +259,19 @@

Adding midparent expression values#> Cre01.g000300 1242 839 1216 1251 811 1785 1341 1306 1122 877 844 1082 1704 1739 #> Cre01.g000350 412 264 294 336 252 478 233 221 195 155 190 201 299 272 #> S15 S16 S17 S18 midparent1 midparent2 midparent3 midparent4 -#> Cre01.g000050 29 22 21 16 22 22 28 14 -#> Cre01.g000150 37 17 24 21 43 46 36 20 -#> Cre01.g000200 24 26 18 21 19 24 22 16 -#> Cre01.g000250 358 339 340 332 333 348 410 254 -#> Cre01.g000300 1524 1720 1517 1243 1278 1182 1434 828 -#> Cre01.g000350 276 324 246 275 264 304 340 221 +#> Cre01.g000050 29 22 21 16 16 14 18 24 +#> Cre01.g000150 37 17 24 21 26 22 32 50 +#> Cre01.g000200 24 26 18 21 14 16 19 25 +#> Cre01.g000250 358 339 340 332 269 254 310 356 +#> Cre01.g000300 1524 1720 1517 1243 966 960 1030 1292 +#> Cre01.g000350 276 324 246 275 224 232 242 322 #> midparent5 midparent6 -#> Cre01.g000050 20 14 -#> Cre01.g000150 72 31 -#> Cre01.g000200 22 17 -#> Cre01.g000250 303 216 -#> Cre01.g000300 1278 858 -#> Cre01.g000350 278 210 +#> Cre01.g000050 20 27 +#> Cre01.g000150 66 52 +#> Cre01.g000200 18 26 +#> Cre01.g000250 246 430 +#> Cre01.g000300 1064 1546 +#> Cre01.g000350 246 350 # Alternative 1: using the sum of the counts add_midparent_expression(se_chlamy, method = "sum") |> @@ -285,19 +285,19 @@

Adding midparent expression values#> Cre01.g000300 1242 839 1216 1251 811 1785 1341 1306 1122 877 844 1082 1704 1739 #> Cre01.g000350 412 264 294 336 252 478 233 221 195 155 190 201 299 272 #> S15 S16 S17 S18 midparent1 midparent2 midparent3 midparent4 -#> Cre01.g000050 29 22 21 16 32 54 48 46 -#> Cre01.g000150 37 17 24 21 81 91 101 140 -#> Cre01.g000200 24 26 18 21 39 44 50 41 -#> Cre01.g000250 358 339 340 332 668 745 712 587 -#> Cre01.g000300 1524 1720 1517 1243 2522 2662 2583 2373 -#> Cre01.g000350 276 324 246 275 515 633 645 531 +#> Cre01.g000050 29 22 21 16 32 50 34 58 +#> Cre01.g000150 37 17 24 21 68 150 70 86 +#> Cre01.g000200 24 26 18 21 32 43 38 50 +#> Cre01.g000250 358 339 340 332 554 604 527 810 +#> Cre01.g000300 1524 1720 1517 1243 2093 2592 1961 2629 +#> Cre01.g000350 276 324 246 275 449 569 459 668 #> midparent5 midparent6 -#> Cre01.g000050 29 28 -#> Cre01.g000150 39 43 -#> Cre01.g000200 31 33 -#> Cre01.g000250 508 507 -#> Cre01.g000300 1655 1921 -#> Cre01.g000350 442 465 +#> Cre01.g000050 38 25 +#> Cre01.g000150 64 57 +#> Cre01.g000200 43 32 +#> Cre01.g000250 675 557 +#> Cre01.g000300 2324 2117 +#> Cre01.g000350 613 473 # Alternative 2: using the weighted mean of the counts (weights = ploidy) w <- c(2, 1) # P1 = diploid; P2 = haploid @@ -312,19 +312,19 @@

Adding midparent expression values#> Cre01.g000300 1242 839 1216 1251 811 1785 1341 1306 1122 877 844 1082 1704 1739 #> Cre01.g000350 412 264 294 336 252 478 233 221 195 155 190 201 299 272 #> S15 S16 S17 S18 midparent1 midparent2 midparent3 midparent4 -#> Cre01.g000050 29 22 21 16 27 33 22 36 -#> Cre01.g000150 37 17 24 21 26 50 16 35 -#> Cre01.g000200 24 26 18 21 33 29 21 34 -#> Cre01.g000250 358 339 340 332 222 201 210 286 -#> Cre01.g000300 1524 1720 1517 1243 1391 1728 1532 2061 -#> Cre01.g000350 276 324 246 275 201 190 165 233 +#> Cre01.g000050 29 22 21 16 27 36 25 29 +#> Cre01.g000150 37 17 24 21 38 35 27 30 +#> Cre01.g000200 24 26 18 21 24 34 27 32 +#> Cre01.g000250 358 339 340 332 189 286 181 232 +#> Cre01.g000300 1524 1720 1517 1243 1555 2061 1453 1576 +#> Cre01.g000350 276 324 246 275 179 233 166 202 #> midparent5 midparent6 -#> Cre01.g000050 17 23 -#> Cre01.g000150 15 23 -#> Cre01.g000200 17 25 -#> Cre01.g000250 148 176 -#> Cre01.g000300 1125 1307 -#> Cre01.g000350 136 153 +#> Cre01.g000050 24 17 +#> Cre01.g000150 21 15 +#> Cre01.g000200 25 17 +#> Cre01.g000250 206 148 +#> Cre01.g000300 1373 1125 +#> Cre01.g000350 161 136

We will proceed our analyses with the midparent expression values obtained from the mean of the counts, stored in the se object.

@@ -419,19 +419,19 @@

#> ERCC-00170 97 95 73 101 70 118 186 148 110 167 110 103 72 #> ERCC-00171 4644 4959 3554 5357 4170 5946 8207 7915 4992 7843 6455 5884 4537 #> S14 S15 S16 S17 S18 midparent1 midparent2 midparent3 midparent4 -#> ERCC-00163 67 62 80 88 47 94 84 93 65 -#> ERCC-00164 4 3 5 4 2 3 0 2 4 -#> ERCC-00165 143 115 185 192 136 162 143 162 147 -#> ERCC-00168 6 2 11 5 2 4 2 4 1 -#> ERCC-00170 99 64 121 103 84 130 104 110 90 -#> ERCC-00171 5665 4598 6168 5771 4747 5880 4818 5915 5312 +#> ERCC-00163 67 62 80 88 47 72 88 67 103 +#> ERCC-00164 4 3 5 4 2 2 3 2 3 +#> ERCC-00165 143 115 185 192 136 128 142 132 192 +#> ERCC-00168 6 2 11 5 2 2 4 1 4 +#> ERCC-00170 99 64 121 103 84 90 99 92 142 +#> ERCC-00171 5665 4598 6168 5771 4747 4581 5422 5004 6426 #> midparent5 midparent6 -#> ERCC-00163 102 92 -#> ERCC-00164 2 4 -#> ERCC-00165 206 178 -#> ERCC-00168 2 5 -#> ERCC-00170 124 131 -#> ERCC-00171 6636 6401 +#> ERCC-00163 92 106 +#> ERCC-00164 2 2 +#> ERCC-00165 192 212 +#> ERCC-00168 4 4 +#> ERCC-00170 134 133 +#> ERCC-00171 6600 6930

Now, we will use get_deg_list() to get differentially expressed genes (DEGs) for each contrast while using spike-in normalization.

@@ -454,24 +454,24 @@

## Accessing gene-wise test statistics for contrast `F1_vs_P1` head(deg_list$F1_vs_P1) #> baseMean log2FoldChange lfcSE stat pvalue -#> Cre01.g000450 39.49524 -1.1632185 0.2117781 -5.492629 3.959948e-08 -#> Cre01.g000500 32.92001 0.5814708 0.2339150 2.485821 1.292530e-02 -#> Cre01.g000750 103.06457 0.8809112 0.1825994 4.824282 1.405084e-06 -#> Cre01.g000850 561.55778 -0.5622595 0.2026641 -2.774342 5.531349e-03 -#> Cre01.g000900 472.11168 0.6808258 0.2030674 3.352709 8.002484e-04 -#> Cre01.g001000 10.32087 -6.6337813 0.9147439 -7.252064 4.104686e-13 +#> Cre01.g000450 39.31366 -1.1638924 0.2021314 -5.758099 8.506640e-09 +#> Cre01.g000500 32.73765 0.5804855 0.2260330 2.568145 1.022445e-02 +#> Cre01.g000750 102.97735 0.8807983 0.1782321 4.941861 7.738022e-07 +#> Cre01.g000850 559.27880 -0.5628686 0.1848477 -3.045040 2.326491e-03 +#> Cre01.g000900 471.69643 0.6805195 0.2013453 3.379862 7.252221e-04 +#> Cre01.g001000 10.31079 -6.6339949 0.9182469 -7.224631 5.024655e-13 #> padj -#> Cre01.g000450 2.498332e-07 -#> Cre01.g000500 2.704591e-02 -#> Cre01.g000750 6.843320e-06 -#> Cre01.g000850 1.277413e-02 -#> Cre01.g000900 2.263849e-03 -#> Cre01.g001000 5.489150e-12 +#> Cre01.g000450 5.292158e-08 +#> Cre01.g000500 2.113520e-02 +#> Cre01.g000750 3.556308e-06 +#> Cre01.g000850 5.618883e-03 +#> Cre01.g000900 1.964585e-03 +#> Cre01.g001000 5.596620e-12 ## Counting the number of DEGs per contrast sapply(deg_list, nrow) #> P2_vs_P1 F1_vs_P1 F1_vs_P2 F1_vs_midparent -#> 9680 6831 8529 5716 +#> 9783 7074 8711 6013

To summarize the frequencies of up- and down-regulated genes per contrast in a single data frame, use the function get_deg_counts().

@@ -481,10 +481,10 @@

deg_counts #> contrast up down total perc_up perc_down perc_total -#> 1 P2_vs_P1 1047 8634 9680 8.1 66.6 74.7 -#> 2 F1_vs_P1 1989 4843 6831 15.3 37.4 52.7 -#> 3 F1_vs_P2 7430 1100 8529 57.3 8.5 65.8 -#> 4 F1_vs_midparent 3484 2233 5716 26.9 17.2 44.1 +#> 1 P2_vs_P1 1053 8731 9783 8.1 67.3 75.5 +#> 2 F1_vs_P1 2079 4996 7074 16.0 38.5 54.6 +#> 3 F1_vs_P2 7577 1135 8711 58.4 8.8 67.2 +#> 4 F1_vs_midparent 3742 2272 6013 28.9 17.5 46.4

It is important to note that the columns perc_up, perc_down, and perc_total show the percentages of up-regulated, down-regulated, and all differentially expressed genes @@ -515,10 +515,10 @@

deg_counts <- get_deg_counts(deg_list) deg_counts #> contrast up down total perc_up perc_down perc_total -#> 1 P2_vs_P1 1047 8634 9680 6.2 51.1 57.3 -#> 2 F1_vs_P1 1989 4843 6831 11.8 28.7 40.5 -#> 3 F1_vs_P2 7430 1100 8529 44.0 6.5 50.5 -#> 4 F1_vs_midparent 3484 2233 5716 20.6 13.2 33.9 +#> 1 P2_vs_P1 1053 8731 9783 6.2 51.7 57.9 +#> 2 F1_vs_P1 2079 4996 7074 12.3 29.6 41.9 +#> 3 F1_vs_P2 7577 1135 8711 44.9 6.7 51.6 +#> 4 F1_vs_midparent 3742 2272 6013 22.2 13.5 35.6

Finally, we can summarize everything in a single publication-ready figure using the plot plot_expression_triangle(), which shows the ‘experimental trio’ (i.e., hybrid and its progenitors) as a @@ -533,8 +533,8 @@

@@ -548,6 +548,83 @@ 

Expression-based gene classification

+

After identifying DEGs for different contrasts, you’d typically want +to classify your genes into expression partitions based on their +expression patterns. This can be performed with the function +expression_partitioning(), which classifies genes into one +of the 12 categories as in Rapp, +Udall, and Wendel (2009), and into 5 major +classes that summarize the 12 categories. The five +classes are:

+
    +
  1. +Transgressive up-regulation (UP): gene is +up-regulated in the hybrid as compared to both parents.
  2. +
  3. +Transgressive down-regulation (DOWN): gene is +down-regulated in the hybrid as compared to both parents.
  4. +
  5. +Additivity (ADD): gene expression in the hybrid is +the mean of both parents (additive effect).
  6. +
  7. +Expression-level dominance toward parent 1 +(ELD_P1): gene expression in the hybrid is the same as in +parent 1, but different from parent 2.
  8. +
  9. +Expression-level dominance toward parent 2 +(ELD_P2): gene expression in the hybrid is the same as in +parent 2, but different from parent 1.
  10. +
+
+# Classify genes in expression partitions
+exp_partitions <- expression_partitioning(deg_list)
+
+# Inspect the output
+head(exp_partitions)
+#>            Gene Category Class lFC_F1_vs_P1 lFC_F1_vs_P2
+#> 1 Cre01.g003650        1   ADD    0.7833401   -1.0484704
+#> 2 Cre01.g005150        1   ADD    1.0468778   -0.5043874
+#> 3 Cre01.g008600        1   ADD    5.0497424   -1.4856888
+#> 4 Cre01.g013500        1   ADD    2.1098246   -1.5331691
+#> 5 Cre01.g034850        1   ADD    1.5835491   -0.7610260
+#> 6 Cre01.g800005        1   ADD    1.4927376   -0.9315539
+
+# Count number of genes per category
+table(exp_partitions$Category)
+#> 
+#>    1    2    3    4    5    6    7    8    9   10   11   12 
+#>  113  292  113 3090  152  647  238  763  304  285 1681 2578
+
+# Count number of genes per class
+table(exp_partitions$Class)
+#> 
+#>     UP   DOWN    ADD ELD_P1 ELD_P2 
+#>   1562    636   2691   3394   1973
+

To visualize the expression partitions as a scatter plot of +expression divergences, you can use the function +plot_expression_partitions().

+
+# Plot partitions as a scatter plot of divergences
+plot_expression_partitions(exp_partitions, group_by = "Category")
+

+

By default, genes are grouped by Category. However, you +can also group genes by Class as follows:

+
+# Group by `Class`
+plot_expression_partitions(exp_partitions, group_by = "Class")
+

+

You can also visualize the frequencies of genes in each partition +with the function plot_partition_frequencies().

+
+# Visualize frequency of genes in each partition
+## By `Category` (default)
+plot_partition_frequencies(exp_partitions)
+

+
+
+## By `Class`
+plot_partition_frequencies(exp_partitions, group_by = "Class")
+

FAQ @@ -613,7 +690,7 @@

Session information#> glue 1.6.2 2022-02-24 [2] CRAN (R 4.3.1) #> gtable 0.3.4 2023-08-21 [1] CRAN (R 4.3.1) #> highr 0.10 2022-12-22 [2] CRAN (R 4.3.1) -#> htmltools 0.5.6.1 2023-10-06 [2] CRAN (R 4.3.1) +#> htmltools 0.5.7 2023-11-03 [1] CRAN (R 4.3.1) #> HybridExpress * 0.99.0 2023-11-03 [1] Bioconductor #> IRanges * 2.36.0 2023-10-24 [1] Bioconductor #> iterators 1.0.14 2022-02-05 [1] CRAN (R 4.3.1) diff --git a/articles/HybridExpress_files/figure-html/unnamed-chunk-11-1.png b/articles/HybridExpress_files/figure-html/unnamed-chunk-11-1.png index 49f9f25..4e21a8a 100644 Binary files a/articles/HybridExpress_files/figure-html/unnamed-chunk-11-1.png and b/articles/HybridExpress_files/figure-html/unnamed-chunk-11-1.png differ diff --git a/articles/HybridExpress_files/figure-html/unnamed-chunk-12-1.png b/articles/HybridExpress_files/figure-html/unnamed-chunk-12-1.png index 922aa95..6493277 100644 Binary files a/articles/HybridExpress_files/figure-html/unnamed-chunk-12-1.png and b/articles/HybridExpress_files/figure-html/unnamed-chunk-12-1.png differ diff --git a/articles/HybridExpress_files/figure-html/unnamed-chunk-14-1.png b/articles/HybridExpress_files/figure-html/unnamed-chunk-14-1.png new file mode 100644 index 0000000..fea09f3 Binary files /dev/null and b/articles/HybridExpress_files/figure-html/unnamed-chunk-14-1.png differ diff --git a/articles/HybridExpress_files/figure-html/unnamed-chunk-15-1.png b/articles/HybridExpress_files/figure-html/unnamed-chunk-15-1.png new file mode 100644 index 0000000..b548e5b Binary files /dev/null and b/articles/HybridExpress_files/figure-html/unnamed-chunk-15-1.png differ diff --git a/articles/HybridExpress_files/figure-html/unnamed-chunk-16-1.png b/articles/HybridExpress_files/figure-html/unnamed-chunk-16-1.png new file mode 100644 index 0000000..8411944 Binary files /dev/null and b/articles/HybridExpress_files/figure-html/unnamed-chunk-16-1.png differ diff --git a/articles/HybridExpress_files/figure-html/unnamed-chunk-16-2.png b/articles/HybridExpress_files/figure-html/unnamed-chunk-16-2.png new file mode 100644 index 0000000..da329cd Binary files /dev/null and b/articles/HybridExpress_files/figure-html/unnamed-chunk-16-2.png differ diff --git a/articles/HybridExpress_files/figure-html/unnamed-chunk-3-1.png b/articles/HybridExpress_files/figure-html/unnamed-chunk-3-1.png index 6128bd7..5311676 100644 Binary files a/articles/HybridExpress_files/figure-html/unnamed-chunk-3-1.png and b/articles/HybridExpress_files/figure-html/unnamed-chunk-3-1.png differ diff --git a/articles/HybridExpress_files/figure-html/unnamed-chunk-4-1.png b/articles/HybridExpress_files/figure-html/unnamed-chunk-4-1.png index 8202bb9..855f210 100644 Binary files a/articles/HybridExpress_files/figure-html/unnamed-chunk-4-1.png and b/articles/HybridExpress_files/figure-html/unnamed-chunk-4-1.png differ diff --git a/pkgdown.yml b/pkgdown.yml index 2d1e985..317225d 100644 --- a/pkgdown.yml +++ b/pkgdown.yml @@ -3,5 +3,5 @@ pkgdown: 2.0.7 pkgdown_sha: ~ articles: HybridExpress: HybridExpress.html -last_built: 2023-11-03T13:41Z +last_built: 2023-11-03T20:08Z diff --git a/reference/pca_plot-1.png b/reference/pca_plot-1.png index c8bfa99..0962678 100644 Binary files a/reference/pca_plot-1.png and b/reference/pca_plot-1.png differ diff --git a/reference/plot_expression_partitions-1.png b/reference/plot_expression_partitions-1.png index 571ae79..0804cac 100644 Binary files a/reference/plot_expression_partitions-1.png and b/reference/plot_expression_partitions-1.png differ diff --git a/reference/plot_partition_frequencies-1.png b/reference/plot_partition_frequencies-1.png index fb7b1f1..744b914 100644 Binary files a/reference/plot_partition_frequencies-1.png and b/reference/plot_partition_frequencies-1.png differ diff --git a/reference/plot_samplecor-1.png b/reference/plot_samplecor-1.png index 3779e3a..2a3b204 100644 Binary files a/reference/plot_samplecor-1.png and b/reference/plot_samplecor-1.png differ