CGView - Circular Genome Viewer
CGView Application
CGView Application
The CGView application (cgview.jar) is available from https://github.com/paulstothard/cgview. To generate a map using the application, create or obtain an input file for CGView. Two formats can be used: the CGView XML format or the simpler tab-delimited format. An included script called cgview_xml_builder.pl can be used to generate the XML input needed for the CGView application, from genome sequence files in a variety of formats. See the CGView GitHub repository for more details on cgview_xml_builder.pl.

The --help and --version options can be used to view help and version information, respectively.

Main CGView command line options
Option Required? Value What does it do? Example
-c No Base to center zoomed map on When drawing a zoomed map this option is used to position the map canvas over the sequence. For example, a value of 100 centers the canvas on base 100 in the sequence. The default value for the -c option is 1. java -jar cgview.jar -i input.xml -o output.png -f png -z 100 -c 100
-f No Output image format: png, jpg, svg, or svgz Specifies the format of the output image. Default value is png. java -jar cgview.jar -i input.xml -o output.jpg -f jpg
-h No HTML file to create Specifies that an HTML file should be created to accompany the image file. The HTML file is needed for PNG and JPG maps that contain hyperlinks or mouseovers, as these are provided using image maps. java -jar cgview.jar -i input.xml -o output.png -f png -h output.html
-i Yes Input file to parse Specifies which file should serve as the input to CGView. The file extension should match the input type (.xml for CGView XML files, or .tab for the tab-delimited format. java -jar cgview.jar -i features.tab -o output.png
-o Yes (unless -s option is used) Output image file to create Specifies the output image file to create. The format of the image is determined by the -f option, NOT by the extension of the output file. java -jar cgview.jar -i features.tab -o output.png
-s No Directory to contain series of linked images Specifies that a series of linked images should be created and written to the supplied directory. The values for -c, -f, -h, -o, -p, -u, and -z are ignored. java -jar cgview.jar -i features.xml -s image_series
-z No Zoom amount Determines the zoom level of the map. Default value is 1. java -jar cgview.jar -i features.xml -o output.png -f png -z 10000
Advanced CGView command line options
Option Required? Value What does it do? Example
-A No Label font size Specifies the label font size to use. This value overrides CGView's default label font size and label font size values specified in XML input. java -jar cgview.jar -i input.xml -f png -o output.png -A 12
-d No Tick mark density Adjusts the density of tick marks. A real number between 0 and 1 can be supplied, with 1 being the default value. Smaller values produce fewer tick marks. This value overrides CGView's default tick mark density and the tick mark density value specified in XML input. java -jar cgview.jar -i input.xml -f png -o output.png -d 0.5
-D No Legend font size Specifies the legend font size to use. This value overrides CGView's default legend font size and legend font size values specified in XML input. java -jar cgview.jar -i input.xml -f png -o output.png -D 40
-e No T or F When drawing an image series, this option allows you to exclude the SVG output. By default this value is set to F, which specifies that the image series should consist of a combination of SVG and PNG output. java -jar cgview.jar -i input.xml -s my_series -e T
-H No Map height Specifies the height of the map. This value overrides the height value in the input file. java -jar cgview.jar -i input.xml -f png -o output.png -H 1000
-I No T or F Specifies whether or not labels should be drawn on the inside of the backbone circle. Default is to draw inner labels when a zoomed map is drawn. This value overrides the value specified in the input file. java -jar cgview.jar -i input.xml -f png -o output.png -I T
-L No External legend width in pixels When generating a series of linked images, you may want the legend to be separate from the map images, particularly if the legend contains many items. An external legend also allows you to customize the legend using logos or graphics. To generate a series of linked images with a separate legend image shown adjacent to the map, use the -L option to specify the width of the separate legend image. Once the linked map series has been generated, place a file called legend.png in the includes directory that is generated inside the output directory. When the map is rendered, the legend.png image is placed to the right of the map. This option can also be used when a single HTML file is generated using the -h option. In this case the HTML will expect a file called legend.png in the same directory as the HTML file. java -jar cgview.jar -i input.xml -s my_series -e T -L 300
-p No Path to map image in HTML Specifies the path to appear in the image tag when a single HTML file is generated using the -h option. By default the path is set to the value of the -o option. java -jar cgview.jar -i input.xml -o output.png -f png -h output.html -p /maps/images/output.png
-r No T or F Specifies whether or not legends should be hidden. Default value is F. java -jar cgview.jar -i input.xml -o output.png -f png -r T
-R No T or F Specifies whether or not labels should be hidden. Default value is F. java -jar cgview.jar -i input.xml -o output.png -f png -R T
-u No T or F Specifies whether or not to include calls to the overlib.js JavaScript library when generating an image series using the -s option. The overlib.js library provides mouseover labels for png and jpg image maps. This option can also be used when a single HTML file is generated using the -h option. In this case the HTML will expect a file called overlib.js in an includes directory (overlib.js is available in the CGView includes directory). Default value is T. java -jar cgview.jar -i input.xml -s image_series -u F
-U No Ruler font size Specifies the ruler font size to use. This value overrides CGView's default ruler font size and ruler font size values specified in XML input. java -jar cgview.jar -i input.xml -f png -o output.png -U 8
-W No Map width Specifies the width of the map. This value overrides the width value in the input file. java -jar cgview.jar -i input.xml -f png -o output.png -W 1000
-x No Image series zoom values Specifies the zoom values to be used when generating a series of linked maps using the -s option. The zoom values are supplied as a comma separated list, starting with the number 1. The default value is 1,6,36. java -jar cgview.jar -i input.xml -f png -s linked_series -x 1,6,36,216

Tips:

  • If you obtain an Out of Memory error when drawing a very large map, try increasing the memory available to Java using the -Xmx option. For example, use the command java -jar -Xmx500m cgview.jar -i input.xml -o output.png -f png
  • When creating an XML file to generate a series of linked maps, specify globalLabel="auto" in the cgview element for best results.
Running CGView from a Java program:

See the CGView API.

Citing CGView: