Skip to content

03 Building and Serving Reports

Matin Nuhamunada edited this page Aug 22, 2023 · 6 revisions

Alt text

Building a Markdown Report of the results

Once the snakemake job is finished, we can build a Documentation style report using MKDocs. The reports will be generated from several pipeline-specific Jupyter Notebooks, which is converted into Markdown report.

The report can be generated using the command bgcflow build report. The report will be located in data/processed/<MY PROJECT>/docs/.

Note that even if some of the jobs are not completed, you can still build a report for already finished jobs.

More about the build command:

$ bgcflow build --help
Usage: bgcflow build [OPTIONS] {report|database}

  Build Markdown report or use dbt to build DuckDB database.

  bgcflow build "report" will generate a Markdown report from the Jupyter
  notebook.

  bgcflow build "database" will use dbt to build a DuckDB database from the
  BGCFlow results.

Options:
  -n, --dryrun         Test run.
  -c, --cores INTEGER  Use at most N CPU cores/jobs in parallel. (DEFAULT: 8)
  --bgcflow_dir TEXT   Location of BGCFlow directory. (DEFAULT: Current
                       working directory.)
  -h, --help           Show this message and exit.

Serving reports

Once the report has been completed, we can serve the MKDocs report using bgcflow serve --project <PROJECT NAME>, which by default will be served in http://localhost:8001. Running bgcflow serve will also list the available project names.

$ bgcflow serve
 - Use bgcflow serve --metabase to start a metabase server.

 - Use bgcflow serve --project <PROJECT_NAME> to serve a specific project report.
 - Available projects:
    - Lactobacillus_delbrueckii

 - Use bgcflow serve -h, --help for more information.

To serve the report from example project

bgcflow serve --project Lactobacillus_delbrueckii

image image image image image