Let’s say I have three sets of genome annotations for the same genomic region. Running AnnotationSketch with the defaults will give the following result.
$ gt sketch maize_default.png zm.chr5.0.yrgate.gff3 zm.chr5.1.cpgat.gff3 zm.chr5.2.msdo.gff3
Looking at the graphic sure beats trying to compare 3 GFF3 files, but unfortunately the graphic is still pretty busy. It took me a few days to figure out how to clean it up, but the AnnotationSketch tool is very customizable. Here are the adjustments I made.
- I made the graphic a bit wider using the command-line option
- Since there are annotations from three different sources, I thought it would be nice to have a specific color scheme for each source. I copied the default style file from
$GT_INSTALL_DIR/gtdata/sketch/default.styleand edited it. The style files allow you to apply styles conditionally using callback functions. You can see in the style file where I’ve used the callback functions to apply colors conditionally based on the file from which the feature came. Additionally, I collapsed all features related to protein-coding transcripts into the mRNA tracks and disabled the display of unrelated feature types by setting the respective
max_show_widthproperties to 0. This drastically reduced the visual clutter. When I run AnnotationSketch again, I must remember to specify this style file with the
- Finally, I used the
-flattenfilesto collapse all 3 mRNA tracks into a single track. By default, AnnotationSketch will create a separate track for each feature type from each different file, but since I’ve applied a custom color scheme, the separate tracks are unnecessary.
With all these adjustments, I can rerun AnnotationSketch with the following command, producing a much more pleasing graphic.
$ gt sketch -flattenfiles -width 1200 -style gt.three.style maize_improved.png zm.chr5.0.yrgate.gff3 zm.chr5.1.cpgat.gff3 zm.chr5.2.msdo.gff3
The style files are quite easy to work with once you’ve done it once. GenomeTools provides some pretty in-depth documentation, including developer tools for C, Lua, Python, and Ruby if extensive customization is required.