Skip to content

R access to new cmgd releases via cmgdr (ExperimentHub is being retired) #291

Closed

Description

@seandavi

Give R users a path to the new releases. The curatedMetagenomicData Bioconductor package has always reached its users through ExperimentHub, which is being retired, so cmgdr reading our releases directly is the way forward.

What exists: seandavi/cmgdr

cmgdr is a low-level R client that reads the published layout directly: the JSON indexes, manifests, Parquet, per-study files and the frozen DuckLake catalog.

  • It imports only curl, digest and jsonlite.
  • duckdb and TreeSummarizedExperiment are optional.
  • Its download cache is verified by checksum.

That is the "read our releases directly" option, already built.

Checked against the first MVP release (cmgd_mpa4.2-2.3.0 / 2026-10-16), using pkgload::load_all on cmgdr 409ebad:

  • cmgd_release(), cmgd_tables() (all 12 tables, with each table's licence: Olm-derived tables show CC-BY-4.0) and cmgd_studies() all work.
  • cmgd_species_tse(rel, "BaiX_2021") returns 1245 species × 24 samples.
  • cmgd_connect() attaches the catalog. SQL on sample_metadata_harmonized works (health_condition 125, country 125, sex 124, age_years 89, antibiotics 70).

Gaps for the new metadata

  • Sample metadata in colData. cmgd_species_tse() uses qc.tsv as colData. The metadata (samples, sample_metadata_harmonized / _cmd / _olm) is reachable only through SQL. Add a cmgd_sample_metadata(rel, source = c("harmonized","cmd","olm")) that returns one row per sample, and an option to join it into the TSE's colData.
  • Licence and attribution. When Olm-derived columns are returned, show the CC-BY-4.0 attribution, for example as a message or in metadata(tse).
  • Provenance. Expose provenance.json (pipeline, databases, metadata source releases) on the release object.
  • Search by run accession. The samples table has run_accessions as text joined with ;. A helper to find a sample from an SRR would help.
  • Add a fixture release with metadata tables to cmgdr's tests (the fixtures already come from nextflow_telemetry).

Distribution

ExperimentHub is going away, so it is not an option. What remains:

  1. Where cmgdr lives. It could go on CRAN, on Bioconductor as a software package (check Bioconductor's policy on packages that read from outside web resources), or stay on GitHub with r-universe.
  2. Relationship to the existing curatedMetagenomicData package. The existing package depends on ExperimentHub, so it needs a new backend either way. Should it be rebuilt on cmgdr, keeping returnSamples() and sampleMetadata for existing users? Who maintains it? (@lwaldron?) MetaPhlAn 4.2 / vJan26 also uses a different taxonomy from the current package data.
  3. Citable versions for R users. Without ExperimentHub's snapshots, cite a milestone release by its DOI (Zenodo deposit strategy at corpus scale (milestones, what to include) #292), and have cmgdr pin a release by date.

Suggested first step

Add cmgd_sample_metadata() and a colData join to cmgdr, using the release published now. That is small, and it makes the new metadata usable from R immediately.

🤖 Generated with Claude Code

Activity

  1. changed the title [-]R / Bioconductor access to new cmgd releases (ExperimentHub or direct)[/-] [+]R access to new cmgd releases: extend cmgdr for metadata; decide on ExperimentHub[/+] on Oct 16, 2026
  2. changed the title [-]R access to new cmgd releases: extend cmgdr for metadata; decide on ExperimentHub[/-] [+]R access to new cmgd releases via cmgdr (ExperimentHub is being retired)[/+] on Oct 16, 2026
  3. seandavi commented on Oct 16, 2026

    @seandavi
    OwnerAuthor

    Position (tentative, not yet discussed with the team):

    • cmgdr stays a low-level client: it finds releases, lists tables, studies and files, verifies downloads, attaches the catalog and returns plain tables. It does not try to be the user-facing package.
    • A user-facing package, whether a curatedMetagenomicData successor or something new, should be built by someone who uses the data, on top of cmgdr.

    What that means for the checklist above:

    • cmgd_sample_metadata() still fits cmgdr. It returns the published metadata tables (harmonized, cmd or olm) as plain data frames, with the licence and attribution attached.
    • Provenance on the release object, and run-accession lookup, are also low-level and stay.
    • The colData join, the API compatibility questions (returnSamples(), sampleMetadata) and the handling of the taxonomy change belong to the user-facing package. cmgdr's existing cmgd_species_tse() stays as a convenience.

    To raise with the cMD team (@lwaldron): who builds and owns the user-facing package, and what it needs from cmgdr.

  4. seandavi commented on Oct 16, 2026

    @seandavi
    OwnerAuthor

    cmgd_sample_metadata() landed in cmgdr (seandavi/cmgdr#3, closes seandavi/cmgdr#2). All 9 acceptance tests pass, and CI is green on macOS, Ubuntu and Windows. Verified live: cmgd_sample_metadata(rel, study = "BaiX_2021", wide = TRUE) returns 24 × 10, with licence CC-BY-4.0 and the Olm DOI in the attribution message. One thing it shows: numbers come out as "44.0", and cMD has 53/53.0 duplicates, which wide output ;-joins. That is a metadata-store normalization issue, tracked in #288.

  5. lwaldron commented on Oct 16, 2026

    @lwaldron

    Makes sense to me. I'll see how observing cmgdr affects the cMD refactor.

  6. lwaldron commented on Oct 16, 2026

    @lwaldron

    Oh and I see the earlier question now, yes I would aim to preserve the cMD API, especially returnSamples() and sampleMetadata(). I have wrote permission to cMD on Bioconductor and can act as maintainer for now.

  7. seandavi commented on Oct 16, 2026

    @seandavi
    OwnerAuthor

    Scope settled (cmgdr stays a low-level client; a user-facing package builds on it) and cmgd_sample_metadata() shipped in seandavi/cmgdr#3. The remaining work (fixtures, provenance, run-accession lookup, distribution, ownership of the user-facing package) is tracked in seandavi/cmgdr#4. #292 and #288 stay here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    discussionOpen question; no decision or commitment yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions