Skip to contents

What this article is for

The main real-data workflow now lives in:

  • Choosing Layouts for Real Data

This companion keeps the HMP/U01-specific material that is still useful on its own:

  • the structure of the bundled hmp.u01.gc.coarse object,
  • the coarsening provenance,
  • and the location of the bundled precomputed search artifacts.
library(grip)

data(hmp.u01.gc.coarse)

The bundled graph object

hmp.u01.gc.coarse is a weighted, coarsened real-world graph derived from the giant connected component of the HMP+U01 16S amplicon iKNN graph.

graph.info <- data.frame(
  quantity = c(
    "source dataset",
    "representation",
    "selected k",
    "original giant-component vertices",
    "coarsened vertices",
    "weighted undirected edges"
  ),
  value = c(
    hmp.u01.gc.coarse$graph_info$source_dataset,
    hmp.u01.gc.coarse$graph_info$representation,
    hmp.u01.gc.coarse$graph_info$selected_k,
    hmp.u01.gc.coarse$graph_info$original_vertices,
    hmp.u01.gc.coarse$graph_info$coarse_vertices,
    hmp.u01.gc.coarse$graph_info$edge_count
  ),
  stringsAsFactors = FALSE
)

knitr::kable(graph.info)
quantity value
source dataset HMP+U01 16S amplicon
representation >=1% relative abundance + PCA
selected k 3
original giant-component vertices 6474
coarsened vertices 1828
weighted undirected edges 4656

The object contains four top-level components:

names(hmp.u01.gc.coarse)
#> [1] "adj_list"    "weight_list" "vertex_data" "graph_info"
  • adj_list
  • weight_list
  • vertex_data
  • graph_info

The vertex_data frame includes aggregated biological labels such as cst and subcst:

names(hmp.u01.gc.coarse$vertex_data)
#>  [1] "coarse_id"          "vertex_id"          "size"              
#>  [4] "cst"                "subcst"             "dcst.depth1.absorb"
#>  [7] "dcst.depth1.rare"   "dcst.depth2.absorb" "dcst.depth2.rare"  
#> [10] "ph"                 "log10_reads"

Coarsening provenance

The coarsening history records how the graph was reduced at each round, including the number of retained vertices and the matching ratio.

knitr::kable(hmp.u01.gc.coarse$graph_info$coarsening_rounds)
round n_old n_new
1 6474 3449
2 3449 1828

This provenance is useful when the graph is used as a benchmark or manuscript example, because it makes the bundled object reproducible as a derived graph rather than just a static artifact.

Bundled search artifacts

The package ships precomputed HMP/U01 search results used by the main real-data vignette. The artifact directory is:

system.file("extdata", "hmp_u01_gc_coarse", package = "grip")
#> [1] "/tmp/RtmpavjEAB/temp_libpath1f404dbffde/grip/extdata/hmp_u01_gc_coarse"

The bundled results file used in the real-data vignette is:

path <- system.file(
  "extdata", "hmp_u01_gc_coarse", "vignette_results.rds",
  package = "grip"
)
path
#> [1] "/tmp/RtmpavjEAB/temp_libpath1f404dbffde/grip/extdata/hmp_u01_gc_coarse/vignette_results.rds"

It contains:

hmp.results <- readRDS(path)
names(hmp.results)
#> [1] "graph_label"          "graph_info"           "preset_summary"      
#> [4] "preset_runs"          "local_search_summary" "local_search_runs"   
#> [7] "top_preset"           "top_local_candidates" "layouts"

These precomputed artifacts keep the full HMP/U01 workflow available without making regular vignette builds excessively heavy.

Where the workflow now lives

For the actual layout-selection workflow on this graph, including:

  • preset shortlisting,
  • local search,
  • metric tables,
  • and CST-colored projected layouts,

see:

  • Choosing Layouts for Real Data

That vignette now contains the HMP/U01 case study in a form that sits directly alongside the smaller unweighted and weighted real-data examples.