Gbrowse Notes

Issue using part_color and group_on

Steps to reproduce:
1. Start with file volvox4.gff3 from Gbrowse tutorial
2. Add the following lines:

# testing
   ctgA    example microarray_oligo        3301    3902    4.56    .       .       Name=expt1;Note=N
   ctgA    example microarray_oligo        3301    3902    1.33    .       .       Name=expt1;Note=T

3. Load into MySQL:
bp_seqfeature_load.pl -u USER -p PASS -c -f -d 'dbi:mysql:volvox' volvox4.gff3

4. Edit volvox.conf:
[Scores]
feature      = microarray_oligo
glyph        = xyplot
graph_type   = boxes
height       = 50
description  = 1
scale        = both
part_color   = sub {
             my $f = shift;
             if($f->has_tag('Note')) {
             my @notes = $f->each_tag_value('Note');
             return 'crimson' if($notes[0] eq 'T');
             return 'green'   if($notes[0] eq 'N');
             }
             }
key          = Scores
group_on     = display_name
min_score    = 0
category     = Expression

Result - as expected:
volvox1.png

5. Next - switch order of last 2 lines in volvox4.gff3:

# testing
   ctgA    example microarray_oligo        3301    3902    1.33    .       .       Name=expt1;Note=T
   ctgA    example microarray_oligo        3301    3902    4.56    .       .       Name=expt1;Note=N

6. Load new file into MySQL and view again

Result - only the 'N' value (green) is rendered:

volvox12.png

Similar observation if a second location is added
This works:

# testing
ctgA    example microarray_oligo        3301    3902    4.56    .       .       Name=expt1;Note=N
ctgA    example microarray_oligo        3301    3902    1.33    .       .       Name=expt1;Note=T
ctgA    example microarray_oligo        5000    5500    3.98    .       .       Name=expt1;Note=T
ctgA    example microarray_oligo        5000    5500    1.01    .       .       Name=expt1;Note=N
volvox11.png

This does not:

# testing
ctgA    example microarray_oligo        3301    3902    4.56    .       .       Name=expt1;Note=N
ctgA    example microarray_oligo        3301    3902    1.33    .       .       Name=expt1;Note=T
ctgA    example microarray_oligo        5000    5500    1.01    .       .       Name=expt1;Note=N
ctgA    example microarray_oligo        5000    5500    3.98    .       .       Name=expt1;Note=T
volvox2.png

Summary

  • Correct rendering using part_color seems to depend on order of features
  • Requires that features be ordered by descending score
  • Can the callback be written such that rendering is always correct?
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License