================================================================ dna2abc: Scanners: Rules ================================================================ The Rules sub-page of the Scanners page contains controls for editing the rule table for the selected scanner. It also contains controls for the scanner's frame length and step size. The rest of the controls do not affect the operation of the scanner, they are aids in writing regular expressions. The selected scanner's rules, frame, and step slots are edited by the table and the two number fields to its upper right. The large text fields (with colored backgrounds) at the top contain the test buffers, their values are stored in slots bufferA, bufferB, bufferC, and bufferD. The horizontal slider marks the current position in the test buffers, its value is stored in the index slot. ================================================================ ========== Rule Table ========== Each rule consists of a Tcl regular expression (regexp) and a Tcl script. The table starts out empty, insert a new rule with the "Insert above" button. Two text editing boxes appear. Each of them colorizes the text you type to highlight the syntax of what you're typing (i.e., the left box highlights regexp syntax, while the right box highlights Tcl). You can select a rule by clicking in either its regexp or script box. The number in the leftmost column will light up to indicate that the rule is selected, and the buttons below the table will be enabled for moving the rule, inserting and deleting rules. There is no undo, so save early and often! (Note: the order of the rules matters, since more than one rule may fire per step, and they fire in the order listed in the table. If a script returns with a break, subsequent rules won't fire that step.) You can drag the borders of the table to resize the rows and columns. You can also expand each row to be big enough to make all its text visible using the "Beautify Rule Table" item in the Run menu. ============ Test Buffers ============ When the scanner reads a DNA sequence, it chops it into "frame"-sized pieces and advances "step" bases each time. The four colored text boxes at the top of the Rules page can be used to test the regexps in your rule table. Fill one or more with a test sequence (perhaps cut and paste a line from your input DNA file into each box). A sequence "frame" bases long will be highlighted in white in each box, you can advance this "step" bases at a time using the slider beneath the test buffers. ======== Matching ======== Each time you move the slider, change the frame or step values, or type in a test buffer or regexp box, dna2abc matches all of the regexps in the table against the highlighted portions of the four test buffers. To the right of each test buffer is an indicator, an X will appear if one or more regexps match that test sequence. To the left of each regexp is a cluster of four indicators corresponding to the which of the four test buffers are matched by the regexp. If you have a long, complicated rule table, you might want to shut off the "Compute match on each keypress" option. Matches will still be computed when you move the slider or change the frame or step, and also when the "Compute Matches" item on the Run menu is chosen.