library(microbiomefhir) library(tidyverse) library(curatedMetagenomicData) library(phyloseq) library(here)
The microbiomfhir package allows the conversion of a patient's OTU table into a structured FHIR DiagnosticReport. At this point the package only supports the import of phyloseq objects.
The package is currenlty available via GitHub
devtools::install_github("https://github.com/NiklasTR/microbiomefhir")
The package has, among others, the following requirements:
Let's use the package's built-in function to collect an example from Levi Waldron's excellent curated Metagenomic Data ressource.
pseq <- load_example()
Here is a glimpse at one of the OTU table profiles. We can see the patient identifier as the column name. Each row represents a taxonomic unit (from kingdom - Bacteria down to many species).
otu_table(pseq)[,1] %>% head(30)
We can simply export the patient's OTU table into a FHIR DiagnosticReport:
parse_json(pseq, file = here("output/my_first_microbiome_fhir_report.json"))
We can take a closer look at out output JSON file.
Without more data, the function currenlty makes multiple assumptions
readLines(here("output/my_first_microbiome_fhir_report.json"), 150)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.