Repository navigation
feat(fair): record figure provenance, export plotted data, and add FAIR metadata - #69
Merged
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.jsonnext 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 withchecksums = 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 = TRUEalso 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
columnsdata 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 = FALSEturns 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:
?lcmsPlot-formatshelp 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 version is bumped to 1.1.24, with NEWS entries.
Checks run locally:
:=in the report index and page tables) comes from files this PR does not change.yin the devel version number.Closes #68