8.1. Application Documentation Standards

8.1.1. Introduction

The guidelines here describe how to write documentation for new applications conforming to the EMBOSS style that is used online:

http://emboss.open-bio.org/rel/dev/apps/

They also cover documentation for EMBASSY packages:

http://emboss.open-bio.org/rel/dev/apps/EMBASSYPackagesTable.html

To get a feel for the documentation, look for example at the documentation for the seqret application:

http://emboss.open-bio.org/rel/dev/apps/seqret.html

and for the HMMERNEW package:

http://emboss.open-bio.org/rel/dev/apps/hmmernew.html

You will notice that the application and package documentation is organised into sections for easy navigation. The sections, and processes for generating the documentation, are explained below.

8.1.2. Application Documentation

8.1.2.1. ACD File Documentation

An application ACD file (see Chapter 5, C Programming) is a self-contained description of the application parameters and definition of the command line interface. It does not require explicit documentation but in some cases, however, it is helpful to add comments to the ACD file. Comment lines begin with # and continue to the end of the line (see Section 4.1, “Introduction to ACD File Development”).

An ACD file includes an application definition describing the application itself, and one or more data definitions describing the parameters. Definitions have attributes which describe the application or parameter in detail. Data definitions are organised into sections in the file such as "Input", "Output" and so on. The ACD file is parsed when generating the application documentation. The components used include:

  • The application name (from the application definition) and short description (from the documentation: attribute of the application definition)

  • Example data files (from the "Input" section)

  • Command line synopsis

  • Table of application options

  • List of links to related applications (from the groups: attribute of the application definition)

Therefore you should ensure that the application ACD file is valid and properly formatted. Various utilities (Section 4.6, “ACD Utilities”) are provided for testing, validating and reformatting ACD files.

8.1.2.1.1. Application QA Test

The command-line sessions from the application quality assurance tests are included in the application documentation. You should therefore write these tests and run them (see Chapter 7, Quality Assurance) before documenting the application to make sure that the example files will be correctly generated.

If you did not write the QA test before documenting the application, rerun autodoc.pl as above and it will create the remaining three include files (usage examples and input and output files), with complete HTML documentation created in embassy/myemboss/emboss_doc/html/myprogram.html

8.1.2.2. Sections of Application Documentation

Sections in the application documentation are described in the table (Table 8.1, “Sections in Application Documentation”).

Table 8.1. Sections in Application Documentation
SectionDescriptionGeneration
NameApplication name, short description and version number.Generated automatically from the application C source code and ACD file.
FunctionTerse, formal description of application inputs, outputs and functionality.Written by the application author.
DescriptionDescription of the application suitable for the biologist end-user.Written by the application author.
Command-line argumentsSynopsis of how to use the application at the command line including command line synopsis and arguments table.Generated automatically.
UsageUsage example(s) which are command line sessions, or the equivalent in e.g. wEMBOSS, Jemboss or SOAPLAB.Generated automatically from the quality assurance test cases.
Input FilesExample input files. Optional description of input files (e.g. file formats) or URL linking to same.Example input files are generated automatically from the test cases. Description is written by the application author.
Data FilesExamples of data files. Optional description of data files (e.g. file formats) or URL linking to same.Example data files are generated automatically from the ACD file. Description is written by the application author.
Output FilesExample output files. Optional description of output files (e.g. file formats) or URL linking to same.Example output files are generated automatically from the test cases. Description is written by the application author.
AlgorithmTechnical description of the algorithm suitable for computer scientists.Written by the application author.
NotesPeripheral documentation such as usage notes.Written by the application author.
WarningsCautionary usage advice, known bugs etc.Written by the application author. The application-specific messages can be found by searching the code.
DiagnosticsDiagnostic warning and error messages the application might generate.Written by the application author. The application-specific messages can be found by searching the code.
AuthorsAuthor contact details.Generated automatically from the source code.
Revision HistoryApplication revision history, including date of last revision, name of revising author and brief remarks about the revision.Used for major revisions. Detailed history is available in CVS for EMBOSS code.
ReferencesLiterature references and instructions on how to cite the application.Instructions on how to cite EMBOSS are included automatically. Otherwise, written by the application author.
See AlsoList of links to applications in the same group.Generated automatically from the ACD file.
Target UsersThe group of users (such as biologists, bioinformaticians, system administrators etc.) the application is intended for.Written by the application author.
Exit StatusValues the application might return to the operating system on exit.Generated automatically from the source code.

8.1.2.3. Application Documentation Process

The process for generating the application documentation combines manually written components with parts that are generated automatically (mostly from parsing the ACD file and from the QA tests). The process is largely automated and involves running the autodoc.pl script which generates a part-completed "application template" which you complete by hand.

The application name and index terms is written directly to the application template. However, most of the automatically generated content is kept in "include files" that are generated from template XML include files.

autodoc.pl is included in the EMBOSS distribution under the scripts directory, e.g.

/home/auser/emboss/emboss/scripts/autodoc.pl

To document a new program, first ensure you have an up-to-date set of programs compiled, and that any programs you've written but which are not part of the main EMBOSS package have had their executable deleted. Otherwise references to them might occur in the automatically-generated "See Also" sections (see above). The ACD file should be complete and validated and QA tests for the application should have been run.

To generate the documentation, autodoc.pl is run on each application you wish to document in turn.

For EMBOSS applications:

autodoc.pl ApplicationName

For EMBASSY applications:

autodoc.pl -embassy=PackageName ApplicationName

You should replace PackageName and ApplicationName with something sensible.

The following example assumes you are working in the EMBASSY package myemboss and are writing a program called myprogram. To document the application:

  1. Move to the documentation directory:

    cd embassy/myemboss/emboss_doc/master
  2. The emboss_doc/master directory has a template file for documenting a myemboss application. Copy the application template to a file called myprogram.html in the same directory:

    cp template.html.save myprogram.html
  3. Edit this file, replacing "ProgramNameToBeReplaced" with the application name. This defines named include files for the auto-generated elements of the documentation.

  4. Run autodoc.pl:

    autodoc.pl -embassy=myemboss myprogram
  5. Complete myprogram.html writing documentation text in the places indicated (see below).

The script will run wossname to check that myprogram really exists, then generate the application template documentation file (for you to fill in) with include directives, plus include files for the following sections:

  • Name (entire section)

  • Synopsis (entire section)

  • Data Files (data file examples)

  • Authors (entire section)

  • Revision History (entire section)

  • References (instructions on how to cite EMBOSS only)

The include files for the following parts are generated from running the QA test which is why (typically) the QA test should be written before documenting your application:

  • Usage (entire section)

  • Input Files (input file examples only)

  • Output Files (output file examples only)

The application name and index terms in the application template are also set correctly. When all is done the HTML application template is created in:

embassy/myemboss/emboss_doc/html/myprogram.html

To complete the application template myprogram.html you add documentation text as follows:

  1. Write "Function" section.

  2. Write description of input files in "Input Files" section (optional).

  3. Write description of data files in "Data Files" section (optional).

  4. Write description of output files in "Output Files" section (optional).

  5. Write description of application in "Description" section.

  6. Write description of algorithm in "Algorithm" section.

  7. Write peripheral documentation in "Notes" section.

  8. Write usage advice, known bugs etc in "Warnings" section.

  9. Write warning and error messages in "Diagnostics" section.

  10. Write references in "References" section (if appropriate).

The template is commented enough for you to see how to fill it out.

autodoc.pl also generates documentation in plain text format (with all the text from the include files) that is used for manual pages and is displayed when running:

application_name -help

Once you complete the template and save it, the documentation (in HTML and plain text formats, plus include files) is ready for submission to the EMBOSS authors for publication online. Other online files that reference the new documentation, such as indices of applications (http://emboss.open-bio.org/rel/dev/apps/), will be updated automatically.

8.1.2.3.1. Documenting Applications when not using myemboss

When documenting EMBOSS applications then work in the directory:

doc/programs/master/emboss/apps/

Leave out the -embassy=myemboss qualifier from the autodoc.pl commandline:

autodoc.pl ApplicationName

The final documentation is written to:

doc/programs/html/myprogram.html
8.1.2.3.2. Worked Example

The example below (see ???) is for seqret. All paths are relative to the documentation directory e.g. /home/auser/emboss/emboss/doc/.

The application template file with include directives is:

./programs/master/emboss/apps/seqret.html
Files generated by autodoc.pl

The include files are below. All files are written to /programs/master/inc/:

/seqret.itableGenerated by running acdtable
.../seqret.ioneGenerated from the ACD file by autodoc.pl
.../seqret.ihelpGenerated from the ACD file by autodoc.pl
.../seqret.itableGenerated from the ACD file by autodoc.pl
.../seqret.iseeGenerated from seealso using the groups in the ACD file by autodoc.pl
.../seqret.usageGenerated from QA tests (using UsageExampleTemplate.xml)
.../seqret.inputGenerated from QA tests (using InputFilesTemplate.xml)
.../seqret.outputGenerated from QA tests (using OutputFilesTemplate.xml)
.../seqret.commentGenerated by autodoc.pl for editing by hand
.../seqret.historyGenerated by autodoc.pl for editing by hand

autodoc.pl generates the final HTML file, with all data included, that is used online:

./programs/html/seqret.html

autodoc.pl also writes a plain text file of documentation, containing exactly the same documentation as in the completed application template, but with all included text:

./programs/text/seqret.txt

8.1.3. EMBASSY Package Documentation

8.1.3.1. Sections of EMBASSY Package Documentation

The sections in the EMBASSY package documentation are described in the table (Table 8.2, “Sections in Package Documentation”).

Table 8.2. Sections in Package Documentation
SectionDescriptionGeneration
NamePackage name, short description and version number.Generated automatically from the application C source code and ACD file.
ContentsLinks to sections in the documentation.Generated automatically.
List of ApplicationsNames, short description and links to full documentation for the applications in the package.Generated automatically from the application ACD files.
FunctionTerse, formal description of the package and its main inputs, outputs and functionality using terms from a controlled vocabulary.Written by the application author.
DescriptionDescription of the package suitable for the biologist end-user.Written by the application author.
Installation NotesInstallation instructions for the package.General instructions are generated automatically. Information, such as required files or versions, that are specific to the package should be written by the application author.
NotesPeripheral documentation such as usage notes.Written by the application author.
WarningsCautionary usage advice, known bugs etc.Written by the application author.
AuthorsAuthor contact details.Generated automatically from the source code.
Revision HistoryPackage revision history, including date of last revision, name of revising author and brief remarks about the revision.Written by the application author.
ReferencesLiterature references and instructions on how to cite the application.Instructions on how to cite EMBOSS are generated automatically. Otherwise, written by the application author.

8.1.3.2. EMBASSY Package Documentation Process

The process for generating the EMBASSY package documentation is similar to that for applications. Manually written components are combined with automatically generated text. The process again involves running the autodoc.pl script which generates a part-completed package template which you complete by hand.

To document a new package, first ensure you have an up-to-date set of programs compiled. To generate the documentation run autodoc.pl on the package:

autodoc.pl PackageName

The following example assumes you have created a new EMBASSY package called mypackage. To document the package:

  1. Move to the documentation directory:

    cd embassy/mypackage/emboss_doc/master
  2. Copy the application template to a file called mypackage.html in the same directory. An example template is provided in the EMBASSY package myemboss. Change MYEMBOSS to the name of your package when you edit the template file:

    cp template.html.save mypackage.html
  3. Run autodoc.pl:

    autodoc.pl -embassy=mypackage
  4. Complete mypackage.html writing documentation text in the places indicated (see below).

The script will generate a template documentation file (for you to fill in) with include directives, plus include files for the following sections:

  • Name (entire section)

  • List of Applications (entire section)

  • Authors (entire section)

  • Revision History (entire section)

  • Installation Notes (general instructions only)

  • References (instructions on how to cite EMBOSS only)

The EMBASSY package name and index terms in the template are also set correctly. The HTML application template is created in:

embassy/mypackage/emboss_doc/html/mypackage.html

To complete the template mypackage.html add text in the places indicated:

  1. Write "Function" section:

  2. Write description of package in "Description" section.

  3. Write package-specific installation information in "Installation Notes" section (optional).

  4. Write peripheral documentation in "Notes" section.

  5. Write usage advice, known bugs etc in "Warnings" section.

  6. Write peripheral documentation in "Notes" section.

  7. Write references in "References" section (if appropriate).

Again, the template is commented so it is clear where to add the text.

autodoc.pl also generates documentation in plain text format (with all included text) that is included in the README file for the package.

Once you complete the template and save it, the documentation (in HTML and plain text formats, plus include files) is ready for submission to the EMBOSS authors for publication online. Other files that reference the new package, such as the master table of EMBASSY packages http://emboss.open-bio.org/rel/dev/apps/EMBASSYPackagesTable.html, will be updated automatically.