knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
After running the registration function register()
as shown in the registering data article, users can summarise and visualise the results as illustrated in the figure below.
knitr::include_graphics("figures/visualisation_diagram.png")
The total number of registered and non-registered genes can be obtained by running the function summary()
with registration_results
object as an input.
# Load the package library(greatR) library(data.table)
# Load a data frame from the sample data registration_results <- system.file("extdata/brapa_arabidopsis_registration.rds", package = "greatR") |> readRDS()
The function summary()
returns a list with S3 class summary.res_greatR
containing four different objects:
summary
is a data frame containing the summary of the registration results (default S3 print).registered_genes
is a vector of gene IDs which are successfully registered.non_registered_genes
is a vector of non-registered gene IDs.reg_params
is a data frame containing the distribution of registration parameters.# Get registration summary reg_summary <- summary(registration_results) reg_summary$summary |> knitr::kable()
The list of gene IDs which are registered or non-registered can be viewed by calling:
reg_summary$registered_genes
reg_summary$non_registered_genes
The function plot()
allows users to plot the bivariate distribution of the registration parameters. Non-registered genes can be ignored by selecting type = "registered"
instead of the default type = "all"
. Similarly, the marginal distribution type can be changed from type_dist = "histogram"
(default) to type_dist = "density"
.
plot( reg_summary, type = "registered" )
plot( reg_summary, type = "registered", scatterplot_size = c(4, 3.5) )
The function plot()
allows users to plot the registration results of the genes of interest (by default only up to the first 25 genes are shown, for more control over this, use the genes_list
argument).
# Plot registration result plot( registration_results, ncol = 2 )
Notice that the plot includes a label indicating if the particular genes are registered or non-registered, as well as the registration parameters in case the registration is successful.
For more details on the other function arguments, go to plot()
.
After registering the data, users can compare the overall similarity between datasets before and after registering using the function calculate_distance()
. By default all genes are considered in this calculation, this can be changed by using the genes_list
argument.
sample_distance <- calculate_distance(registration_results)
The function calculate_distance()
returns a list with S3 class dist_greatR
of two data frames:
result
is the distance between scaled reference and query expressions using time points after registration.original
is the distance between scaled reference and query expressions using original time points before registration.Each of these data frames above can be visualised using the plot()
function, by selecting either type = "result"
(default) or type = "original"
.
# Plot heatmap of mean expression profiles distance before registration process plot( sample_distance, type = "original" )
# Plot heatmap of mean expression profiles distance after registration process plot( sample_distance, type = "result", match_timepoints = TRUE )
Notice that we use match_timepoints = TRUE
to match the registered query time points to the reference time points.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.