html-report-generation-from-processed-omics
Summary
Generate publication-ready HTML quality control reports and tab-delimited summary exports from processed metabolomics data objects. This skill produces interactive visual summaries and machine-readable outputs after data normalization and quality control filtering.
When to use
After completing batch normalization and quality control filtering on a Metaboprep object, when you need to communicate QC decisions, visualize exclusion patterns, and export final processed data for downstream analysis or sharing with collaborators.
When NOT to use
- Input Metaboprep object has not yet undergone quality_control() — report will reflect unfiltered raw data only
- Output directory does not exist or lacks write permissions
- Data has already been exported in final form and only HTML visualization is needed (use generate_report alone)
Inputs
- Metaboprep object (post batch_normalise and post quality_control)
- project name (string)
- output directory path (string)
Outputs
- HTML QC report file (project_name_metaboprep_qc_report.html)
- Tab-delimited processed data matrix (.txt or .tsv)
- Tab-delimited sample metadata (.txt or .tsv)
- Tab-delimited feature metadata (.txt or .tsv)
How to apply
Load the quality-controlled Metaboprep object (post-batch_normalise and post-quality_control). Call generate_report() with the project name, output directory, format='html', and template='qc_report' to render an interactive HTML report summarizing sample and feature exclusion statistics, diagnostic plots, and QC thresholds applied. Simultaneously call export() with format='metaboprep' to write the processed data matrix, sample metadata, and feature metadata as tab-delimited text files (.txt/.tsv) to the same output directory. The report template uses rmarkdown and knitr to knit ggplot2-based visualizations and kableExtra-styled tables. Verify that the HTML file (project_name_metaboprep_qc_report.html) and corresponding .txt/.tsv files exist and contain expected row/column counts matching the QC-filtered Metaboprep object.
Related tools
- metaboprep (R package providing generate_report() and export() methods for Metaboprep objects) — https://github.com/MRCIEU/metaboprep
- rmarkdown (Renders R markdown templates to HTML report)
- knitr (Executes embedded R code blocks within markdown during report generation)
- ggplot2 (Produces statistical graphics embedded in the QC report)
- kableExtra (Formats and styles summary tables in the HTML report)
Examples
mydata <- mydata |> quality_control(source_layer = "input", sample_missingness = 0.2, feature_missingness = 0.2); generate_report(mydata, project_name = "my_study", output_dir = "./results", format = "html", template = "qc_report"); export(mydata, directory = "./results", format = "metaboprep")
Evaluation signals
- HTML file exists at expected path and is valid HTML (can be opened in a web browser)
- Tab-delimited text files exist with expected filenames and contain data matching QC-filtered Metaboprep object dimensions (rows = samples/features, columns = metadata fields)
- Report visually displays exclusion counts and codes matching the Exclusion Codes Summary from summary(mydata)
- Sample and feature counts in exported files are consistent with the reduced sample and feature count after quality_control filtering
- HTML report contains functional visualizations (dendrograms, summary plots) rendered without rendering errors
Limitations
- Report generation requires rmarkdown and knitr to be installed; rendering may fail if dependencies are missing or incompatible
- Large datasets (>10,000 features or >1,000 samples) may produce HTML files that are slow to load or render in some web browsers
- The qc_report template is tailored to metabolomics; application to other omics data types (proteomics, genomics) may require custom templates
- Export format is currently limited to tab-delimited text; other formats (Excel, HDF5, NetCDF) are not supported by export(format='metaboprep')
Evidence
- [methods] Call generate_report() with project name, output directory, format='html', and template='qc_report': "Call generate_report() with project name, output directory, format='html', and template='qc_report' to render the QC report."
- [methods] Call export() to write processed data, sample metadata, and feature metadata as tab-delimited text files: "Call export() with format='metaboprep' to write processed data, sample metadata, and feature metadata as tab-delimited text files to the specified output directory."
- [methods] Verify that HTML report file and tab-delimited exports exist in output directory: "Verify that the HTML report file (project_name_metaboprep_qc_report.html) and associated tab-delimited exports (.txt/.tsv) exist in the output directory."
- [intro] Generate summary data as tab-delimited text file and html report: "Provide useful summary data in the form of tab-delimited text file and a html report"
- [readme] Metaboprep generates tab-delimited text files and HTML report as outputs: "Provide useful summary data in the form of tab-delimited text file and a html report."
1---2name: html-report-generation-from-processed-omics3description: Use when after completing batch normalization and quality control filtering on a Metaboprep object, when you need to communicate QC decisions, visualize exclusion patterns, and export final processed data for downstream analysis or sharing with collaborators.4license: CC-BY-4.05---67# html-report-generation-from-processed-omics89## Summary1011Generate publication-ready HTML quality control reports and tab-delimited summary exports from processed metabolomics data objects. This skill produces interactive visual summaries and machine-readable outputs after data normalization and quality control filtering.1213## When to use1415After completing batch normalization and quality control filtering on a Metaboprep object, when you need to communicate QC decisions, visualize exclusion patterns, and export final processed data for downstream analysis or sharing with collaborators.1617## When NOT to use1819- Input Metaboprep object has not yet undergone quality_control() — report will reflect unfiltered raw data only20- Output directory does not exist or lacks write permissions21- Data has already been exported in final form and only HTML visualization is needed (use generate_report alone)2223## Inputs2425- Metaboprep object (post batch_normalise and post quality_control)26- project name (string)27- output directory path (string)2829## Outputs3031- HTML QC report file (project_name_metaboprep_qc_report.html)32- Tab-delimited processed data matrix (.txt or .tsv)33- Tab-delimited sample metadata (.txt or .tsv)34- Tab-delimited feature metadata (.txt or .tsv)3536## How to apply3738Load the quality-controlled Metaboprep object (post-batch_normalise and post-quality_control). Call generate_report() with the project name, output directory, format='html', and template='qc_report' to render an interactive HTML report summarizing sample and feature exclusion statistics, diagnostic plots, and QC thresholds applied. Simultaneously call export() with format='metaboprep' to write the processed data matrix, sample metadata, and feature metadata as tab-delimited text files (.txt/.tsv) to the same output directory. The report template uses rmarkdown and knitr to knit ggplot2-based visualizations and kableExtra-styled tables. Verify that the HTML file (project_name_metaboprep_qc_report.html) and corresponding .txt/.tsv files exist and contain expected row/column counts matching the QC-filtered Metaboprep object.3940## Related tools4142- **metaboprep** (R package providing generate_report() and export() methods for Metaboprep objects) — https://github.com/MRCIEU/metaboprep43- **rmarkdown** (Renders R markdown templates to HTML report)44- **knitr** (Executes embedded R code blocks within markdown during report generation)45- **ggplot2** (Produces statistical graphics embedded in the QC report)46- **kableExtra** (Formats and styles summary tables in the HTML report)4748## Examples4950```51mydata <- mydata |> quality_control(source_layer = "input", sample_missingness = 0.2, feature_missingness = 0.2); generate_report(mydata, project_name = "my_study", output_dir = "./results", format = "html", template = "qc_report"); export(mydata, directory = "./results", format = "metaboprep")52```5354## Evaluation signals5556- HTML file exists at expected path and is valid HTML (can be opened in a web browser)57- Tab-delimited text files exist with expected filenames and contain data matching QC-filtered Metaboprep object dimensions (rows = samples/features, columns = metadata fields)58- Report visually displays exclusion counts and codes matching the Exclusion Codes Summary from summary(mydata)59- Sample and feature counts in exported files are consistent with the reduced sample and feature count after quality_control filtering60- HTML report contains functional visualizations (dendrograms, summary plots) rendered without rendering errors6162## Limitations6364- Report generation requires rmarkdown and knitr to be installed; rendering may fail if dependencies are missing or incompatible65- Large datasets (>10,000 features or >1,000 samples) may produce HTML files that are slow to load or render in some web browsers66- The qc_report template is tailored to metabolomics; application to other omics data types (proteomics, genomics) may require custom templates67- Export format is currently limited to tab-delimited text; other formats (Excel, HDF5, NetCDF) are not supported by export(format='metaboprep')6869## Evidence7071- [methods] Call generate_report() with project name, output directory, format='html', and template='qc_report': "Call generate_report() with project name, output directory, format='html', and template='qc_report' to render the QC report."72- [methods] Call export() to write processed data, sample metadata, and feature metadata as tab-delimited text files: "Call export() with format='metaboprep' to write processed data, sample metadata, and feature metadata as tab-delimited text files to the specified output directory."73- [methods] Verify that HTML report file and tab-delimited exports exist in output directory: "Verify that the HTML report file (project_name_metaboprep_qc_report.html) and associated tab-delimited exports (.txt/.tsv) exist in the output directory."74- [intro] Generate summary data as tab-delimited text file and html report: "Provide useful summary data in the form of tab-delimited text file and a html report"75- [readme] Metaboprep generates tab-delimited text files and HTML report as outputs: "Provide useful summary data in the form of tab-delimited text file and a html report."