############################################################################## ############################################################################## Note: non interactive mode: requires one of -p, -cg -png, or -jpg or -ss from the command line. Example: sir_graph -p file where file.ct is a ct file will generate a postscript file. ______________________________ |1. sir_graph Documentation | |____________________________| sir_graph ############################################################################## ############################################################################## ________________________ |II. Brief Instructions| |______________________| Example ct files: mdv1_1.ct, mdv1_2.ct, etc. Below, assume that file.ct is a valid ct file. To generate a circle graph as postscript output: sir_graph -cg file To generate a structure based on a circle graph as postscript: sir_graph -p file To generate a structure based on a circle graph as postscript with automatic fixing of loops: sir_graph -fix -p file To generate a structure based on a circle graph as jpg output: sir_graph -jpg test_1 To generate a structure based on natural angles as postscript: sir_graph -p -n test_1 To view a structure in interactive mode based on a circle graph: sir_graph test_1 To view a structure in interactive mode based on a circle graph with automatic fixing of loops: sir_graph -fix test_1 -jpg, -png create jpeg and png output. jpg and png can be used interchangably throught this documentation. ########################################################################### ########################################################################### __________________________ | III. Input | |________________________| For ct files, the .ct is optional, but the program tries to open the file as given before appending the .ct. Files starting with MFOLD in the data with be treated as GCG format,but others will be treated as ct files. For using this program to edit and save results for future editing: Save the file with: Create ss output When editing the file "name".ct, this creates a file "name".new.ss When editing the file "name".ss this creates a file "name".new.ss To use any ss file as input with sir_graph, Use the complete file name. The .ss at the end will indicate to the program to treat it like a ss file. (Some ss files contain extra lines at the end specifying font sizes, colors, line widths, etc. This program should should ignore these lines.) The program does not generate circle graph output for .ss files. ############################################################################ ############################################################################ __________________________________ |IV. Interactive Mode Information| |________________________________| When -p, -png, -jpg and -cg are omitted from the command line, sir_graph begins with an interactive editing mode. Example: sir_graph test_1 ______________ | Windows: | |____________| 1. Edit window, Allows editing, and zooming of structure. 2. Main window, This small window shows the entire structure. It has a box that can be resized and moved to indicate what portion of the structure is shown in the edit window. 3. Information Window, Shows the current domain, or base as selected in the edit window, and the function of the mouse within the edit window. Domain drawing information is given such as clockwise, counter-clockwise, with loops automatically fixed, and with regularized angles. 4. Input Window, Pops up to ask for file names for saving. All windows are resizable. _____________________ |Key Usage: | |___________________| For Edit Window Moves structure Left Moves structure Right Moves structure UP Moves structure Down Zooms in to magnify Structure. Zooms out to make structure smaller. For the Main Window Moves box Left (Moves structure right in Edit window) Moves box Right Moves box UP Moves box Down Zooms in to magnify Structure in Edit window. Zooms out to make structure smaller in Edit window. For the Input Window Should be functional. (Cursor keys are not functional.) ________________________________________________________ |Menu options: (Not all options appear in each window) | |______________________________________________________| Undo: The program stores the current state and two previous states of the image as it is edited. This option cycles back through these three states. Mouse: The right button brings up a menu in all windows. For the Main window, clicking on left button of the Main window selects the portion of the structure to show in the edit window. For the Edit window zoom : the spot clicked becomes the center of the window. The left button zooms in, the middle button zooms out on the spot. Edit : The left button identifies a base or base pair in the information window. This button will also drag a single stranded base while pressed. For a double stranded base, the left botton will move a helix if the base pair is the first of a helix. It will rotate the helix for any other base pair. Simply, press the button the base pair, drag the mouse, and release the button. For -f or -fa, see tutorial part II. Loop Stretch: With the left button, click on any base in a loop, and drag the base away, or toward the center of the loop to adjust the radius of the loop. Loop Natural: click on a loop to redraw the loop with natural angles using the left button. Loop Regularize: When a loop is clicked on, each helix angle is rounded off based on the value from Set Regularize Angle. This works the same as Regularize All Angles, except it applies to only one loop. Loop Fix: For Circle graph angles, bases around a loop are spread out so that they are not drawn on top of each other. Single Strand Stretch: With the left button, click on the middle base of a single stranded region and drag the base away or toward the center of its loop. The strand should move away or toward the center of the loop. (Does not work with -f or -fa below) Single Strand Linear: Similar to above, but click on any base of a single stranded region. The base can be moved and other bases of the single stranded region will be spaced equidistant between it and the helix on either side. It is most useful for a single stranded region at the end of a sequence. It can place the single stranded bases in a line and make the exterior loop look less like circular RNA/DNA. (Added June 16, 2000) Base Pair Lines/Dots: Switch the connections between base pairs from lines to dots, and back. Outline Mode On/Off: When on, letters representing bases are not drawn. Loop Labels On/Off: Draws a label for each loop. The exterior loop is 1. Base Labels: Select the frequency of labeled bases. Rotate Structure: Selected an angle to rotate the structure. Negative angles correspond to a clockwise rotation. Clockwise/Counter Clockwise: Any redrawing of the structure, or any domain will be drawn as selected. It is possible to draw some portions of the structure clockwise, and others counter clockwise. If a structure is drawn clockwise, but a particular domain is drawn counter- clockwise, it will be drawn inside the loop and may look strange. This can be done intentionally and is sometimes useful. If a .ss file is read in, this may need to be set properly before editing works as desired. Annotation On/Off: Select annotation type. For selecting the name, .ann or .ss-count is appended to the input file name. .ann is used for p-num and probability annotation. This option does not work in outline mode. The -af option can be used to specify the file. Annotation Options: Bases, Dot, Both Scale to fit window: Some editing expands or shifts the structure. This option scales and shifts the structure to center it in the main window. It also adjusts the zoom on the Edit window to show the full image. The option is called automatically when some options are performed such as creating jpg, png, or postscript output for the Main window. Draw with Natural angles: Redraws the entire structure with natural angles. Draw with circle graph angles: Redraws the entire structure with circle graph angles. Draw with Z value circle graph angles: Redraws the entire structure with circle graph angles; The Z value indicates how to space the bases around the circle graph. For Z = .01, bases outside a multiloop are spaced at .01 of the space between baseswithin a multiloop. This is an attempt to space bases better in multiloops. Look at some circle graphs with various Z values. Use degrees of circle for above two: Using more degrees usually spaces out the graph more. Using fewer draws the structure more like a line. Set Regularize Angle: This sets the angle for the option below and for Mouse Function: Loop Regularize. Domains drawn with circle graph angles will use this value. The current value appears as Reg = value in the information window. Regularize all angles: For a given loop, each helix is drawn at an angle relative to the loop. This option rounds off each angle based on the value from Set Regularize Angle. Problems may occur when two helices happen to be drawn at the same angle. The angle is measured relative to the helix that closes the domain. This regularizing is done for all loops within the structure. The fix loops option does not apply to this option. Fix Loops On/Off: When on, any domain drawn with circle graph angles will have loops adjusted. Each loop is adjusted so that bases are not drawn on top of each other. When on, Fix appears in the information window. Draw included domain with: This redraws the structure based on the domain indicated in the information window. Natural_angles: Draws the loop with Natural angles; Circle graph Angles: Draws the domain as it would be if the entire structure were drawn with circle graph angles. For other angles, More degrees draws the domain with more separation between helices. Fewer degrees results in generally less overlap. Draw excluded domain with: Peforms the same as included domain, except it works on the complementary portion of the structure. Create Postscript: Creates a postscript image of the structure. From the Main window, this draws the entire structure, From the edit window, it draws the shown portion. Create jpg, png: Creates a jpg/png image of structure. From the Main window, this draws the entire structure, From the Edit window, it draws the shown portion. The creation of jpg and png images of structures requires: 1. libgd and the include files: gd.h, gdfontg.h, gdfontl.h, gdfontmb.h, gdfonts.h, gdfontt.h Having these will permit the creation of gif images. 2. In addition: i. If libjpeg is found, then jpg output can be created. ii. If libpng or libpng12 are found, then png output can be created. Create ss output: Creates an ss file. This file can be used as input by sir_graph or XRNA. The positions of bases are preserved, but not colors or fonts. Most XRNA features are not supported. Run sir_graph on Included Domain, Whole: For the domain listed in the information window, start a new version of sir_graph that draws this domain using the entire circle for this domain to determine angles. Many options previously set should be preserved in the new structure. Most editing will not be preserved. To preserve the editing, save the file as an ss file, and run sir_graph on the domain. Run sir_graph on Included Domain, Partial: Same as above except use the fraction of the circle corresponding to the domain. This option matches the current execution of sir_graph, but the Whole option should spread the structure out more. Run sir_graph on Excluded Domain, Whole: (Similar to above) Draws the external domain using the whole circle to determine angles. Exit: Exits. ############################################################################## ############################################################################## _____________________________ | V. Command Line switches: | |____________________________| Use: sir_graph 'name'.ct Where 'name'.ct is a ct file, to create a structure based on circle graph angles. The .ct suffix is optional. (Entering a name ending in .ss indicates to treat the file as an XRNA ss file. -a Output list of angles of tangents and perpendiculars (in degrees) -ab Annotates only bases for -pnum, -prob, -ss-count -ad Annotates dots for -pnum, -prob, -ss-count -aj Title bar of windows shows name, energy from ct file. Default is energy, name. -af file Specify file for annotation default is 'name'.ann for -pnum 'name'.ss-count for -ss-count 'name'.ann or 'name_k'.ann for -prob -ar Rotate structure to avoid landscape mode -c For circular rna, default is linear The exterior loop is drawn slightly differently. -cc Draw counter-clockwise, defaults is clockwise -cg Draw a circle graph. No structure is produced. -col file_name Read user supplied colors from file_name -col_ann file_name2 Read user supplied colors from file_name2 -d diam Diameter of circle in inches, max is 6 inch -e base i base j Draw circle graph or structure for this excluded domain. 1<=base_ibase_1) and (B= 500; Label every 25th base for 100 <= size < 500; Label every 10th base for 20 <= size < 100; Label every 5th base for size < 20; ________________________________________________________ | Automatic Fix of Loops drawn with circle graph angles| |______________________________________________________| The options: -fix, Mouse Function: Loop Fix, and Fix Loops On/Off all attempt to spread out bases around loops drawn with circle graph angles. Note that -fix can be used with -reg, but only one of the Mouse Function: Loop Fix and Loop Regularize is enabled at one time. However, A loop can first be regularized, and then fixed. Domains can be drawn with fix and a regularize angle set. Basic algorithm: (clockwise) First the loop is drawn with circle graph angles. Then from the incoming helix, the loop is traversed clockwise with each helix pushed away from the previous helix if necessary. The helix is pushed to make room for no single stranded bases, 1 single stranded base, 2 single stranded bases, or 3 single stranded bases. If there is not room for 3 bases, but there are more than 3 of them, they are drawn in a somewhat rectangle fashion between the helices. For an odd number of bases, the odd one is placed at the end of the extending rectangle of bases. s s s s- s s s s s G*C-s s-A*U or G*C-s s-G*U If there is room for 3 bases and no helices are moved, but there is not room for all of the single stranded bases, these bases are pushed outward from the loop to make a curved or pointy extension from the loop depending on the number of bases and their initial positons. One big problem develops as the loop is traversed clockwise: The last base pair on the loop may get pushed way from its initial position and is no longer reasonable relative to the incoming helix. It is repositioned correctly relative to the incoming helix. All helices and interspaced single stranded bases within 90 degrees counter clockwise from the incoming helix are shifted to match it, but their previous positions relative to each other are preserved. This creates a new problem. Bases just beyond the last helix within 90 degrees counter clockwise of the incoming helix are not correct relative to it. They are moved outward so they do not overlap it. All base pairs and interspaced single stranded bases from 90 to 270 degrees from the incoming helix are moved outward from the incoming helix by the same amount. At this point the incoming helix and all helices within 90 degrees of it are correct relative to each other. All helices from 90 to 270 degrees are correct relative to each other. The region 90 degrees counter clockwise from the incoming helix may be ragged, but it should not overlap. It will be viewable, but on ugly on rare occasions. ___________________ |III. Source Files| |_________________| sir_graph.c Main souce code, specific to drawing structures within the windows. sir_graph.doc This file. sir_graph_alloc.c Allocates memory for arrays. sir_graph_ann.h Functions for color annotation for p-num, ss-count. sir_graph_color.h Sets main colors for structures and circle graphs. sir_graph_color_ann.h Constants for sir_graph_ann.h sir_graph_ct.c Reads ct file sir_graph_img.c Creates jpg,png files sir_graph_ps.c Creates ps files sir_graph_ss.c Reads or creates ss files sir_graph_core.c Core features of sir_graph.(Added Sep 15, 2000) For customizing colors: sir_graph.col Example color file with default colors for -col switch. sir_graph.1.col Example color file for black background for -col switch annotation.col Example annotation colors with default colors for -col_ann switch Sample input files: file.ct test-gcg_1.ct test_1.ct test_1.ss Sample annotation files: test.ann Provides p-num annotation for use with test_1.ct test.ss-count Provides ss-count annotation for use with test_1.ct file.ann Provides p-num annotation for use with file.ct sample.ann Alternate p-num vales for test_1.ct Supplementary input files: file.ann Annotation for file.ct test.ann Pnum annotation for test_1.ct test.ss-count Ss-count annotation for test_1.ct test_1.force Used with -force and test_1.ct Other: test.plot Data used to produce test.ann test.seq Data used as input to mfold server to generate test data. color_table.ps Listing of current annotation scheme. Matches annotation.col and sir_graph_color_ann.h Historical_numbering: The rightmost column of a ct file provides a historical numbering of the bases. The leftmost column begins with 1 and proceeds to the length of the sequence. For most features, the historical numbering is used. _____________________________ | Known Bugs | |___________________________| 1. -z with -i, -iw, has a few problems. -z with -e, -ew is not allowed. 2. -e or -ew with some options ? 3. Possible problem with historical numbering for some features. None noticed yet. 4. Output of ss file with historical numbering?