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.
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.
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
Sections in the application documentation are described in the table (Table 8.1, “Sections in Application Documentation”).
Section | Description | Generation |
---|---|---|
Name | Application name, short description and version number. | Generated automatically from the application C source code and ACD file. |
Function | Terse, formal description of application inputs, outputs and functionality. | Written by the application author. |
Description | Description of the application suitable for the biologist end-user. | Written by the application author. |
Command-line arguments | Synopsis of how to use the application at the command line including command line synopsis and arguments table. | Generated automatically. |
Usage | Usage 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 Files | Example 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 Files | Examples 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 Files | Example 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. |
Algorithm | Technical description of the algorithm suitable for computer scientists. | Written by the application author. |
Notes | Peripheral documentation such as usage notes. | Written by the application author. |
Warnings | Cautionary usage advice, known bugs etc. | Written by the application author. The application-specific messages can be found by searching the code. |
Diagnostics | Diagnostic warning and error messages the application might generate. | Written by the application author. The application-specific messages can be found by searching the code. |
Authors | Author contact details. | Generated automatically from the source code. |
Revision History | Application 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. |
References | Literature 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 Also | List of links to applications in the same group. | Generated automatically from the ACD file. |
Target Users | The group of users (such as biologists, bioinformaticians, system administrators etc.) the application is intended for. | Written by the application author. |
Exit Status | Values the application might return to the operating system on exit. | Generated automatically from the source code. |
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 |
For EMBASSY applications:
autodoc.pl -embassy= |
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:
Move to the documentation directory:
cd embassy/myemboss/emboss_doc/master |
The emboss_doc/master
directory has a template file for documenting a myemboss application. Copy the application template to a file called
in the same directory: myprogram
.html
cp template.html.save |
Edit this file, replacing "ProgramNameToBeReplaced" with the application name. This defines named include files for the auto-generated elements of the documentation.
Run autodoc.pl:
autodoc.pl -embassy=myemboss |
Complete
writing documentation text in the places indicated (see below).myprogram
.html
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
you add documentation text as follows: myprogram
.html
Write "Function" section.
Write description of input files in "Input Files" section (optional).
Write description of data files in "Data Files" section (optional).
Write description of output files in "Output Files" section (optional).
Write description of application in "Description" section.
Write description of algorithm in "Algorithm" section.
Write peripheral documentation in "Notes" section.
Write usage advice, known bugs etc in "Warnings" section.
Write warning and error messages in "Diagnostics" section.
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:
|
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.
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 |
The final documentation is written to:
doc/programs/html/myprogram.html |
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 |
The include files are below. All files are written to /programs/master/inc/
:
/seqret.itable | Generated by running acdtable |
.../seqret.ione | Generated from the ACD file by autodoc.pl |
.../seqret.ihelp | Generated from the ACD file by autodoc.pl |
.../seqret.itable | Generated from the ACD file by autodoc.pl |
.../seqret.isee | Generated from seealso using the groups in the ACD file by autodoc.pl |
.../seqret.usage | Generated from QA tests (using UsageExampleTemplate.xml) |
.../seqret.input | Generated from QA tests (using InputFilesTemplate.xml) |
.../seqret.output | Generated from QA tests (using OutputFilesTemplate.xml) |
.../seqret.comment | Generated by autodoc.pl for editing by hand |
.../seqret.history | Generated 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 |
The sections in the EMBASSY package documentation are described in the table (Table 8.2, “Sections in Package Documentation”).
Section | Description | Generation |
---|---|---|
Name | Package name, short description and version number. | Generated automatically from the application C source code and ACD file. |
Contents | Links to sections in the documentation. | Generated automatically. |
List of Applications | Names, short description and links to full documentation for the applications in the package. | Generated automatically from the application ACD files. |
Function | Terse, formal description of the package and its main inputs, outputs and functionality using terms from a controlled vocabulary. | Written by the application author. |
Description | Description of the package suitable for the biologist end-user. | Written by the application author. |
Installation Notes | Installation 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. |
Notes | Peripheral documentation such as usage notes. | Written by the application author. |
Warnings | Cautionary usage advice, known bugs etc. | Written by the application author. |
Authors | Author contact details. | Generated automatically from the source code. |
Revision History | Package revision history, including date of last revision, name of revising author and brief remarks about the revision. | Written by the application author. |
References | Literature references and instructions on how to cite the application. | Instructions on how to cite EMBOSS are generated automatically. Otherwise, written by the application author. |
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 |
The following example assumes you have created a new EMBASSY package called mypackage
. To document the package:
Move to the documentation directory:
cd embassy/mypackage/emboss_doc/master |
Copy the application template to a file called
in the same directory. An example template is provided in the EMBASSY package myemboss. Change mypackage
.htmlMYEMBOSS
to the name of your package when you edit the template file:
cp template.html.save |
Run autodoc.pl:
autodoc.pl -embassy= |
Complete
writing documentation text in the places indicated (see below).mypackage
.html
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
add text in the places indicated: mypackage
.html
Write "Function" section:
Write description of package in "Description" section.
Write package-specific installation information in "Installation Notes" section (optional).
Write peripheral documentation in "Notes" section.
Write usage advice, known bugs etc in "Warnings" section.
Write peripheral documentation in "Notes" section.
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.