gtscript documentation

# `gtscript` documentation

This document describes the `gtscript` API. `gtscript` is basically Lua (an embeddable scripting language) plus parts of the GenomeTools C libraries exported to Lua. Because the GenomeTools binary `gt` contains an embedded Lua interpreter, `gtscript` files can be executed with the `gt` binary. The parts of the GenomeTools C libraries exported to Lua (the `gtscript` API) are described here, for a documentation of Lua itself and its APIs, please refer to the Lua reference manual.

See the index for an alphabetical list of all available interfaces.

## Notes

- You have to add `require 'gtlua'` to your script in order to load the parts of the `gtscript` API which are implemented in `gtscript` itself.
- By default, all functions of the `gtscript` API are contained in the `gt` table. That is, you have to prepend all functions calls with ```gt.`''. For example, write `gt.show()` to call the `show()` function documented below. You can use `gt.export()` or `gt.re()` to export the `gt` table to the global environment, which makes the prepending unnecessary (but clutters your global environment).
- If a function is documented as ``returns an array'', this means that the function returns a table where only consecutive integer keys from 1 on are used and which can be traversed with the `ipairs()` function.