How to Baubles: adding markup to logfiles

This document describes the tags that you can add to output logfiles from programs, in order to improve the presentation of the results when those files are processed using baubles.

1 Introduction

Baubles currently recognises four principal types of section: summaries, warnings, results and references. These are summarised in the table below:

Type Description Section
Summary Arbitrary section of log file that the user might be particulary interested in 2.1
Warning Something that the user's attention should be drawn to, e.g. because they might need to take action or investigate further 2.2
Result Section of the logfile containing a set of key results that the user is probably most interested in after running the program 2.3
Reference One or more references for the program that generated the logfile. 2.4

The figures below given an idea of what baubles does with the different types of marked-up content.

Figure 1: warnings, results and references are extracted from the main logfile body and displayed prominently at the start.

Figure 2: summaries are highlighted in the main logfile body. Non-summary sections can be hidden (left) or displayed (right).

The following sections explain:

2 How to mark up summaries, warnings, results and references

The following sections outline the tags that you can insert into a logfile in order to indicate what kind of output different sections of the file contain.

2.1 Summary tags

Put summary tags around sections of logfile that you want highlighted for the user. In baubles, these sections are given prominence when the user views the logfile contents.

To indicate that a section of log should be counted as a summary, put the text:

<!--SUMMARY_BEGIN-->

at the start of the section, and

<!--SUMMARY_END-->

at the end.

There can be as many summary sections as you wish.

2.2 Warnings

Use warning markup to highlight information that you want to draw the user's attention to. Baubles extracts warning messages and prints them before the logfile contents.

If you're using the CCP4 libraries then you can call CCPERR(2,...) (in Fortran) or ccp4error(2,...) (in the C libraries - also callable from C++) which will automatically create a warning message in the correct format.

Otherwise you can generate your own markup using the template:

 $TEXT:Warning: $$ Any text here that you like $$
One or more lines of text about something that
the reader really ought to take note of.
 $$

The parts in bold are those that need to be included; anything in the "Any text here that you like" section is ignored by baubles, and can be left blank; the remaining text will be extracted by baubles and displayed as a warning, e.g.:

The following warnings were issued:

Warnings can (and probably should) be enclosed inside summaries, and a logfile can have as many warnings as necessary.

While there is a limit to the number of lines of text (currently around 50 lines) that can be put into a warning and still have it detected by baubles, typically warning messages are one or two lines at most.

2.3 Results

Each program can have at most one result section (or none). This is like a "master summary" for the program run.

Marking up the result is similar to the warnings above, the template looks like:

$TEXT:Result: $$ $$
Final Q-factor = 6

Final Z-factor = -12
$$

The text in the result section is extracted by baubles, then processed to and displayed as its own summary outside of the main logfile:

Result:

Final Q-factor = 6

Final Z-factor = -12

The text in the results section is subjected to a fairly sophisticated processing algorithm which tries to generate nicely-formatted HTML tables from the plain text. The best way to proceed for now is to try it and see what happens (and contact me for more information if it doesn't do what you want).

2.4 References

References use the same markup as warnings and results sections, for example from the current Refmac5 log:

$TEXT:Reference1: $$ comment $$ 
   "Refinement of Macromolecular Structures by the  Maximum-Likelihood Method:"
   G.N. Murshudov, A.A.Vagin and E.J.Dodson,(1997)
   Acta Crystallogr. D53, 240-255
   EU  Validation contract: BIO2CT-92-0524

 $$

In this case baubles collects all the references marked up in this way and prints a summary of references at the head of the log, e.g.:

Please consider citing the following papers:
  • Refmac5
    • "Refinement of Macromolecular Structures by the Maximum-Likelihood Method:" G.N. Murshudov, A.A.Vagin and E.J.Dodson,(1997) Acta Crystallogr. D53, 240-255 EU Validation contract: BIO2CT-92-0524

3 Examples of modified Refmac5 logfiles

The following examples are logfiles output from a recent version of Refmac5, with summaries, warnings and results inserted in order to demonstrate what is possible.

3.1 Refmac5 in Review Mode

  1. Original logfile and the baubles-processed version of the original logfile

  2. Version of the original logfile with additional markup inserted and the baubles-processed version

In the second example the following markup has been added by hand:

(You can see the differences between the files - you may need to use "View Source" after clicking the above link.)

3.2 Refmac5 in Refinement Mode

  1. Original logfile and the baubles-processed version of the original logfile

  2. Version of the original logfile with additional markup inserted and the baubles-processed version

In the second example the following markup has been added by hand:

(You can see the differences between the files - you may need to use "View Source" after clicking the above link.)

The final baubles-generated file also shows how baubles processes the text in the result section to generate tables, if the data appears to be tabular (as in this case).

4 Generating Baubles output from a logfile

If you have a logfile and wish to see what baubles does with it then from the command line you can run:

> baubles -o refmac5.html refmac5.log

where refmac5.log is the original logfile and the baubles-version will be written to refmac5.html.

To view the file, point a web browser at it, e.g:

> firefox refmac5.html

Obviously this requires that you have baubles installed. You can get it from here, which will install into a CCP4 6.0.2 distribution.


Peter Briggs February 2008