Skip to content

feat(fair): record figure provenance, export plotted data, and add FAIR metadata - #69

Merged
oss6 merged 5 commits into
develfrom
feature/68/improve-fairness
Oct 29, 2026
Merged

oss6 merged 5 commits into
develfrom
feature/68/improve-fairness

Conversation

@oss6

@oss6 oss6 commented Oct 28, 2026 •

Copy link
Copy Markdown
Member

Make lcmsPlot and its outputs more FAIR. Exported figures and reports now carry a record of how they were made, the plotted data can be written as open tables, and the package metadata is easier for registries to harvest.

lp_save() saves the plot of a pipeline with ggsave() and writes <file>.provenance.json next to it. The record holds the versions of lcmsPlot, R, Bioconductor and every loaded package, the pipeline layers with their arguments (read from the history slot), and the input files with their size and modification time. MD5 checksums are added only with checksums = TRUE, because hashing large raw files is slow. The sidecar is named after the full file name so that the PDF and the PNG of a figure each keep their own. data = TRUE also writes the plotted data to <stem>_data/.

lp_export_data() writes the datasets a pipeline draws as CSV or TSV, in the tidy form the plot is drawn from. It also writes the detected peaks, the samples, and a columns data dictionary with the type, unit and description of every column. Retention times are always in seconds. The per-dataset loop of .render_plot() moves into .plot_datasets(), so plotting and export share it.

lp_report() records its provenance by default. HTML reports get a closing provenance section, the full record as an embedded JSON script element, and a generator meta tag. PDF reports get a closing provenance page and their title in the document metadata. Both formats write the sidecar too. provenance = FALSE turns all of this off. Three existing report tests change to match: two PDF page counts include the new page, and the plots-only test turns provenance off.

Metadata and documentation:

  • codemeta.json is generated with codemetar. CONTRIBUTING now asks for it to be regenerated with every version bump.
  • biocViews add Software, Lipidomics, Visualization and ShinyApps. All four were checked against the biocViews vocabulary.
  • A new ?lcmsPlot-formats help page lists every supported input with its versions, how to read it, and the packages it needs. The README table gains a Versions column, and the vignette's Interoperability section shows the same table.
  • The vignette gains a section on saving figures with provenance.
  • The README gains badges for R CMD check, the Bioconductor devel build, and the licence.

The version is bumped to 1.1.24, with NEWS entries.

Checks run locally:

  • devtools::test(): 282 tests, 949 expectations, 0 failures.
  • R CMD check with suggests not forced, because MsBackendRawFileReader is not installed locally: 0 errors, 0 warnings. The one note (:= in the report index and page tables) comes from files this PR does not change.
  • BiocCheck reports the same checks as on devel. Its only warning is the odd y in the devel version number.
  • The lcms_data_plotting vignette renders.

Closes #68

oss6 added 5 commits October 28, 2026 16:24
Add a codemeta.json generated from DESCRIPTION with codemetar, so
software registries can harvest the package metadata, and note in
CONTRIBUTING that it is regenerated with every version bump.

Extend biocViews with Software, Lipidomics, Visualization and
ShinyApps, which are all in the biocViews vocabulary.

Refs #68
Add lp_save(), which saves the plot of a pipeline with ggsave() and
writes a <file>.provenance.json next to it: the versions of lcmsPlot, R,
Bioconductor and every loaded package, the pipeline layers with their
arguments (from the history slot), and the input files with their size
and modification time, plus MD5 checksums with checksums = TRUE. The
sidecar is named after the full file name so the PDF and PNG of a figure
each keep their own.

Add lp_export_data(), which writes the plotted datasets as CSV or TSV in
the tidy form the plot is drawn from, with the detected peaks, the
samples, and a columns data dictionary (type, unit, description).
lp_save(data = TRUE) calls it into <stem>_data/.

The per-dataset loop of .render_plot() moves into .plot_datasets() so
that plotting and the export share it.

Refs #68
lp_report() now closes with a provenance section, the last page of a
PDF report, listing the versions of lcmsPlot, R and Bioconductor, the
pipeline layers with their arguments, and the input files. The full
record, with every loaded package version, is written next to the
report as <file>.provenance.json and, in HTML reports, embedded as a
JSON script element alongside a generator meta tag. PDF reports carry
their title in the document metadata.

provenance = FALSE leaves all of this out, and checksums = TRUE adds the
MD5 of every input file.

Refs #68
Add a ?lcmsPlot-formats help page listing every supported input with
the versions it supports, the way to read it, and the packages it needs
beyond the imports, and link it from lcmsPlot(). The README table gains
a Versions column, and the Interoperability section of the vignette
shows the same table.

The vignette also gets a section on saving figures with lp_save() and
exporting the plotted data with lp_export_data(), and the README
overview mentions both.

Refs #68
Add README badges for R CMD check, the Bioconductor devel build, and
the GPL-3 licence.

Refs #68
@oss6
oss6 merged commit 655c0d1 into devel Oct 29, 2026
1 check passed
@oss6
oss6 deleted the feature/68/improve-fairness branch October 29, 2026 10:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve FAIRness

1 participant