| Title: | Visualising How Nonlinear Dimension Reduction Warps Your Data |
|---|---|
| Description: | To construct a model in 2-D space from 2-D nonlinear dimension reduction data and then lift it to the high-dimensional space. Additionally, provides tools to visualise the model overlay the data in 2-D and high-dimensional space. Furthermore, provides summaries and diagnostics to evaluate the nonlinear dimension reduction layout. |
| Authors: | Jayani P. Gamage [aut, cre] (ORCID: <https://orcid.org/0000-0002-6265-6481>), Dianne Cook [aut] (ORCID: <https://orcid.org/0000-0002-3813-7155>), Paul Harrison [aut] (ORCID: <https://orcid.org/0000-0002-3980-268X>), Michael Lydeamore [aut] (ORCID: <https://orcid.org/0000-0001-6515-827X>), Thiyanga S. Talagala [aut] (ORCID: <https://orcid.org/0000-0002-0656-9789>) |
| Maintainer: | Jayani P. Gamage <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 1.0.6 |
| Built: | 2026-05-18 09:00:17 UTC |
| Source: | https://github.com/jayanilakshika/quollr |
This function assigns the data to hexagons.
assign_data(nldr_scaled_obj, centroids_data)assign_data(nldr_scaled_obj, centroids_data)
nldr_scaled_obj |
A list of a tibble contains scaled first and second columns of NLDR data, and numeric vectors representing the limits of the original NLDR data. |
centroids_data |
The dataset with centroid coordinates. |
A tibble contains embedding components (emb1, emb2)
and corresponding hexagon ID (h).
all_centroids_df <- scurve_model_obj$hb_obj$centroids assign_data(nldr_scaled_obj = scurve_model_obj$nldr_scaled_obj, centroids_data = all_centroids_df)all_centroids_df <- scurve_model_obj$hb_obj$centroids assign_data(nldr_scaled_obj = scurve_model_obj$nldr_scaled_obj, centroids_data = all_centroids_df)
This is a generic function to augment datasets with predictions and error metrics from different models, including NLDR models.
augment(x, ...)augment(x, ...)
x |
An object to augment. |
... |
Additional arguments passed to methods (e.g., high-dimensional data). |
This S3 method augments a dataset with predictions and error metrics obtained
from a nonlinear dimension reduction (NLDR) model stored in a highd_vis_model object.
## S3 method for class 'highd_vis_model' augment(x, highd_data, ...)## S3 method for class 'highd_vis_model' augment(x, highd_data, ...)
x |
An object of class |
highd_data |
A data frame or tibble containing the original high-dimensional coordinates with an |
... |
Additional arguments (currently unused). |
A tibble containing the augmented data with predictions, error metrics, and absolute error metrics.
# Assuming 'fit' is a highd_vis_model object and 'scurve' contains the original data: fit <- fit_highd_model(highd_data = scurve, nldr_data = scurve_umap, b1 = 30, q = 0.1, hd_thresh = 5) augment(x = fit, highd_data = scurve)# Assuming 'fit' is a highd_vis_model object and 'scurve' contains the original data: fit <- fit_highd_model(highd_data = scurve, nldr_data = scurve_umap, b1 = 30, q = 0.1, hd_thresh = 5) augment(x = fit, highd_data = scurve)
This function calculates the average values of high-dimensional data within each hexagonal bin.
avg_highd_data(highd_data, scaled_nldr_hexid)avg_highd_data(highd_data, scaled_nldr_hexid)
highd_data |
A tibble that contains the high-dimensional data. |
scaled_nldr_hexid |
A tibble that contains the scaled embedding with hexagonal bin IDs. |
A tibble with the average values of the high-dimensional data within each hexagonal bin.
umap_with_hb_id <- scurve_model_obj$hb_obj$data_hb_id avg_highd_data(highd_data = scurve, scaled_nldr_hexid = umap_with_hb_id)umap_with_hb_id <- scurve_model_obj$hb_obj$data_hb_id avg_highd_data(highd_data = scurve, scaled_nldr_hexid = umap_with_hb_id)
This function calculates the 2-D distances between pairs of points in a data frame.
calc_2d_dist( trimesh_data, select_vars = c("from", "to", "x_from", "y_from", "x_to", "y_to", "from_count", "to_count", "distance") )calc_2d_dist( trimesh_data, select_vars = c("from", "to", "x_from", "y_from", "x_to", "y_to", "from_count", "to_count", "distance") )
trimesh_data |
A tibble that contains the x and y coordinates of start and end points. |
select_vars |
selected columns in the resulting data frame. |
A tibble with columns for the starting point, ending point, and calculated distances.
tr_from_to_df <- scurve_model_obj$trimesh_data calc_2d_dist(trimesh_data = tr_from_to_df)tr_from_to_df <- scurve_model_obj$trimesh_data calc_2d_dist(trimesh_data = tr_from_to_df)
This function calculates the effective number of bins along the x and y axes of a hexagonal grid.
calc_bins_y(nldr_scaled_obj, b1 = 30, q = 0.1)calc_bins_y(nldr_scaled_obj, b1 = 30, q = 0.1)
nldr_scaled_obj |
A list of a tibble contains scaled first and second columns of NLDR data, and numeric vectors representing the limits of the original NLDR data. |
b1 |
Number of bins along the x axis. |
q |
The buffer amount as proportion of data range. |
A list of numeric values that represents the effective number of bins along the y axis, height and, width of the hexagon.
calc_bins_y(nldr_scaled_obj = scurve_model_obj$nldr_scaled_obj, b1 = 30, q = 0.1)calc_bins_y(nldr_scaled_obj = scurve_model_obj$nldr_scaled_obj, b1 = 30, q = 0.1)
This function combine the average values of high-dimensional data within each hexagonal bin and high-dimensional data, non-linear dimension reduction data.
comb_all_data_model(highd_data, nldr_data, model_highd, model_2d)comb_all_data_model(highd_data, nldr_data, model_highd, model_2d)
highd_data |
A tibble that contains the high-dimensional data. |
nldr_data |
A tibble that contains the non-linear dimension reduction data. |
model_highd |
A tibble that contains the high-dimensional coordinates of bin centroids. |
model_2d |
A tibble that contains hexagonal bin centroids in 2-D. |
A tibble with the average values of the high-dimensional data within each hexagonal bin and high-dimensional data, non-linear dimension reduction data.
comb_all_data_model(highd_data = scurve, nldr_data = scurve_umap, model_highd = scurve_model_obj$model_highd, model_2d = scurve_model_obj$model_2d)comb_all_data_model(highd_data = scurve, nldr_data = scurve_umap, model_highd = scurve_model_obj$model_highd, model_2d = scurve_model_obj$model_2d)
This function combine the average values of high-dimensional data within each hexagonal bin and high-dimensional data, non-linear dimension reduction data, model error data.
comb_all_data_model_error( highd_data, nldr_data, model_highd, model_2d, error_data )comb_all_data_model_error( highd_data, nldr_data, model_highd, model_2d, error_data )
highd_data |
A tibble that contains the high-dimensional data. |
nldr_data |
A tibble that contains the non-linear dimension reduction data. |
model_highd |
A tibble that contains the high-dimensional coordinates of bin centroids. |
model_2d |
A tibble that contains hexagonal bin centroids in 2-D. |
error_data |
A tibble that contains high-dimensional model error. |
A tibble with the average values of the high-dimensional data within each hexagonal bin and high-dimensional data, non-linear dimension reduction data, model error.
model_error <- augment(x = scurve_model_obj, highd_data = scurve) comb_all_data_model_error(highd_data = scurve, nldr_data = scurve_umap, model_highd = scurve_model_obj$model_highd, model_2d = scurve_model_obj$model_2d, error_data = model_error)model_error <- augment(x = scurve_model_obj, highd_data = scurve) comb_all_data_model_error(highd_data = scurve, nldr_data = scurve_umap, model_highd = scurve_model_obj$model_highd, model_2d = scurve_model_obj$model_2d, error_data = model_error)
This function combine the average values of high-dimensional data within each hexagonal bin and high-dimensional data.
comb_data_model(highd_data, model_highd, model_2d)comb_data_model(highd_data, model_highd, model_2d)
highd_data |
A tibble that contains the high-dimensional data. |
model_highd |
A tibble that contains the high-dimensional coordinates of bin centroids. |
model_2d |
A tibble that contains hexagonal bin centroids in 2-D. |
A tibble with the average values of the high-dimensional data within each hexagonal bin and high-dimensional data.
comb_data_model(highd_data = scurve, model_highd = scurve_model_obj$model_highd, model_2d = scurve_model_obj$model_2d)comb_data_model(highd_data = scurve, model_highd = scurve_model_obj$model_highd, model_2d = scurve_model_obj$model_2d)
This function calculates the mean density of hexagonal bins based on their neighboring bins.
compute_mean_density_hex(model_2d, b1 = 30)compute_mean_density_hex(model_2d, b1 = 30)
model_2d |
A tibble that contains information about hexagonal bin centroids,
including the hexagon ID and the standardised counts ( |
b1 |
The number of bins along the x-axis for the hexagonal grid. |
A tibble contains hexagonal IDs and the mean density of each hexagonal bin based on its neighboring bins.
compute_mean_density_hex(model_2d = scurve_model_obj$model_2d, b1 = 30)compute_mean_density_hex(model_2d = scurve_model_obj$model_2d, b1 = 30)
This function computes the standardize number of points within each hexagon.
compute_std_counts(scaled_nldr_hexid)compute_std_counts(scaled_nldr_hexid)
scaled_nldr_hexid |
A tibble that contains the scaled embedding with hexagonal bin IDs. |
A tibble that contains hexagon IDs (h), bin counts (n_h),
and standardize counts (w_h).
umap_with_hb_id <- scurve_model_obj$hb_obj$data_hb_id compute_std_counts(scaled_nldr_hexid = umap_with_hb_id)umap_with_hb_id <- scurve_model_obj$hb_obj$data_hb_id compute_std_counts(scaled_nldr_hexid = umap_with_hb_id)
This function identifies hexagons with low density based on the mean density of their neighboring hexagons.
find_low_dens_hex(model_2d, b1 = 30, md_thresh = 0.05)find_low_dens_hex(model_2d, b1 = 30, md_thresh = 0.05)
model_2d |
The tibble that contains all hexagonal bin centroids. |
b1 |
Number of bins along the x-axis for hexagon binning. |
md_thresh |
A numeric value that contains the threshold for mean density. |
A vector containing the IDs of hexagons to be removed after investigating their neighboring bins.
find_low_dens_hex(model_2d = scurve_model_obj$model_2d, b1 = 30, md_thresh = 0.05)find_low_dens_hex(model_2d = scurve_model_obj$model_2d, b1 = 30, md_thresh = 0.05)
This function determines the number of bins along the x and y axes to obtain a specific number of non-empty bins.
find_non_empty_bins(nldr_scaled_obj, m = 2, q = 0.1)find_non_empty_bins(nldr_scaled_obj, m = 2, q = 0.1)
nldr_scaled_obj |
A list of a tibble contains scaled first and second columns of NLDR data, and numeric vectors representing the limits of the original NLDR data. |
m |
The desired number of non-empty bins. |
q |
The buffer amount as proportion of data range. |
The number of bins along the x and y axes needed to achieve a specific number of non-empty bins.
find_non_empty_bins(nldr_scaled_obj = scurve_model_obj$nldr_scaled_obj, m = 5)find_non_empty_bins(nldr_scaled_obj = scurve_model_obj$nldr_scaled_obj, m = 5)
This function fits a high-dimensional model using hexagonal bins and provides options to customize the modeling process, including the choice of bin centroids or bin means, removal of low-density hexagons, and averaging of high-dimensional data.
fit_highd_model(highd_data, nldr_data, b1 = 30, q = 0.1, hd_thresh = 0)fit_highd_model(highd_data, nldr_data, b1 = 30, q = 0.1, hd_thresh = 0)
highd_data |
A tibble that contains the high-dimensional data with a unique identifier. |
nldr_data |
A tibble that contains the embedding with a unique identifier. |
b1 |
(default: 4) A numeric value representing the number of bins along the x axis. |
q |
(default: 0.1) A numeric value representing the buffer amount as proportion of data range. |
hd_thresh |
(default: 0) A numeric value using to filter high-density hexagons. |
A list containing a list of a tibble contains scaled first and second columns
of NLDR data, and numeric vectors representing the limits of the original NLDR data (nldr_scaled_obj),
a object that contains hexagonal binning information (hb_obj),
a tibble with high-dimensional model (model_highd) and a tibble containing
hexagonal bin centroids in 2-D (model_2d), and
a tibble that contains the edge information (trimesh_data).
fit_highd_model(highd_data = scurve, nldr_data = scurve_umap, b1 = 30, q = 0.1, hd_thresh = 0)fit_highd_model(highd_data = scurve, nldr_data = scurve_umap, b1 = 30, q = 0.1, hd_thresh = 0)
Generate Axes for Projection
gen_axes( proj, limits = 1, axis_pos_x = NULL, axis_pos_y = NULL, axis_labels, threshold = 0 )gen_axes( proj, limits = 1, axis_pos_x = NULL, axis_pos_y = NULL, axis_labels, threshold = 0 )
proj |
A projection matrix or data frame. |
limits |
Numeric value specifying axis limits (default: 1). |
axis_pos_x |
Optional numeric value for x-axis position. |
axis_pos_y |
Optional numeric value for y-axis position. |
axis_labels |
A vector of axis labels. |
threshold |
A numeric threshold value (default: 0). |
A modified projection with added axis elements.
projection_df <- cbind( c(-0.17353,-0.02906,0.19857,0.00037,0.00131,-0.05019,0.03371), c(-0.10551,0.14829,-0.02063,0.02658,-0.03150,0.19698,0.00044)) gen_axes(proj = projection_df, axis_labels = paste0("x", 1:7))projection_df <- cbind( c(-0.17353,-0.02906,0.19857,0.00037,0.00131,-0.05019,0.03371), c(-0.10551,0.14829,-0.02063,0.02658,-0.03150,0.19698,0.00044)) gen_axes(proj = projection_df, axis_labels = paste0("x", 1:7))
This function generates all possible centroids in the hexagonal grid.
gen_centroids(nldr_scaled_obj, b1 = 30, q = 0.1)gen_centroids(nldr_scaled_obj, b1 = 30, q = 0.1)
nldr_scaled_obj |
A list of a tibble contains scaled first and second columns of NLDR data, and numeric vectors representing the limits of the original NLDR data. |
b1 |
Number of bins along the x axis. |
q |
The buffer amount as proportion of data range. |
A tibble contains hexIDs (h),
x and y coordinates (c_x, c_y respectively)
of all hexagon bin centroids.
gen_centroids(nldr_scaled_obj = scurve_model_obj$nldr_scaled_obj, b1 = 30, q = 0.1)gen_centroids(nldr_scaled_obj = scurve_model_obj$nldr_scaled_obj, b1 = 30, q = 0.1)
This function generates a design which can be passed to 'plot_layout()' to arrange 2-D layouts.
gen_design(n_right, ncol_right = 2)gen_design(n_right, ncol_right = 2)
n_right |
The number of plots in right side. |
ncol_right |
The number of columns in right side. |
A patchwork area object.
gen_design(n_right = 8, ncol_right = 2)gen_design(n_right = 8, ncol_right = 2)
This function augments a dataset with predictions and error metrics obtained from a nonlinear dimension reduction (NLDR) model.
gen_diffbin1_errors(highd_data, nldr_data, hd_thresh = 1, bin1_vec = NULL)gen_diffbin1_errors(highd_data, nldr_data, hd_thresh = 1, bin1_vec = NULL)
highd_data |
A tibble that contains the high-dimensional data with a unique identifier. |
nldr_data |
A tibble that contains the embedding with a unique identifier. |
hd_thresh |
(default: 1) A numeric value using to filter high-density hexagons. |
bin1_vec |
A numeric vector contains the range of b1 values. |
A tibble containing the augmented data with predictions, error metrics, and absolute error metrics.
scurve_sample <- scurve |> head(100) scurve_umap_sample <- scurve_umap |> head(100) gen_diffbin1_errors(highd_data = scurve_sample, nldr_data = scurve_umap_sample)scurve_sample <- scurve |> head(100) scurve_umap_sample <- scurve_umap |> head(100) gen_diffbin1_errors(highd_data = scurve_sample, nldr_data = scurve_umap_sample)
This function generates edge information from a given triangular object, including the coordinates of the vertices and the from-to relationships between the vertices.
gen_edges(tri_object, a1)gen_edges(tri_object, a1)
tri_object |
The triangular object from which to generate edge information. |
a1 |
A numeric value for bin width. |
A tibble that contains the edge information, including the from-to relationships and the corresponding x and y coordinates.
all_centroids_df <- scurve_model_obj$hb_obj$centroids counts_data <- scurve_model_obj$hb_obj$std_cts umap_with_hb_id <- scurve_model_obj$hb_obj$data_hb_id df_bin_centroids <- merge_hexbin_centroids(counts_data = counts_data, centroids_data = all_centroids_df) tr1_object <- tri_bin_centroids(centroids_data = df_bin_centroids) gen_edges(tri_object = tr1_object, a1 = scurve_model_obj$hb_obj$a1)all_centroids_df <- scurve_model_obj$hb_obj$centroids counts_data <- scurve_model_obj$hb_obj$std_cts umap_with_hb_id <- scurve_model_obj$hb_obj$data_hb_id df_bin_centroids <- merge_hexbin_centroids(counts_data = counts_data, centroids_data = all_centroids_df) tr1_object <- tri_bin_centroids(centroids_data = df_bin_centroids) gen_edges(tri_object = tr1_object, a1 = scurve_model_obj$hb_obj$a1)
This function generates the coordinates of hexagons after passing hexagonal centroids.
gen_hex_coord(centroids_data, a1)gen_hex_coord(centroids_data, a1)
centroids_data |
The dataset with all hexagonal bin IDs and centroid coordinates. |
a1 |
The width of the hexagon. |
A tibble contains hexagon id (h),
x and y coordinates (x, y) of hexagons.
width <- scurve_model_obj$hb_obj$a1 all_centroids_df <- scurve_model_obj$hb_obj$centroids gen_hex_coord(centroids_data = all_centroids_df, a1 = width)width <- scurve_model_obj$hb_obj$a1 all_centroids_df <- scurve_model_obj$hb_obj$centroids gen_hex_coord(centroids_data = all_centroids_df, a1 = width)
This function scales first and second columns.
gen_scaled_data(nldr_data)gen_scaled_data(nldr_data)
nldr_data |
A tibble that contains embedding components in the first and second columns. |
A list of a tibble contains scaled first and second columns NLDR data, and numeric vectors representing the limits of the original NLDR data.
gen_scaled_data(nldr_data = scurve_umap)gen_scaled_data(nldr_data = scurve_umap)
Create a hexgrid plot
geom_hexgrid( mapping = NULL, data = NULL, stat = "hexgrid", position = "identity", show.legend = NA, na.rm = FALSE, inherit.aes = TRUE, ... )geom_hexgrid( mapping = NULL, data = NULL, stat = "hexgrid", position = "identity", show.legend = NA, na.rm = FALSE, inherit.aes = TRUE, ... )
mapping |
Aesthetic mappings for the plot. |
data |
The data to be plotted. |
stat |
The statistical transformation to be applied. |
position |
The position adjustment to be applied. |
show.legend |
Whether to show the legend for this layer. |
na.rm |
Whether to remove missing values. |
inherit.aes |
Whether to inherit aesthetics from the plot or the layer. |
... |
Additional arguments to be passed to the 'layer' function. |
A 'ggplot2' layer object.
df_bin_centroids <- scurve_model_obj$model_2d |> dplyr::filter(n_h > 10) ggplot2::ggplot() + geom_hexgrid(data = df_bin_centroids, mapping = ggplot2::aes(x = c_x, y = c_y))df_bin_centroids <- scurve_model_obj$model_2d |> dplyr::filter(n_h > 10) ggplot2::ggplot() + geom_hexgrid(data = df_bin_centroids, mapping = ggplot2::aes(x = c_x, y = c_y))
Create a trimesh plot
geom_trimesh( mapping = NULL, data = NULL, stat = "trimesh", position = "identity", show.legend = NA, na.rm = FALSE, inherit.aes = TRUE, ... )geom_trimesh( mapping = NULL, data = NULL, stat = "trimesh", position = "identity", show.legend = NA, na.rm = FALSE, inherit.aes = TRUE, ... )
mapping |
Aesthetic mappings for the plot. |
data |
The data to be plotted. |
stat |
The statistical transformation to be applied. |
position |
The position adjustment to be applied. |
show.legend |
Whether to show the legend for this layer. |
na.rm |
Whether to remove missing values. |
inherit.aes |
Whether to inherit aesthetics from the plot or the layer. |
... |
Additional arguments to be passed to the 'layer' function. |
A 'ggplot2' layer object.
df_bin_centroids <- scurve_model_obj$model_2d |> dplyr::filter(n_h > 10) ggplot2::ggplot() + geom_trimesh(data = df_bin_centroids, mapping = ggplot2::aes(x = c_x, y = c_y))df_bin_centroids <- scurve_model_obj$model_2d |> dplyr::filter(n_h > 10) ggplot2::ggplot() + geom_trimesh(data = df_bin_centroids, mapping = ggplot2::aes(x = c_x, y = c_y))
This function defines a custom ggplot2 Geom, GeomHexgrid, for rendering hexagonal grid.
GeomHexgridGeomHexgrid
A ggproto object
This function defines a custom ggplot2 Geom, GeomTrimesh, for rendering triangular meshes.
GeomTrimeshGeomTrimesh
A ggproto object
- required_aes: The required aesthetics for this geometry are "x", "y", "xend", and "yend".
- default_aes: The default aesthetics for this geometry include shape = 19, linetype = 1, linewidth = 0.5,
size = 0.5, alpha = NA, and colour = "black".
- draw_key: The function describing how to draw the key glyph is ggplot2::draw_key_point.
- draw_panel: The function describing how to draw the panel takes data, panel_scales, and coord.
It creates a tibble of vertices and a tibble of trimesh. The final plot is constructed using ggplot2::GeomPoint$draw_panel
for vertices and ggplot2::GeomSegment$draw_panel for trimesh.
Compute Projection for High-Dimensional Data
get_projection(projection, highd_data, model_highd, trimesh_data, axis_param)get_projection(projection, highd_data, model_highd, trimesh_data, axis_param)
projection |
A matrix or data frame representing the projection. |
highd_data |
A data frame or matrix of high-dimensional data. |
model_highd |
A model object or function used for high-dimensional transformation. |
trimesh_data |
A data frame defining transformation from one space to another. |
axis_param |
A list of parameters for axis configuration. |
A data frame or matrix with the transformed projection.
projection_df <- cbind( c(-0.17353,-0.02906,0.19857,0.00037,0.00131,-0.05019,0.03371), c(-0.10551,0.14829,-0.02063,0.02658,-0.03150,0.19698,0.00044)) df_bin <- scurve_model_obj$model_highd edge_data <- scurve_model_obj$trimesh_data get_projection(projection = projection_df, highd_data = scurve, model_highd = df_bin, trimesh_data = edge_data, axis_param = list(limits = 1, axis_scaled = 3, axis_pos_x = -0.72, axis_pos_y = -0.72,threshold = 0.09))projection_df <- cbind( c(-0.17353,-0.02906,0.19857,0.00037,0.00131,-0.05019,0.03371), c(-0.10551,0.14829,-0.02063,0.02658,-0.03150,0.19698,0.00044)) df_bin <- scurve_model_obj$model_highd edge_data <- scurve_model_obj$trimesh_data get_projection(projection = projection_df, highd_data = scurve, model_highd = df_bin, trimesh_data = edge_data, axis_param = list(limits = 1, axis_scaled = 3, axis_pos_x = -0.72, axis_pos_y = -0.72,threshold = 0.09))
This is a generic function for computing evaluation metrics on different objects.
glance(x, ...)glance(x, ...)
x |
An object to compute evaluation metrics for. |
... |
Additional arguments passed to methods. |
This function computes evaluation metrics (Error and HBE) by comparing the high-dimensional data to the predictions obtained from a hex_model object.
## S3 method for class 'highd_vis_model' glance(x, highd_data, ...)## S3 method for class 'highd_vis_model' glance(x, highd_data, ...)
x |
An object of class |
highd_data |
A data frame or tibble containing the original high-dimensional data with an |
... |
Additional arguments (currently unused). |
A tibble contains Error, and MSE values.
# Assuming 'fit' is a hex_model object and 'scurve' contains the original data: fit <- fit_highd_model(highd_data = scurve, nldr_data = scurve_umap, b1 = 30, q = 0.1, hd_thresh = 5) glance(fit, highd_data = scurve)# Assuming 'fit' is a hex_model object and 'scurve' contains the original data: fit <- fit_highd_model(highd_data = scurve, nldr_data = scurve_umap, b1 = 30, q = 0.1, hd_thresh = 5) glance(fit, highd_data = scurve)
This function maps points to their corresponding hexagonal bins.
group_hex_pts(scaled_nldr_hexid)group_hex_pts(scaled_nldr_hexid)
scaled_nldr_hexid |
A tibble that contains the scaled embedding with hexagonal bin IDs. |
A tibble with hexagonal bin IDs (h) and the corresponding points.
umap_with_hb_id <- scurve_model_obj$hb_obj$data_hb_id group_hex_pts(scaled_nldr_hexid = umap_with_hb_id)umap_with_hb_id <- scurve_model_obj$hb_obj$data_hb_id group_hex_pts(scaled_nldr_hexid = umap_with_hb_id)
This function generates the hexagonal object.
hex_binning(nldr_scaled_obj, b1 = 30, q = 0.1)hex_binning(nldr_scaled_obj, b1 = 30, q = 0.1)
nldr_scaled_obj |
A list of a tibble contains scaled first and second columns of NLDR data, and numeric vectors representing the limits of the original NLDR data. |
b1 |
Number of bins along the x axis. |
q |
The buffer amount as proportion of data range. |
A object that contains numeric vector that contains binwidths (a1),
vertical distance (a2), bins along the x and y axes respectively (bins),
numeric vector that contains hexagonal
starting point coordinates all hexagonal bin centroids (centroids),
hexagonal coordinates of the full grid (hex_poly),
embedding components with their corresponding hexagon IDs (data_hb_id),
hex bins with their corresponding standardise counts (std_cts),
total number of hex bins (b), number of non-empty hex bins (m)
and points within each hexagon (pts_bins).
hex_binning(nldr_scaled_obj = scurve_model_obj$nldr_scaled_obj, b1 = 30, q = 0.1)hex_binning(nldr_scaled_obj = scurve_model_obj$nldr_scaled_obj, b1 = 30, q = 0.1)
Extract hexagonal bin centroids coordinates and the corresponding standardise counts.
merge_hexbin_centroids(centroids_data, counts_data)merge_hexbin_centroids(centroids_data, counts_data)
centroids_data |
A tibble that contains all hexagonal bin centroid coordinates with hexagon IDs. |
counts_data |
A tibble that contains hexagon IDs with the standardise number of points within each hexagon. |
A tibble contains hexagon ID (h), centroid coordinates (c_x, c_y),
bin counts (n_h), and standardise counts (w_h).
all_centroids_df <- scurve_model_obj$hb_obj$centroids counts_data <- scurve_model_obj$hb_obj$std_cts merge_hexbin_centroids(centroids_data = all_centroids_df, counts_data = counts_data)all_centroids_df <- scurve_model_obj$hb_obj$centroids counts_data <- scurve_model_obj$hb_obj$std_cts merge_hexbin_centroids(centroids_data = all_centroids_df, counts_data = counts_data)
Extract hexagonal bin mean coordinates and the corresponding standardize counts.
merge_hexbin_mean(data_hb, counts_data, centroids_data)merge_hexbin_mean(data_hb, counts_data, centroids_data)
data_hb |
A tibble with embedding components and hexagonal bin IDs. |
counts_data |
A tibble that contains hexagon IDs with the standardise number of points within each hexagon. |
centroids_data |
A tibble that contains all hexagonal bin centroid coordinates with hexagon IDs. |
A tibble contains hexagon ID (h), bin means (c_x, c_y),
bin counts (n_h), and standardise counts (w_h).
all_centroids_df <- scurve_model_obj$hb_obj$centroids counts_data <- scurve_model_obj$hb_obj$std_cts umap_with_hb_id <- scurve_model_obj$hb_obj$data_hb_id merge_hexbin_mean(data_hb = umap_with_hb_id, counts_data = counts_data, centroids_data = all_centroids_df)all_centroids_df <- scurve_model_obj$hb_obj$centroids counts_data <- scurve_model_obj$hb_obj$std_cts umap_with_hb_id <- scurve_model_obj$hb_obj$data_hb_id merge_hexbin_mean(data_hb = umap_with_hb_id, counts_data = counts_data, centroids_data = all_centroids_df)
This function arranges HBE plot in left and 2-D layouts in right.
plot_hbe_layouts(plots, design)plot_hbe_layouts(plots, design)
plots |
A list of plots which include HBE plot and 2-D layouts. |
design |
The design of plots need to be arranged. |
A patchwork object.
design <- gen_design(n_right = 4, ncol_right = 2) plot_hbe_layouts(plots = scurve_plts, design = design)design <- gen_design(n_right = 4, ncol_right = 2) plot_hbe_layouts(plots = scurve_plts, design = design)
Plot Projected Data with Axes and Circles
plot_proj( proj_obj, point_param = c(1, 0.3, "#66B2CC"), line_param = c(0.5, 0.5, "#000000"), plot_limits, axis_text_size = 3, is_category = FALSE )plot_proj( proj_obj, point_param = c(1, 0.3, "#66B2CC"), line_param = c(0.5, 0.5, "#000000"), plot_limits, axis_text_size = 3, is_category = FALSE )
proj_obj |
An object contains a tibble containing the projected data, a tibble containing the model reference data, a list specifying the axes details, and a list defining circle parameters. |
point_param |
A vector specifying point size, alpha, and color (default: c(1, 0.3, "#66B2CC")). |
line_param |
A vector specifying line width, alpha, and color (default: c(0.5, 0.5, "#000000")). |
plot_limits |
Limits for the plot axes. |
axis_text_size |
Size of axis text (default: 3). |
is_category |
Logical indicating if the data is categorical (default: FALSE). |
A ggplot object.
projection_df <- cbind( c(-0.17353,-0.02906,0.19857,0.00037,0.00131,-0.05019,0.03371), c(-0.10551,0.14829,-0.02063,0.02658,-0.03150,0.19698,0.00044)) df_bin <- scurve_model_obj$model_highd edge_data <- scurve_model_obj$trimesh_data proj_obj1 <- get_projection(projection = projection_df, highd_data = scurve, model_highd = df_bin, trimesh_data = edge_data, axis_param = list(limits = 1, axis_scaled = 3, axis_pos_x = -0.72, axis_pos_y = -0.72, threshold = 0.09)) plot_proj(proj_obj = proj_obj1, plot_limits = c(-1, 1))projection_df <- cbind( c(-0.17353,-0.02906,0.19857,0.00037,0.00131,-0.05019,0.03371), c(-0.10551,0.14829,-0.02063,0.02658,-0.03150,0.19698,0.00044)) df_bin <- scurve_model_obj$model_highd edge_data <- scurve_model_obj$trimesh_data proj_obj1 <- get_projection(projection = projection_df, highd_data = scurve, model_highd = df_bin, trimesh_data = edge_data, axis_param = list(limits = 1, axis_scaled = 3, axis_pos_x = -0.72, axis_pos_y = -0.72, threshold = 0.09)) plot_proj(proj_obj = proj_obj1, plot_limits = c(-1, 1))
Given a test dataset, the centroid coordinates of hexagonal bins in 2-D and high-dimensional space, predict the 2-D embeddings for each data point in the test dataset.
predict_emb(highd_data, model_2d, model_highd)predict_emb(highd_data, model_2d, model_highd)
highd_data |
The tibble contains high-dimensional data and an unique identifier. |
model_2d |
Centroid coordinates of hexagonal bins in 2-D space. |
model_highd |
Centroid coordinates of hexagonal bins in high dimensions. |
A tibble contains predicted 2-D embeddings, ID in the test data, and predicted hexagonal IDs.
predict_emb(highd_data = scurve, model_highd = scurve_model_obj$model_highd, model_2d = scurve_model_obj$model_2d)predict_emb(highd_data = scurve, model_highd = scurve_model_obj$model_highd, model_2d = scurve_model_obj$model_2d)
This function solves a quadratic equation of the form 'ax^2 + bx + c = 0' and returns only the positive real roots. It handles complex intermediate calculations and returns real numbers if the roots are real.
quad(a = 3, b = 2, c = -1)quad(a = 3, b = 2, c = -1)
a |
The coefficient of the x^2 term. Can be complex. |
b |
The coefficient of the x term. |
c |
The constant term. |
A numeric vector containing the positive real root(s) of the quadratic equation. Returns 'numeric(0)' if no positive real roots are found. Returns a single value if both positive roots are identical.
# Example 1: With specific coefficients quad(a = 1, b = -3, c = 2) # x^2 - 3x + 2 = 0# Example 1: With specific coefficients quad(a = 1, b = -3, c = 2) # x^2 - 3x + 2 = 0
The 'scurve' dataset contains a 3-dimensional S-curve with added noise dimensions. Each data point is represented by seven dimensions (x1 to x7) and an ID.
data(scurve)data(scurve)
A data frame with 5000 rows and 8 columns:
Identification number
High-dimensional coordinates
This dataset is generated for illustrative purposes.
# Load the scurve dataset data(scurve) # Display the first few rows of the dataset head(scurve)# Load the scurve dataset data(scurve) # Display the first few rows of the dataset head(scurve)
The 'scurve_model_obj' contains object of scaled umap embedding, x and y limits, range of y; object of hexagonal binning information, object of high-d model fitted to umap embedding for the training data, the triangular object representing the triangulated bin centroids, a tibble that contains the edge information, a tibble with edge distance information.
data(scurve_model_obj)data(scurve_model_obj)
## 'scurve_model_obj' An object of five elements
A tibble contains scaled first and second columns of NLDR data, and numeric vectors representing the limits of the original NLDR data.
A object that contains hexagonal binning information.
A tibble with high-dimensional model.
A tibble containing hexagonal bin centroids in 2-D
A tibble that contains the edge information.
This object is generated for illustrative purposes.
# Load the scurve_model_obj data(scurve_model_obj)# Load the scurve_model_obj data(scurve_model_obj)
The 'scurve_plts' contains the RMSE plot and the 2-D NLDR layouts for 'scurve_umap', 'scurve_umap2', 'scurve_umap3', and 'scurve_umap4'
scurve_pltsscurve_plts
## 'scurve_plts' A list of 5 elements:
ggplot object, RMSE plot.
ggplot object, 2-D NLDR layout for 'scurve_umap'.
ggplot object, 2-D NLDR layout for 'scurve_umap2'.
ggplot object, 2-D NLDR layout for 'scurve_umap3'.
ggplot object, 2-D NLDR layout for 'scurve_umap4'.
This list of plots is generated for illustrative purposes.
# Show the scurve_plts scurve_plts# Show the scurve_plts scurve_plts
The 'scurve_umap' dataset contains the UMAP (Uniform Manifold Approximation and Projection) embeddings of a three-dimensional S-curve with added noise. Each data point is represented by two UMAP coordinates (UMAP1 and UMAP2) and an ID.
data(scurve_umap)data(scurve_umap)
## 'scurve_umap' A data frame with 5000 rows and 3 columns:
Numeric, first UMAP 2-D embeddings.
Numeric, second UMAP 2-D embeddings.
Numeric, identifier for each data point.
This dataset is generated for illustrative purposes.
# Load the scurve_umap dataset data(scurve_umap) # Display the first few rows of the dataset head(scurve_umap)# Load the scurve_umap dataset data(scurve_umap) # Display the first few rows of the dataset head(scurve_umap)
The 'scurve_umap_predict' dataset contains the predicted UMAP (Uniform Manifold Approximation and Projection) embeddings of a three-dimensional S-curve with added noise. Each data point is represented by two UMAP coordinates (UMAP1 and UMAP2) and an ID.
data(scurve_umap_predict)data(scurve_umap_predict)
## 'scurve_umap_predict' A data frame with 5000 rows and 3 columns:
Numeric, predicted first UMAP 2-D embeddings.
Numeric, predicted second UMAP 2-D embeddings.
Numeric, identifier for each data point.
This dataset is generated for illustrative purposes.
# Load the scurve_umap_predict dataset data(scurve_umap_predict) # Display the first few rows of the dataset head(scurve_umap_predict)# Load the scurve_umap_predict dataset data(scurve_umap_predict) # Display the first few rows of the dataset head(scurve_umap_predict)
The 'scurve_umap_rmse' dataset contains error, RMSE, b2, b, m, a1, a2, and mean density (d_bar) for different number of bins in x-axis (b1).
data(scurve_umap_rmse)data(scurve_umap_rmse)
## 'scurve_umap_rmse' A data frame with 70 rows and 10 columns:
Numeric, model error.
Numeric, Root Mean Square Error.
Numeric, number of bins along x-axis.
Numeric, number of bins along y-axis.
Numeric, number of total bins.
Numeric, number of non-empty bins.
Numeric, hexagon bin width.
Numeric, hexagon bin height.
Numeric, mean desnity.
Character, NLDR method.
This dataset is generated for illustrative purposes.
# Load the scurve_umap_rmse dataset data(scurve_umap_rmse) # Display the first few rows of the dataset head(scurve_umap_rmse)# Load the scurve_umap_rmse dataset data(scurve_umap_rmse) # Display the first few rows of the dataset head(scurve_umap_rmse)
The 'scurve_umap_rmse2' dataset contains error, RMSE, b2, b, m, a1, a2, and mean density (d_bar) for different number of bins in x-axis (b1).
data(scurve_umap_rmse2)data(scurve_umap_rmse2)
## 'scurve_umap_rmse2' A data frame with 70 rows and 10 columns:
Numeric, model error.
Numeric, Root Mean Square Error.
Numeric, number of bins along x-axis.
Numeric, number of bins along y-axis.
Numeric, number of total bins.
Numeric, number of non-empty bins.
Numeric, hexagon bin width.
Numeric, hexagon bin height.
Numeric, mean desnity.
Character, NLDR method.
This dataset is generated for illustrative purposes.
# Load the scurve_umap_rmse2 dataset data(scurve_umap_rmse2) # Display the first few rows of the dataset head(scurve_umap_rmse2)# Load the scurve_umap_rmse2 dataset data(scurve_umap_rmse2) # Display the first few rows of the dataset head(scurve_umap_rmse2)
The 'scurve_umap_rmse3' dataset contains error, RMSE, b2, b, m, a1, a2, and mean density (d_bar) for different number of bins in x-axis (b1).
data(scurve_umap_rmse3)data(scurve_umap_rmse3)
## 'scurve_umap_rmse3' A data frame with 70 rows and 10 columns:
Numeric, model error.
Numeric, Root Mean Square Error.
Numeric, number of bins along x-axis.
Numeric, number of bins along y-axis.
Numeric, number of total bins.
Numeric, number of non-empty bins.
Numeric, hexagon bin width.
Numeric, hexagon bin height.
Numeric, mean desnity.
Character, NLDR method.
This dataset is generated for illustrative purposes.
# Load the scurve_umap_rmse3 dataset data(scurve_umap_rmse3) # Display the first few rows of the dataset head(scurve_umap_rmse3)# Load the scurve_umap_rmse3 dataset data(scurve_umap_rmse3) # Display the first few rows of the dataset head(scurve_umap_rmse3)
The 'scurve_umap_rmse4' dataset contains error, RMSE, b2, b, m, a1, a2, and mean density (d_bar) for different number of bins in x-axis (b1).
data(scurve_umap_rmse4)data(scurve_umap_rmse4)
## 'scurve_umap_rmse4' A data frame with 70 rows and 10 columns:
Numeric, model error.
Numeric, Root Mean Square Error.
Numeric, number of bins along x-axis.
Numeric, number of bins along y-axis.
Numeric, number of total bins.
Numeric, number of non-empty bins.
Numeric, hexagon bin width.
Numeric, hexagon bin height.
Numeric, mean desnity.
Character, NLDR method.
This dataset is generated for illustrative purposes.
# Load the scurve_umap_rmse4 dataset data(scurve_umap_rmse4) # Display the first few rows of the dataset head(scurve_umap_rmse4)# Load the scurve_umap_rmse4 dataset data(scurve_umap_rmse4) # Display the first few rows of the dataset head(scurve_umap_rmse4)
The 'scurve_umap2' dataset contains the UMAP (Uniform Manifold Approximation and Projection) embeddings of a three-dimensional S-curve with added noise. Each data point is represented by two UMAP coordinates (UMAP1 and UMAP2) and an ID.
data(scurve_umap2)data(scurve_umap2)
## 'scurve_umap2' A data frame with 5000 rows and 3 columns:
Numeric, first UMAP 2-D embeddings.
Numeric, second UMAP 2-D embeddings.
Numeric, identifier for each data point.
This dataset is generated for illustrative purposes.
# Load the scurve_umap2 dataset data(scurve_umap2) # Display the first few rows of the dataset head(scurve_umap2)# Load the scurve_umap2 dataset data(scurve_umap2) # Display the first few rows of the dataset head(scurve_umap2)
The 'scurve_umap3' dataset contains the UMAP (Uniform Manifold Approximation and Projection) embeddings of a three-dimensional S-curve with added noise. Each data point is represented by two UMAP coordinates (UMAP1 and UMAP2) and an ID.
data(scurve_umap3)data(scurve_umap3)
## 'scurve_umap3' A data frame with 5000 rows and 3 columns:
Numeric, first UMAP 2-D embeddings.
Numeric, second UMAP 2-D embeddings.
Numeric, identifier for each data point.
This dataset is generated for illustrative purposes.
# Load the scurve_umap3 dataset data(scurve_umap3) # Display the first few rows of the dataset head(scurve_umap3)# Load the scurve_umap3 dataset data(scurve_umap3) # Display the first few rows of the dataset head(scurve_umap3)
The 'scurve_umap4' dataset contains the UMAP (Uniform Manifold Approximation and Projection) embeddings of a three-dimensional S-curve with added noise. Each data point is represented by two UMAP coordinates (UMAP1 and UMAP2) and an ID.
data(scurve_umap4)data(scurve_umap4)
## 'scurve_umap4' A data frame with 5000 rows and 3 columns:
Numeric, first UMAP 2-D embeddings.
Numeric, second UMAP 2-D embeddings.
Numeric, identifier for each data point.
This dataset is generated for illustrative purposes.
# Load the scurve_umap4 dataset data(scurve_umap4) # Display the first few rows of the dataset head(scurve_umap4)# Load the scurve_umap4 dataset data(scurve_umap4) # Display the first few rows of the dataset head(scurve_umap4)
This function generates a LangeviTour visualisation based on different conditions and input parameters with 2-D wireframe.
show_error_link_plots( point_data, edge_data, point_colours = c("#66B2CC", "#FF7755"), point_sizes = c(0, 1) )show_error_link_plots( point_data, edge_data, point_colours = c("#66B2CC", "#FF7755"), point_sizes = c(0, 1) )
point_data |
A tibble that contains the high-dimensional data, no-linear dimension reductions and model in high-dimensions. |
edge_data |
A tibble that contains the wireframe data (from and to). |
point_colours |
A character vector that contains the colours of points in the high-dimensional data and model. |
point_sizes |
A numeric vector that contains the sizes of points in the high-dimensional data and model. |
A browsable HTML element.
model_error <- augment(x = scurve_model_obj, highd_data = scurve) df_exe <- comb_all_data_model_error(highd_data = scurve, nldr_data = scurve_umap, model_highd = scurve_model_obj$model_highd, model_2d = scurve_model_obj$model_2d, error_data = model_error) edge_data <- scurve_model_obj$trimesh_data if (interactive()) { show_error_link_plots(point_data = df_exe, edge_data = edge_data) }model_error <- augment(x = scurve_model_obj, highd_data = scurve) df_exe <- comb_all_data_model_error(highd_data = scurve, nldr_data = scurve_umap, model_highd = scurve_model_obj$model_highd, model_2d = scurve_model_obj$model_2d, error_data = model_error) edge_data <- scurve_model_obj$trimesh_data if (interactive()) { show_error_link_plots(point_data = df_exe, edge_data = edge_data) }
This function generates a langevitour which visualise the model overlaid on high-dimensional data.
show_langevitour( point_data, edge_data, point_colours = c("#66B2CC", "#FF7755"), point_sizes = c(2, 1) )show_langevitour( point_data, edge_data, point_colours = c("#66B2CC", "#FF7755"), point_sizes = c(2, 1) )
point_data |
A tibble that contains the high-dimensional data and model in high-dimensions. |
edge_data |
A tibble that contains the wireframe data (from and to). |
point_colours |
A character vector that contains the colours of points in the high-dimensional data and model. |
point_sizes |
A numeric vector that contains the sizes of points in the high-dimensional data and model. |
A langevitour object with the model and the high-dimensional data.
df_exe <- comb_data_model(highd_data = scurve, model_highd = scurve_model_obj$model_highd, model_2d = scurve_model_obj$model_2d) edge_data <- scurve_model_obj$trimesh_data if (interactive()) { show_langevitour(point_data = df_exe, edge_data = edge_data) }df_exe <- comb_data_model(highd_data = scurve, model_highd = scurve_model_obj$model_highd, model_2d = scurve_model_obj$model_2d) edge_data <- scurve_model_obj$trimesh_data if (interactive()) { show_langevitour(point_data = df_exe, edge_data = edge_data) }
This function generates a LangeviTour visualisation based on different conditions and input parameters with 2-D wireframe.
show_link_plots( point_data, edge_data, point_colours = c("#66B2CC", "#FF7755"), point_sizes = c(0, 1) )show_link_plots( point_data, edge_data, point_colours = c("#66B2CC", "#FF7755"), point_sizes = c(0, 1) )
point_data |
A tibble that contains the high-dimensional data, non-linear dimension reductions and model in high-dimensions. |
edge_data |
A tibble that contains the wireframe data (from and to). |
point_colours |
A character vector that contains the colours of points in the high-dimensional data and model. |
point_sizes |
A numeric vector that contains the sizes of points in the high-dimensional data and model. |
A browsable HTML element.
df_exe <- comb_all_data_model(highd_data = scurve, nldr_data = scurve_umap, model_highd = scurve_model_obj$model_highd, model_2d = scurve_model_obj$model_2d) edge_data <- scurve_model_obj$trimesh_data if (interactive()) { show_link_plots(point_data = df_exe, edge_data = edge_data) }df_exe <- comb_all_data_model(highd_data = scurve, nldr_data = scurve_umap, model_highd = scurve_model_obj$model_highd, model_2d = scurve_model_obj$model_2d) edge_data <- scurve_model_obj$trimesh_data if (interactive()) { show_link_plots(point_data = df_exe, edge_data = edge_data) }
stat_hexgrid Custom Stat for hexagonal grid plot
stat_hexgrid( mapping = NULL, data = NULL, geom = GeomHexgrid$default_aes(), position = "identity", show.legend = NA, outliers = TRUE, inherit.aes = TRUE, ... )stat_hexgrid( mapping = NULL, data = NULL, geom = GeomHexgrid$default_aes(), position = "identity", show.legend = NA, outliers = TRUE, inherit.aes = TRUE, ... )
mapping |
Aesthetic mappings for the plot. |
data |
The data to be plotted. |
geom |
The geometry to be used in the plot. |
position |
The position adjustment to be applied. |
show.legend |
Whether to show the legend for this layer. |
outliers |
Whether to include outliers. |
inherit.aes |
Whether to inherit aesthetics from the plot or the layer. |
... |
Additional arguments to be passed to the 'layer' function. |
A 'ggplot2' layer object.
stat_trimesh Custom Stat for trimesh plot
stat_trimesh( mapping = NULL, data = NULL, geom = GeomTrimesh$default_aes(), position = "identity", show.legend = NA, outliers = TRUE, inherit.aes = TRUE, ... )stat_trimesh( mapping = NULL, data = NULL, geom = GeomTrimesh$default_aes(), position = "identity", show.legend = NA, outliers = TRUE, inherit.aes = TRUE, ... )
mapping |
Aesthetic mappings for the plot. |
data |
The data to be plotted. |
geom |
The geometry to be used in the plot. |
position |
The position adjustment to be applied. |
show.legend |
Whether to show the legend for this layer. |
outliers |
Whether to include outliers. |
inherit.aes |
Whether to inherit aesthetics from the plot or the layer. |
... |
Additional arguments to be passed to the 'layer' function. |
A 'ggplot2' layer object.
This function triangulates the bin centroids using the x and y coordinates provided in the input data frame and returns the triangular object.
tri_bin_centroids(centroids_data)tri_bin_centroids(centroids_data)
centroids_data |
The tibble containing the all the bin centroids. |
A triangular object representing the triangulated bin centroids.
all_centroids_df <- scurve_model_obj$hb_obj$centroids counts_data <- scurve_model_obj$hb_obj$std_cts umap_with_hb_id <- scurve_model_obj$hb_obj$data_hb_id df_bin_centroids <- merge_hexbin_mean(data_hb = umap_with_hb_id, counts_data = counts_data, centroids_data = all_centroids_df) tri_bin_centroids(centroids_data = df_bin_centroids)all_centroids_df <- scurve_model_obj$hb_obj$centroids counts_data <- scurve_model_obj$hb_obj$std_cts umap_with_hb_id <- scurve_model_obj$hb_obj$data_hb_id df_bin_centroids <- merge_hexbin_mean(data_hb = umap_with_hb_id, counts_data = counts_data, centroids_data = all_centroids_df) tri_bin_centroids(centroids_data = df_bin_centroids)
This function update the from and to indexes.
update_trimesh_index(trimesh_data)update_trimesh_index(trimesh_data)
trimesh_data |
A tibble that contains wireframe data. |
A tibble that contains the updated edge information.
tr_from_to_df <- scurve_model_obj$trimesh_data update_trimesh_index(trimesh_data = tr_from_to_df)tr_from_to_df <- scurve_model_obj$trimesh_data update_trimesh_index(trimesh_data = tr_from_to_df)