Gallery of different plots available with myTAI
Here are example outputs of plotting functions from
myTAIv2
.
We hope these plots can inspire your analysis!
Bulk RNA-seq data
example_phyex_set
is an example
BulkPhyloExpressionSet
object.
To learn more about bringing your dataset into myTAI, follow this
vignette here:
→ 📊
myTAI plots can be modified as a ggplot2 object.
myTAI::plot_signature(example_phyex_set,
show_p_val = TRUE,
conservation_test = stat_flatline_test,
colour = "lavender") +
# as the plots are ggplot2 objects, we can simply modify them using ggplot2
ggplot2::labs(title = "Developmental stages of A. thaliana")
module_info <- list(early = 1:3, mid = 4:6, late = 7:8)
myTAI::plot_signature(example_phyex_set,
show_p_val = TRUE,
conservation_test = stat_reductive_hourglass_test,
modules = module_info,
colour = "lavender")
Transformation and robustness checks
See more here:
→ 🛡️
myTAI::plot_signature_transformed(
example_phyex_set)
## Computing: [==================== ] 49% (~1s remaining) Computing: [======================================= ] 97% (~0s remaining) Computing: [========================================] 100% (done)
## Computing: [==================== ] 49% (~1s remaining) Computing: [======================================= ] 97% (~0s remaining) Computing: [========================================] 100% (done)
## Computing: [==================== ] 48% (~1s remaining) Computing: [====================================== ] 94% (~0s remaining) Computing: [========================================] 100% (done)
## Computing: [==================== ] 48% (~1s remaining) Computing: [===================================== ] 92% (~0s remaining) Computing: [========================================] 100% (done)
## Computing: [================== ] 43% (~1s remaining) Computing: [==================================== ] 88% (~0s remaining) Computing: [========================================] 100% (done)
myTAI::plot_signature_gene_quantiles(
example_phyex_set)
Statistical tests and plotting results
See more here:
→ 📈
myTAI::stat_flatline_test(
example_phyex_set, plot_result = TRUE)
##
## Statistical Test Result
## =======================
## Method: Flat Line Test
## Test statistic: 0.164405
## P-value: 0.4755228
## Alternative hypothesis: greater
## Data: Embryogenesis 2019
res_flt <- myTAI::stat_flatline_test(example_phyex_set, plot_result = FALSE)
myTAI::plot_cullen_frey(res_flt)
## summary statistics
## ------
## min: 0.002580694 max: 3.953036
## median: 0.1555222
## mean: 0.2509132
## estimated sd: 0.299606
## estimated skewness: 3.27823
## estimated kurtosis: 20.12338
myTAI::plot_null_txi_sample(res_flt) +
ggplot2::guides(x = guide_axis(angle = 90))
module_info <- list(early = 1:3, mid = 4:6, late = 7:8)
myTAI::stat_reductive_hourglass_test(
example_phyex_set, plot_result = TRUE,
modules = module_info)
##
## Statistical Test Result
## =======================
## Method: Reductive Hourglass Test
## Test statistic: 0.3747398
## P-value: 0.03720072
## Alternative hypothesis: greater
## Data: Embryogenesis 2019
Average gene expression level by phylostratum
myTAI::plot_strata_expression(example_phyex_set)
plot_strata_expression
with scaled y axis
myTAI::plot_strata_expression(example_phyex_set) +
ggplot2::scale_y_log10() +
ggplot2::labs(x = "Expression aggregated by mean (log-scaled)")
plot_strata_expression
with explicit transformation
library(patchwork)
p1 <- myTAI::plot_strata_expression(example_phyex_set |> myTAI::tf(log1p))
# equivalent to
p2 <- example_phyex_set |> myTAI::tf(log1p) |> myTAI::plot_strata_expression()
p1+p2
As you can see, both plots are identical. This example demonstrates
that there are multiple ways to achieve the same result through piping
(|>
) operator in R. |>
is basically the
same as %>%
.
Contribution to the overall TAI by phylostratum
myTAI::plot_contribution(example_phyex_set)
Curious about methods to obtain gene age information? See more
here:
→ 📚
For other analogous methods to assign evolutionary or expression
information to each gene for TDI, TSI etc., see here:
→ 🧬
myTAI::plot_distribution_expression(example_phyex_set)
Contribution to the overall TAI by partial TAI (pTAI)
pTAI
, or
where
denotes the expression level of a given gene
in sample
,
is its gene age assignment, and
is the total number of genes, is the per-gene contribution to the
overall TAI
. (Summing pTAI
across all genes
gives in a given sample
gives the overall
)
pTAI
QQ plot compares the partial TAI distributions of
various developmental stages against a reference stage (default is stage
1).
myTAI::plot_distribution_pTAI_qqplot(example_phyex_set)
Phylostratum distribution
myTAI::plot_distribution_strata(example_phyex_set@strata) /
myTAI::plot_distribution_strata(
example_phyex_set@strata,
selected_gene_ids = myTAI::genes_top_variance(example_phyex_set, p = 0.95),
as_log_obs_exp = TRUE
) + plot_annotation(title = "Distribution of gene ages (top), Observed vs Expected plot of top 5% variance genes (bottom)")
Expression heatmap
myTAI::plot_gene_heatmap(example_phyex_set)
myTAI::plot_gene_heatmap(example_phyex_set, cluster_rows = TRUE, show_reps=TRUE, show_gene_ids=TRUE, top_p=0.005)
myTAI::plot_gene_heatmap(example_phyex_set, cluster_rows = TRUE, show_reps=TRUE, top_p=0.005, std=FALSE, show_gene_ids=TRUE)
Dimension reduction
At the gene level
myTAI::plot_gene_space(example_phyex_set)
myTAI::plot_gene_space(example_phyex_set,colour_by = "strata")
At the sample level
myTAI::plot_sample_space(example_phyex_set) | myTAI::plot_sample_space(example_phyex_set, colour_by = "TXI")
# we can even do a UMAP
myTAI::plot_sample_space(example_phyex_set, method = "UMAP")
Inspecting mean-variance relationship
# highlighting top variance genes
top_var_genes <- myTAI::genes_top_variance(example_phyex_set, p = 0.9995)
p1 <- myTAI::plot_mean_var(example_phyex_set)
p2 <- myTAI::plot_mean_var(example_phyex_set,
highlight_genes = top_var_genes)
p1 + p2 + plot_annotation(title = "Mean-variance: simple vs. highlighted top variance genes")
# with log transform and colouring by phylostratum
myTAI::plot_mean_var(example_phyex_set |> myTAI::tf(log1p),
colour_by = "strata") +
ggplot2::guides(colour = guide_legend(ncol=2))
Individual gene expression profiles
# side by side: manual coloring vs strata coloring
p1 <- myTAI::plot_gene_profiles(example_phyex_set, max_genes = 10, colour_by = "manual")
p2 <- myTAI::plot_gene_profiles(example_phyex_set, max_genes = 10, colour_by = "strata")
p1 + p2 + plot_annotation(title = "Gene profiles: manual vs. strata coloring")
# stage colouring with standardized log transformation
myTAI::plot_gene_profiles(example_phyex_set, max_genes = 10,
transformation = "std_log", colour_by = "stage")
# faceted by phylostratum
myTAI::plot_gene_profiles(example_phyex_set, max_genes = 1000,
colour_by = "strata", facet_by_strata = TRUE, show_set_mean = TRUE,
show_labels = FALSE)
These plots are examples of plots that myTAIv2
can
generate. To check out the functions, use ?
before the
function (i.e. ?myTAI::plot_mean_var()
.
You can also find a list of plotting functions in Reference
.