
Figure 1
GAPR visualization layout applied to the SAPSSANS dataset using the original (unsorted) data order. The proximity measures used in this example are Pearson correlation for variables and Euclidean distance for samples. (a) Data matrix, (b) row-wise proximity matrix, (c) column-wise proximity matrix, (d) Yd covariate annotation with the user-defined color palette, and (e) Xd covariate annotation with the Set1 palette.

Figure 2
Matrix layout after applying R2E seriation to the SAPSSANS dataset for both variables and samples. The figure shows clearer block structures compared to the original layout shown in Figure 1.

Figure 3
Built-in color palettes provided by the GAPR package, their spectrum types, and the parameters they are typically used with. 2grayscale palette is a continuous grayscale gradient for binary data, with white = 0 and black = 1.

Figure 4
Matrix layout after applying the AVG-R2E seriation method to the SAPSSANS dataset. (a) Column-wise proximity matrix and (b) row-wise proximity matrix, shown as magnified views of selected regions. (c) Complete layout of GAP. Compared to the standard R2E result in Figure 2, this layout refines the ordering by subtree flipping.
Table 1
Runtime comparison between GAPR’s C++-based R2E implementation and the R-based version in the seriation package. Benchmarks are conducted using datasets constructed by vertically replicating the iris dataset to create matrices with 600, 1,500, and 10,000 rows, respectively. Both methods yield identical ordering results.
| MATRIX SIZE | METHOD | RUNTIME (SEC) |
|---|---|---|
| 600 × 600 | GAPR::ellipse sort() | 0.14 |
| seriation::R2E | 1.42 | |
| 1500 × 1500 | GAPR::ellipse sort() | 2.37 |
| seriation::R2E | 31.21 | |
| 10000 × 10000 | GAPR::ellipse sort() | 896.45 |
| seriation::R2E | 84945.01 |
Table 2
Functional comparison of GAPR and selected R packages. 1Seriation package provides HCT-based ordering but does not expose full tree structure for further use. 2These packages provide heatmap-based visualization for a single matrix but do not support an integrated GAP visualization framework with proximity matrices, dendrograms, and covariates.
| FEATURE/CAPABILITY | GAPR | seriation | hclust() | corrplot | pheatmap | ComplexHeatmap |
|---|---|---|---|---|---|---|
| R2E implementation | Yes (C++) | Yes (R) | No | No | No | No |
| HCT | Yes (C++) | Partial1 | Yes (C) | Yes | Yes | Yes |
| Flipping support | Yes | No | No | No | No | No |
| Integrated visualization | Yes | No | No | Partial2 | Partial2 | Partial2 |
Table 3
Anti-Robinson metrics comparing R2E and AVG-R2E on sample ordering using the SAPSSANS dataset.
| ORDERING METHOD | AR | GAR(w = 5) | RGAR |
|---|---|---|---|
| R2E | 62127 | 831 | 0.224 |
| AVG-R2E | 68466 | 609 | 0.247 |
| seriation::OLO Average | 84484 | 478 | 0.305 |
| seriation::TSP | 114388 | 435 | 0.413 |

Figure 5
Comparison of generalized anti-Robinson (GAR) loss scores across different seriation methods shown in Table 3. The results indicate that R2E consistently achieves lower GAR scores across increasing window sizes for global structure.

Figure 6
Comparison of relative generalized anti-Robinson (RGAR) loss scores across different seriation methods as demonstrated in Table 3. The R2E method consistently achieves the lowest RGAR scores as w increases.

Figure 7
Matrix layout after applying the AVG-R2E seriation method to the Wine Quality dataset. (a) Column-wise proximity matrix and (b) row-wise proximity matrix, shown as magnified views of selected regions. (c) Complete layout of GAP.
