|Next: SQRS(1) Up: WFDB Applications Guide Previous: SNIP(1)||On This Page|
sortann rewrites the annotation file specified by record and annotator, arranging its contents in canonical (time, num, and chan) order. By default, WFDB applications run sortann as needed (from within wfdbquit or oannclose). If the environment variable WFDBNOSORT has been set (to any value), sortann will not be run automatically, and a warning message will be printed instead. In most such cases, you should run sortann as instructed by the warning message before reading the annotation file with any other WFDB application.
If the input contains two or more annotations with the same time, num, and chan fields, only the last one is copied. As a special case of this policy, if the last such annotation has anntyp = 0 (NOTQRS), no annotation is written at that location. Thus a program that generates input for sortann can effectively delete a previously written annotation by writing a NOTQRS annotation at the same location.
The sorted (output) annotation file is always written to the current directory. If the input annotation file is in the current directory, sortann replaces it unless you specify a different output annotator name (using the -o option). Note that the output annotation file is likely to be slightly shorter than the input file, since more compact storage is usually possible when all annotations are sorted.
If the input annotations are already in the correct order, no output is written unless you have used the -o option.
If you attempt to sort a very large annotation file, sortann may run out of memory. If this happens, use the -f and -t options to work on the file in sections of any convenient size, one at a time, then use mrgann(1) to concatenate the sections. Note that you must specify an output annotator name (with -o) when using the -f or -t options (to avoid replacing the entire input file with a sorted subset of its contents).
The working memory required by sortann is approximately 10 times the size of the annotation file. Since annotation files are rarely as large as 1 megabyte and available memory is rarely less than 10 megabytes, it is unlikely that sortann will exhaust available memory, however.
The -f and -t options may be used to select a portion of an annotation file for processing.
It may be necessary to set and export the shell variable WFDB (see setwfdb(1) ).
Table of Contents
Up: WFDB Applications Guide
Please e-mail your comments and suggestions to firstname.lastname@example.org, or post them to:PhysioNet
Updated 28 November 2018