tTEscanR Visualization Module


1. Overview

tTEscanR includes a dedicated visualization module that provides multiple functions for generating plots based on the output tables produced at each step of the analysis. The primary goal of this module is to facilitate a more intuitive and streamlined interpretation of results, allowing researchers to easily explore and understand their data. Additionally, it helps summarize complex findings in a visually accessible manner, enhancing the overall clarity and impact of the analysis.

# install.packages("/avarassanchez/tTEscanR")
library(tTEscanR)
library(dplyr)

To illustrate the usage of each plotting function and demonstrate the flexibility provided by various parameters, we will first run tTEscanR. In this tutorial, we will analyze a single-cell fetal human atlas described in (Cao et al. 2020) and (Domcke et al. 2020), and previously examined by (Gao et al. 2022). A subset of this dataset is included as a default dataset in tTEscanR and can be directly loaded to performm the analysis. A step-by-step explanation of this pipeline is available in the tTEscanR User Guide vignette.

data(
    default_tTEscanR_mRNA_data,
    default_tTEscanR_tRNA_data,
    default_tTEscanR_metadata
)
tTEobject <- runPipeline(
    mRNA_data = default_tTEscanR_mRNA_data,
    tRNA_data = default_tTEscanR_tRNA_data,
    metadata = default_tTEscanR_metadata,
    species = "hg38", batch = "tissue",
    runDESeq = FALSE, verbose = FALSE
)
#>   |                                                                              |                                                                      |   0%  |                                                                              |=                                                                     |   1%  |                                                                              |==                                                                    |   2%  |                                                                              |==                                                                    |   4%  |                                                                              |===                                                                   |   5%  |                                                                              |====                                                                  |   6%  |                                                                              |=====                                                                 |   7%  |                                                                              |======                                                                |   8%  |                                                                              |=======                                                               |   9%  |                                                                              |=======                                                               |  11%  |                                                                              |========                                                              |  12%  |                                                                              |=========                                                             |  13%  |                                                                              |==========                                                            |  14%  |                                                                              |===========                                                           |  15%  |                                                                              |============                                                          |  16%  |                                                                              |============                                                          |  18%  |                                                                              |=============                                                         |  19%  |                                                                              |==============                                                        |  20%  |                                                                              |===============                                                       |  21%  |                                                                              |================                                                      |  22%  |                                                                              |================                                                      |  24%  |                                                                              |=================                                                     |  25%  |                                                                              |==================                                                    |  26%  |                                                                              |===================                                                   |  27%  |                                                                              |====================                                                  |  28%  |                                                                              |=====================                                                 |  29%  |                                                                              |=====================                                                 |  31%  |                                                                              |======================                                                |  32%  |                                                                              |=======================                                               |  33%  |                                                                              |========================                                              |  34%  |                                                                              |=========================                                             |  35%  |                                                                              |==========================                                            |  36%  |                                                                              |==========================                                            |  38%  |                                                                              |===========================                                           |  39%  |                                                                              |============================                                          |  40%  |                                                                              |=============================                                         |  41%  |                                                                              |==============================                                        |  42%  |                                                                              |==============================                                        |  44%  |                                                                              |===============================                                       |  45%  |                                                                              |================================                                      |  46%  |                                                                              |=================================                                     |  47%  |                                                                              |==================================                                    |  48%  |                                                                              |===================================                                   |  49%  |                                                                              |===================================                                   |  51%  |                                                                              |====================================                                  |  52%  |                                                                              |=====================================                                 |  53%  |                                                                              |======================================                                |  54%  |                                                                              |=======================================                               |  55%  |                                                                              |========================================                              |  56%  |                                                                              |========================================                              |  58%  |                                                                              |=========================================                             |  59%  |                                                                              |==========================================                            |  60%  |                                                                              |===========================================                           |  61%  |                                                                              |============================================                          |  62%  |                                                                              |============================================                          |  64%  |                                                                              |=============================================                         |  65%  |                                                                              |==============================================                        |  66%  |                                                                              |===============================================                       |  67%  |                                                                              |================================================                      |  68%  |                                                                              |=================================================                     |  69%  |                                                                              |=================================================                     |  71%  |                                                                              |==================================================                    |  72%  |                                                                              |===================================================                   |  73%  |                                                                              |====================================================                  |  74%  |                                                                              |=====================================================                 |  75%  |                                                                              |======================================================                |  76%  |                                                                              |======================================================                |  78%  |                                                                              |=======================================================               |  79%  |                                                                              |========================================================              |  80%  |                                                                              |=========================================================             |  81%  |                                                                              |==========================================================            |  82%  |                                                                              |==========================================================            |  84%  |                                                                              |===========================================================           |  85%  |                                                                              |============================================================          |  86%  |                                                                              |=============================================================         |  87%  |                                                                              |==============================================================        |  88%  |                                                                              |===============================================================       |  89%  |                                                                              |===============================================================       |  91%  |                                                                              |================================================================      |  92%  |                                                                              |=================================================================     |  93%  |                                                                              |==================================================================    |  94%  |                                                                              |===================================================================   |  95%  |                                                                              |====================================================================  |  96%  |                                                                              |====================================================================  |  98%  |                                                                              |===================================================================== |  99%  |                                                                              |======================================================================| 100%
#>   |                                                                              |                                                                      |   0%  |                                                                              |=                                                                     |   1%  |                                                                              |==                                                                    |   2%  |                                                                              |==                                                                    |   4%  |                                                                              |===                                                                   |   5%  |                                                                              |====                                                                  |   6%  |                                                                              |=====                                                                 |   7%  |                                                                              |======                                                                |   8%  |                                                                              |=======                                                               |   9%  |                                                                              |=======                                                               |  11%  |                                                                              |========                                                              |  12%  |                                                                              |=========                                                             |  13%  |                                                                              |==========                                                            |  14%  |                                                                              |===========                                                           |  15%  |                                                                              |============                                                          |  16%  |                                                                              |============                                                          |  18%  |                                                                              |=============                                                         |  19%  |                                                                              |==============                                                        |  20%  |                                                                              |===============                                                       |  21%  |                                                                              |================                                                      |  22%  |                                                                              |================                                                      |  24%  |                                                                              |=================                                                     |  25%  |                                                                              |==================                                                    |  26%  |                                                                              |===================                                                   |  27%  |                                                                              |====================                                                  |  28%  |                                                                              |=====================                                                 |  29%  |                                                                              |=====================                                                 |  31%  |                                                                              |======================                                                |  32%  |                                                                              |=======================                                               |  33%  |                                                                              |========================                                              |  34%  |                                                                              |=========================                                             |  35%  |                                                                              |==========================                                            |  36%  |                                                                              |==========================                                            |  38%  |                                                                              |===========================                                           |  39%  |                                                                              |============================                                          |  40%  |                                                                              |=============================                                         |  41%  |                                                                              |==============================                                        |  42%  |                                                                              |==============================                                        |  44%  |                                                                              |===============================                                       |  45%  |                                                                              |================================                                      |  46%  |                                                                              |=================================                                     |  47%  |                                                                              |==================================                                    |  48%  |                                                                              |===================================                                   |  49%  |                                                                              |===================================                                   |  51%  |                                                                              |====================================                                  |  52%  |                                                                              |=====================================                                 |  53%  |                                                                              |======================================                                |  54%  |                                                                              |=======================================                               |  55%  |                                                                              |========================================                              |  56%  |                                                                              |========================================                              |  58%  |                                                                              |=========================================                             |  59%  |                                                                              |==========================================                            |  60%  |                                                                              |===========================================                           |  61%  |                                                                              |============================================                          |  62%  |                                                                              |============================================                          |  64%  |                                                                              |=============================================                         |  65%  |                                                                              |==============================================                        |  66%  |                                                                              |===============================================                       |  67%  |                                                                              |================================================                      |  68%  |                                                                              |=================================================                     |  69%  |                                                                              |=================================================                     |  71%  |                                                                              |==================================================                    |  72%  |                                                                              |===================================================                   |  73%  |                                                                              |====================================================                  |  74%  |                                                                              |=====================================================                 |  75%  |                                                                              |======================================================                |  76%  |                                                                              |======================================================                |  78%  |                                                                              |=======================================================               |  79%  |                                                                              |========================================================              |  80%  |                                                                              |=========================================================             |  81%  |                                                                              |==========================================================            |  82%  |                                                                              |==========================================================            |  84%  |                                                                              |===========================================================           |  85%  |                                                                              |============================================================          |  86%  |                                                                              |=============================================================         |  87%  |                                                                              |==============================================================        |  88%  |                                                                              |===============================================================       |  89%  |                                                                              |===============================================================       |  91%  |                                                                              |================================================================      |  92%  |                                                                              |=================================================================     |  93%  |                                                                              |==================================================================    |  94%  |                                                                              |===================================================================   |  95%  |                                                                              |====================================================================  |  96%  |                                                                              |====================================================================  |  98%  |                                                                              |===================================================================== |  99%  |                                                                              |======================================================================| 100%

2. Configuration options

The visualization functions in tTEscanR are highly customizable and can be applied to any properly formatted dataset. Depending on the plot type, specific data requirements must be met, which may involve prior data transformation or restructuring.

This guide provides an overview of the available visualization options in tTEscanR, and illustrates key parameter settings and their effects through practical examples.

The visualization functions in tTEscanR are not limited to outputs generated within the package’s pipeline. Users can apply them to external dataset, provided that the required data formatting and structure are met.

Function Purpose
plotProportion() Shows features’ frequencies differences within and
between conditions
plotDistribution() Displays features’ distributions across
conditions
plotTargetComparison() Variation of plotDistribution() to
compare a target feature against the mean across conditions
plotCorrelation() Features correlation
plotPermutation() Compares the baseline codon exonic background
against the current codon usage
plotTEscore() Represents the tTE scores obtained from Compute_tTE()

2.1. Data transformation

There are helper functions in tTEscanR designed to properly transform data for downstream analysis and visualization. the data. One such function is transformFormat(), which converts a count matrix, with features as rows and conditions as columns, into a long-format table. In this format, each row-column combination from the original matrix becomes an individual row in the output.

The function also provides an option to normalize the input data. Parameters such as rownames_to_column, names_to and values_to allow users to customize the names of the columns in the resulting long-format table.

The normalization performed by transformFormat() is done by converting the raw counts into relative abundances (i.e. dividing each column by its column-wise sum).

head(getAssay(tTEobject, "CodonUsage"))
long_format_codon_usage <- transformFormat(
    data = getAssay(tTEobject, "CodonUsage"), normalize = TRUE,
    rownames_to_column = "codon", # features (row) of the CodonUsage matrix
    names_to = "condition", # conditions (col) of the CodonUsage matrix
    values_to = "usage"
) # values of the CodonUsage matrix

# long_format_codon_usage contains 3 columns: codon, condition, usage
# We are going to divide the condition column into tissue and cell_type
long_format_codon_usage <- long_format_codon_usage %>%
    tidyr::separate(.data$condition, into = c("tissue", "cell_type"), sep = "-")
head(long_format_codon_usage)
long_format_AA_demand <- transformFormat(
    data = getAssay(tTEobject, "AADemand"), normalize = TRUE,
    rownames_to_column = "AA", # features (row) of the AADemand matrix
    names_to = "condition", # conditions (col) of the AADemand matrix
    values_to = "demand"
) # values of the AADemand matrix

# long_format_AA_demand contains 3 columns: AA, condition, demand
# We are going to divide the condition column into tissue and cell_type
long_format_AA_demand <- long_format_AA_demand %>%
    tidyr::separate(.data$condition, into = c("tissue", "cell_type"), sep = "-")

2.2. Parameters

To enhance usability, parameters’ names and structures have been kept consistent across functions with most parameters being shared among them. This standardization simplifies customization and ensures an intuitive workflow.

Parameter | Description

|————————|————————————————-| | data | Properly formatted dataset | | plot | A character string indicating the type of plot to generate | | ncols | Numeric; Number of columns for arranging panels. Defaults to 1 | | x_axis_col | Name of the column in data to use for the x-axis | | y_axis_col | Name of the column in data to use for the y-axis | | condition_col | Name of the column in data to use for coloring/grouping by condition | | targeted_arg | Optional; A vector defining key feature clusters to highlight or label. | | color_palette | Optional; A vector of color codes to customize plot appearance | | save_format | Optional; A character string indicating the format for saving the plot. Supported formats: “png” or “pdf” | | out_name | Optional; Name for the saved plot (if save_format specified) | | out_directory | Optional; Path to the directory where the plot will be saved (if save_format specified) | | show_legend | A character string specifying the position of the legend. Supported formats: “none” (default), “top”, “bottom”, “right” and “left” | | add_titles | Logical; if TRUE, includes titles in the plot. Defaults to TRUE |

  • Function-specific parameters will be introduced within each plot’s corresponding description section.
  • Not all generic parameters are required by every function; usage depends on the specific plotting context.
  • The values provided for x_axis_col, y_axis_col and condition_col must exactly match the column names in the input data.

  • 3. Visualization options

    The plotDistribution() function generates jitter plots, barplots or boxplots to visualize data distributions (e.g. raw or normalize codon usage) across features (e.g. codons). This function provides an intuitive representation of how usage patterns vary across conditions. The type of plot can be specified via the plot argument, while layout and grouping can be controlled using the panels parameter.

    In the example below, we visualize normalized codon usage across conditions to explore how codon preferences fluctuate. The dataset is a single-cell dataset, where each cell is annotated by its type and tissue of origin. As a general guideline, the jitter plot mode is well-suited for large datasets, as it allows users to observe the distribution of values at a general level and identify patterns across groups.

    # Codon usage distribution plot (jitter)
    plotDistribution(
        data = long_format_codon_usage, plot = "jitter", x_axis_col = "codon",
        y_axis_col = "usage", condition_col = "tissue", show_legend = "right",
        add_titles = FALSE
    )

    Alternatively, to reduce dataset complexity and enable more in-depth analysis, we can focus on a subset of target conditions. In this example, we restrict the analysis to spleen-derived cells, specifically selecting those belonging to the lymphoid and myeloid lineages. For this approach we can use a barplot plot mode.

    # Data subset: spleen tissue and selected cell types (lymphoid and myeloid)
    spleen_indexes <- grep("Spleen", long_format_codon_usage$tissue)
    long_format_cu_spleen <- long_format_codon_usage[spleen_indexes, ]
    
    lymphoid_indexes <- grep("Lymphoid", long_format_cu_spleen$cell_type)
    myeloid_indexes <- grep("Myeloid", long_format_cu_spleen$cell_type)
    
    cells_indexes <- c(lymphoid_indexes, myeloid_indexes)
    
    long_format_codon_usage_subset <- long_format_cu_spleen[cells_indexes, ]

    To facilitate visualization, we enable the panels parameter in plotDistribution, which arranges each condition in a separate facet. This separation allows for easier comparison across groups. Additionally, the ncols parameter controls the number of columns used in the facet layout, helping optimize the plot’s readability, especially when working with multiple conditions.

    # Codon usage distribution plot (barplot)
    plotDistribution(
        data = long_format_codon_usage_subset, plot = "barplot", ncols = 1,
        facet_col = "cell_type",
        x_axis_col = "codon", y_axis_col = "usage", condition_col = "cell_type",
        show_legend = "none", add_titles = FALSE
    )

    If, instead of comparing the distributions of two cell types within the same tissue, we want to explore how distributions vary across two different tissues, we can switch to the boxplot mode. This plot type summarizes the variation and central tendency of the data, making it easier to compare distribution between broader biological groups.

    # Data subset: specific codons in spleen and heart tissues
    spleen_indexes <- grep("Spleen", long_format_codon_usage$tissue)
    heart_indexes <- grep("Heart", long_format_codon_usage$tissue)
    
    tissue_indexes <- c(spleen_indexes, heart_indexes)
    
    long_format_cu_tissues <- long_format_codon_usage[tissue_indexes, ]
    
    selected_codons <- c(
        "CAA", "CAC", "CAG", "CAT", "CCA", "CCC", "CCG", "CCT", "CGA", "CGC",
        "CGG", "CGT", "CTA", "CTC", "CTG", "CTT", "GAA", "GAC", "GAG", "GAT",
        "GCA", "GCC", "GCG", "GCT", "GGA", "GGC", "GGG", "GGT", "GTA", "GTC",
        "GTG", "GTT"
    )
    
    codons_indexes <- which(long_format_cu_tissues$codon %in% selected_codons)
    long_format_cu_tissues <- long_format_cu_tissues[codons_indexes, ]

    In this example, we introduce a pre-defined color_palette to explicitly assign specific colors to each of the tissues being analyzed.

    # Codon usage distribution plot (barplot)
    plotDistribution(
        data = long_format_cu_tissues, plot = "boxplot",
        x_axis_col = "codon", y_axis_col = "usage", add_stats = FALSE,
        condition_col = "tissue",
        color_palette = c(Heart = "#de77ae", Spleen = "#7fbc41"),
        show_legend = "bottom", add_titles = FALSE
    )


    The plotTargetComparison() function extends the functionality of plotDistribution() by allowing direct comparison between a target confition and the overall mean. This visualization helps identify how codon, anticodon, or amino acid usage in the selected condition deviates from the average profile.

    Function-specific parameters:

  • mean - A numeric vector containing the mean values of the codons/anticodon/amino acids present in data.
  • show_difference - Logical; if TRUE, displays the differences between the mean and the targeted values.
  • In the following example, we focus on cells from the cerebellum. To enable a proper comparison, we first subset the dataset to include only cerebellum-specific data and then compute the mean codon usage using computeMeanUsage(). The overall mean codon usage was previously obtained during the initial execution of runPipeline().

    # Data subset: mean codon usage across cerebellum cell types
    codon_usage <- getAssay(tTEobject, "CodonUsage")
    cerebellum_indexes <- grep("Cerebellum", colnames(codon_usage))
    cerebrum_indexes <- grep("Cerebrum", colnames(codon_usage))
    brain_indexes <- c(cerebellum_indexes, cerebrum_indexes)
    brain_codon_usage <- codon_usage[, brain_indexes]
    
    # Define the metadata
    metadata_brain <- data.frame(
        label = colnames(brain_codon_usage), stringsAsFactors = FALSE
    )
    metadata_brain <- tidyr::separate(
        metadata_brain, label,
        into = c("tissue", "cell.type"), sep = "-"
    )
    metadata_brain$conditions <- colnames(brain_codon_usage)
    
    mean_brain_codon_usage <- computeMeanUsage(
        data = brain_codon_usage, metadata = metadata_brain,
        batch = "tissue", verbose = FALSE
    )
    #> - Detected metadata column: 'conditions'
    #> - Final dataset contains 18 unique samples.
    #> estimating size factors
    #> estimating dispersions
    #> gene-wise dispersion estimates
    #> mean-dispersion relationship
    #> final dispersion estimates
    #> fitting model and testing

    Based on the calculations above, the plot illustrates: (i) the mean codon usage of the cerebellum cells as purple dots, (ii) the overall mean codon usage across conditions as grey bars, and (iii) the difference between the two as blue lines.

    additional_metrics <- getMetadata(tTEobject, "CodonUsage_AdditionalMetrics")
    plotTargetComparison(
        target_data = data.frame(mean_brain_codon_usage),
        overall_data = data.frame(additional_metrics$MeanCodonUsage),
        x_axis_col = "feature", y_axis_col = "mean_usage_across_conditions",
        show_difference = TRUE, add_titles = FALSE
    )


    The plotProportion() function provides a summary visualization of a specific metric’s distribution across features or conditions. It supports multiple display modes, including bar, radar or donut plots, allowing users to choose the most effective format for their data.

    The choice of plot type in this and other functions within tTEscanR is left to the user’s discretion, depending on the nature of the data (e.g. number of features, distribution of counts) and the specific research question being addressed.

    mean_codon_usage <- additional_metrics$MeanCodonUsage
    mean_codon_usage$codon <- mean_codon_usage$feature
    
    mean_codon_usage <- featuresToAA(
        data = mean_codon_usage, position = "feature",
        notation_from = "codon", notation_to = "aa", verbose = FALSE
    )
    plotProportion(
        data = mean_codon_usage, plot = "bar",
        var_numerical = "mean_usage_across_conditions",
        var_categorical = "codon", var_color = "feature", show_legend = "none"
    ) # Here feature corresponds to AA
    #> $plot

    # Data subset: mean codon usage across cerebellum cell types
    aa_demand <- getAssay(tTEobject, "AADemand")
    cerebellum_indexes_AA <- grep("Cerebellum", colnames(aa_demand))
    cerebrum_indexes_AA <- grep("Cerebrum", colnames(aa_demand))
    brain_indexes_AA <- c(cerebellum_indexes_AA, cerebrum_indexes_AA)
    brain_AAdemand <- aa_demand[, brain_indexes_AA]
    
    mean_brain_AAdemand <- computeMeanUsage(
        data = brain_AAdemand, metadata = metadata_brain,
        batch = "tissue", verbose = FALSE
    )
    #> - Detected metadata column: 'conditions'
    #> - Final dataset contains 18 unique samples.
    #> estimating size factors
    #> estimating dispersions
    #> gene-wise dispersion estimates
    #> mean-dispersion relationship
    #> -- note: fitType='parametric', but the dispersion trend was not well captured by the
    #>    function: y = a/x + b, and a local regression fit was automatically substituted.
    #>    specify fitType='local' or 'mean' to avoid this message next time.
    #> final dispersion estimates
    #> fitting model and testing
    plotProportion(
        data = mean_brain_AAdemand, plot = "donut",
        var_numerical = "mean_usage_across_conditions",
        var_categorical = "feature", show_legend = "none"
    ) # Here feature corresponds to AA
    #> $plot


    The plotTEscore() function generates a violin plot to compare the tTE scores between a specified target condition and all other conditions in the dataset. This visualization helps assess how distinct the translation efficiency profile of the target group is relative to the rest.

    As plotTEscore() uses violin plots, it is important to ensure that each group, especially the targeted condition, has a sufficient number of data points. Violin plots may not provide a reliable representation of the distribution if the sample size is too small. Alternatively, plotDistribution and plotProportion() could be used.

    conditions_metadata <- getMetadata(tTEobject, "ConditionsLabels")
    tTEresults_codon <- getMetadata(tTEobject, "tTEresults_codon")
    tTEresults_AA <- getMetadata(tTEobject, "tTEresults_AA")
    plotTEscore(
        data = tTEresults_codon, metadata = conditions_metadata,
        index_col = "conditions", class_col = "tissue", add_stats = FALSE
    )
    #> Warning in defineMergedData(data = data, meta = metadata, index = index_col, :
    #> One or more groups have fewer than 2 samples. Statistics (p-values) will return
    #> NA.
    #> $plot
    #> Warning: Groups with fewer than two datapoints have been dropped.
    #> ℹ Set `drop = FALSE` to consider such groups for position adjustment purposes.

    #> 
    #> $stats
    #> NULL
    # Targeted condition: lymphoid and myeloid cells
    conditions_metadata$group <- "other"
    conditions_metadata$group[
        grep("Myeloid", conditions_metadata$conditions)
    ] <- "myeloid"
    conditions_metadata$group[
        grep("Lymphoid", conditions_metadata$conditions)
    ] <- "lymphoid"
    # input data has 4 columns: condition, tTE, p_value, neg_log10_tTE_p_value
    # Codon-anticodon tTE score
    plotTEscore(
        data = tTEresults_codon, metadata = conditions_metadata,
        index_col = "conditions", class_col = "group",
        color_palette = c(
            myeloid = "#abd9e9", lymphoid = "#f1b6da", other = "#fee0b6"
        ),
        add_stats = TRUE
    )
    #> $plot

    #> 
    #> $stats
    #>     group1  group2   p_value          comparison p_signif   class
    #> 1 lymphoid myeloid 0.7922078 lymphoid_vs_myeloid       ns myeloid
    #> 2 lymphoid   other 0.5128688   lymphoid_vs_other       ns   other
    #> 3  myeloid   other 0.2770987    myeloid_vs_other       ns   other
    
    # AA demand-supply tTE score
    plotTEscore(
        data = tTEresults_AA, metadata = conditions_metadata,
        index_col = "conditions", class_col = "group",
        color_palette = c(
            myeloid = "#abd9e9", lymphoid = "#f1b6da", other = "#fee0b6"
        ),
        add_stats = FALSE
    )
    #> $plot

    #> 
    #> $stats
    #> NULL

    In cases where we want to refine the selection of target cell types, such as including or excluding specific subtypes, it is essential to encode this distinction explicitly in the input metadata (targets) data frame.

    For instance, if we aim to focus on neurons but exclude cells labeled as ENS neurons, we need to assign those excluded cells to a different category, referred to as “other” in the metadata. This ensures the function correctly recognizes which cells belong to the target group and which do not.

    # Targeted condition: neurons
    conditions_metadata$group <- "other"
    conditions_metadata$group[grep(
        "neuron", conditions_metadata$conditions
    )] <- "neurons"
    conditions_metadata$group[grep(
        "ENS neuron", conditions_metadata$conditions
    )] <- "other"
    # AA demand-supply tTE score
    plotTEscore(
        data = tTEresults_AA, metadata = conditions_metadata,
        index_col = "conditions", class_col = "group",
        color_palette = c(neurons = "#8073ac", other = "#fee0b6"),
        add_stats = TRUE
    )
    #> $plot

    #> 
    #> $stats
    #>    group1 group2    p_value       comparison p_signif class
    #> 1 neurons  other 0.02818374 neurons_vs_other        * other

    4. References

    #> R version 4.6.1 (2026-06-24)
    #> Platform: x86_64-pc-linux-gnu
    #> Running under: Ubuntu 26.04 LTS
    #> 
    #> Matrix products: default
    #> BLAS:   /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3 
    #> LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.32.so;  LAPACK version 3.12.0
    #> 
    #> locale:
    #>  [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
    #>  [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
    #>  [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
    #>  [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
    #>  [9] LC_ADDRESS=C               LC_TELEPHONE=C            
    #> [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       
    #> 
    #> time zone: Etc/UTC
    #> tzcode source: system (glibc)
    #> 
    #> attached base packages:
    #> [1] stats4    stats     graphics  grDevices utils     datasets  methods  
    #> [8] base     
    #> 
    #> other attached packages:
    #>  [1] Seurat_5.5.1         SeuratObject_5.4.0   sp_2.2-1            
    #>  [4] Signac_1.17.1        Rsamtools_2.29.0     Biostrings_2.81.3   
    #>  [7] XVector_0.53.0       GenomicRanges_1.65.0 IRanges_2.47.2      
    #> [10] S4Vectors_0.51.5     Seqinfo_1.3.0        BiocGenerics_0.59.8 
    #> [13] generics_0.1.4       Matrix_1.7-5         dplyr_1.2.1         
    #> [16] biomaRt_2.69.0       tTEscanR_0.99.0      BiocStyle_2.41.0    
    #> 
    #> loaded via a namespace (and not attached):
    #>   [1] RcppAnnoy_0.0.23            splines_4.6.1              
    #>   [3] later_1.4.8                 bitops_1.0-9               
    #>   [5] filelock_1.0.3              tibble_3.3.1               
    #>   [7] polyclip_1.10-7             fastDummies_1.7.6          
    #>   [9] lifecycle_1.0.5             httr2_1.2.3                
    #>  [11] rstatix_0.7.3               globals_0.19.1             
    #>  [13] lattice_0.22-9              MASS_7.3-65                
    #>  [15] backports_1.5.1             magrittr_2.0.5             
    #>  [17] plotly_4.12.0               sass_0.4.10                
    #>  [19] rmarkdown_2.31              jquerylib_0.1.4            
    #>  [21] yaml_2.3.12                 httpuv_1.6.17              
    #>  [23] otel_0.2.0                  sctransform_0.4.3          
    #>  [25] spam_2.11-4                 spatstat.sparse_3.2-0      
    #>  [27] reticulate_1.46.0           cowplot_1.2.0              
    #>  [29] pbapply_1.7-4               DBI_1.3.0                  
    #>  [31] buildtools_1.0.0            RColorBrewer_1.1-3         
    #>  [33] abind_1.4-8                 Rtsne_0.17                 
    #>  [35] purrr_1.2.2                 rappdirs_0.3.4             
    #>  [37] ggrepel_0.9.8               irlba_2.3.7                
    #>  [39] spatstat.utils_3.2-3        listenv_1.0.0              
    #>  [41] maketools_1.3.2             goftest_1.2-3              
    #>  [43] RSpectra_0.16-2             spatstat.random_3.5-0      
    #>  [45] fitdistrplus_1.2-6          parallelly_1.47.0          
    #>  [47] codetools_0.2-20            DelayedArray_0.39.3        
    #>  [49] RcppRoll_0.3.2              tidyselect_1.2.1           
    #>  [51] UCSC.utils_1.9.0            farver_2.1.2               
    #>  [53] spatstat.explore_3.8-1      matrixStats_1.5.0          
    #>  [55] BiocFileCache_3.3.0         jsonlite_2.0.0             
    #>  [57] progressr_0.19.0            Formula_1.2-5              
    #>  [59] ggridges_0.5.7              survival_3.8-6             
    #>  [61] tools_4.6.1                 progress_1.2.3             
    #>  [63] ica_1.0-3                   Rcpp_1.1.1-1.1             
    #>  [65] glue_1.8.1                  gridExtra_2.3.1            
    #>  [67] SparseArray_1.13.2          xfun_0.59                  
    #>  [69] DESeq2_1.53.0               MatrixGenerics_1.25.0      
    #>  [71] GenomeInfoDb_1.49.1         withr_3.0.3                
    #>  [73] BiocManager_1.30.27         fastmap_1.2.0              
    #>  [75] digest_0.6.39               R6_2.6.1                   
    #>  [77] mime_0.13                   scattermore_1.2            
    #>  [79] tensor_1.5.1                spatstat.data_3.1-9        
    #>  [81] RSQLite_3.53.2              tidyr_1.3.2                
    #>  [83] data.table_1.18.4           Structstrings_1.29.0       
    #>  [85] prettyunits_1.2.0           httr_1.4.8                 
    #>  [87] htmlwidgets_1.6.4           S4Arrays_1.13.0            
    #>  [89] uwot_0.2.4                  pkgconfig_2.0.3            
    #>  [91] gtable_0.3.6                blob_1.3.0                 
    #>  [93] lmtest_0.9-40               S7_0.2.2                   
    #>  [95] sys_3.4.3                   htmltools_0.5.9            
    #>  [97] carData_3.0-6               dotCall64_1.2              
    #>  [99] scales_1.4.0                Biobase_2.73.1             
    #> [101] png_0.1-9                   spatstat.univar_3.2-0      
    #> [103] knitr_1.51                  reshape2_1.4.5             
    #> [105] nlme_3.1-169                curl_7.1.0                 
    #> [107] cachem_1.1.0                zoo_1.8-15                 
    #> [109] stringr_1.6.0               KernSmooth_2.23-26         
    #> [111] parallel_4.6.1              miniUI_0.1.2               
    #> [113] AnnotationDbi_1.75.0        pillar_1.11.1              
    #> [115] grid_4.6.1                  vctrs_0.7.3                
    #> [117] RANN_2.6.2                  promises_1.5.0             
    #> [119] ggpubr_0.6.3                car_3.1-5                  
    #> [121] dbplyr_2.6.0                xtable_1.8-8               
    #> [123] cluster_2.1.8.2             evaluate_1.0.5             
    #> [125] cli_3.6.6                   locfit_1.5-9.12            
    #> [127] compiler_4.6.1              rlang_1.2.0                
    #> [129] crayon_1.5.3                future.apply_1.20.2        
    #> [131] ggsignif_0.6.4              labeling_0.4.3             
    #> [133] plyr_1.8.9                  stringi_1.8.7              
    #> [135] deldir_2.0-4                viridisLite_0.4.3          
    #> [137] BiocParallel_1.47.0         lazyeval_0.2.3             
    #> [139] spatstat.geom_3.8-1         RcppHNSW_0.7.0             
    #> [141] hms_1.1.4                   patchwork_1.3.2            
    #> [143] sparseMatrixStats_1.25.0    bit64_4.8.2                
    #> [145] future_1.70.0               ggplot2_4.0.3              
    #> [147] KEGGREST_1.53.4             shiny_1.14.0               
    #> [149] SummarizedExperiment_1.43.0 ROCR_1.0-12                
    #> [151] igraph_2.3.3                broom_1.0.13               
    #> [153] memoise_2.0.1               bslib_0.11.0               
    #> [155] fastmatch_1.1-8             bit_4.6.0
    Cao, J., D. R. O’Day, H. A. Pliner, et al. 2020. “A Human Cell Atlas of Fetal Gene Expression.” Science 370 (6518). https://doi.org/10.1126/science.aba7721.
    Domcke, S., A. J. Hill, R. M. Daza, et al. 2020. “A Human Cell Atlas of Fetal Chromatin Accessibility.” Science 370 (6518). https://doi.org/10.1126/science.aba7612.
    Gao, W., C. J. Gallardo-Dodd, and C. Kutter. 2022. “Cell Type-Specific Analysis by Single-Cell Profiling Identifies a Stable Mammalian tRNA-mRNA Interface and Increased Translation Efficiency in Neurons.” Genome Research 32 (1): 97–110. https://doi.org/10.1101/gr.275944.121.