[GENERAL]
description   = Galdieria sulphuraria
db_adaptor    = Bio::DB::GFF
db_args       = -adaptor memory
                -dir '/srv/www/htdocs/gbrowse/databases/galdieria'

aggregators =   processed_transcript
                coding
		match
                "gene{initial,single,internal,terminal,5'-UTR,3'-UTR,intron/mRNA}"
plugins     = Aligner

# list of tracks to turn on by default
default features = AUGUSTUS.PE
		   AUGUSTUS
                   EST
		   Hints
                   DNA
                   match
		   Translation

# The class of the objects used to establish the reference coordinates.
reference class  = Contig

# examples to show in the introduction
examples = Contig39801 Contig09301:1-200000 Contig39001 Contig29301 Contig38401

# "automatic" classes to try when an unqualified identifier is given
automatic classes =

### HTML TO INSERT AT VARIOUS STRATEGIC LOCATIONS ###
# inside the <head></head> section
head = 

# at the top...
header =

# a footer
footer = <hr><pre>Marios galdieria.conf$</pre>

# Various places where you can insert your own HTML -- see configuration docs
html1 = 
html2 = 
html3 = 
html4 = 
html5 = 
html6 = 

# what image widths to offer
image widths  = 1024 1500 1800

# default width of detailed view (pixels)
default width = 1800

# Web site configuration info
stylesheet  = /gbrowse/gbrowse.css
buttons     = /gbrowse/images/buttons
tmpimages   = /gbrowse/tmp

# max and default segment sizes for detailed view
max segment     = 200000
default segment = 5000

# size of the "region panel"
region segment = 20000

# zoom levels
zoom levels    = 100 200 300 500 1000 2000 5000 10000 20000 50000 100000 200000

# colors of the overview, detailed map and key
overview bgcolor = lightgrey
detailed bgcolor = lightgoldenrodyellow
key bgcolor      = beige

# chooses a color depending on the type of feature (CDS, intron, UTR, mRNA)
# then chooses the intensity depending on the posterior probability (from the
# score column)
init_code = sub prob_color {
	      my $feature = shift;
              my $hexintensity = '00';
	      my $sc = $feature->score;
	      $sc = 1 if ($sc > 1);
	      if ($feature->primary_tag =~ /UTR/){
	         $hexintensity = sprintf "%02X", int(255 * (1-(0.5+$sc)/2));
              } else {
	         $hexintensity = sprintf "%02X", int(255 * (1-(0.1+$sc)/1.11));
              }
	      return '#'. $hexintensity. $hexintensity. $hexintensity if $feature->primary_tag =~ /UTR/;
              return '#FFFF' . $hexintensity if $feature->primary_tag eq 'intron';
	      return '#800000' if $feature->primary_tag eq 'mRNA';
	      return '#FF'.$hexintensity . $hexintensity;
            }
	    sub no_prob_color {
	      my $feature = shift;
	      return '#404040' if $feature->primary_tag =~ /UTR/;
              return '#FFFF00' if $feature->primary_tag eq 'intron';
	      return '#800000' if $feature->primary_tag eq 'mRNA';
	      return '#FF0000';
            }


########################
# Plugin configuration
########################

[Aligner:plugin]
alignable_tracks   = EST
upcase_tracks      = CDS Motifs
upcase_default     = CDS

########################
# Default glyph settings
########################

[TRACK DEFAULTS]
glyph         = generic
height        = 10
bgcolor       = lightgrey
fgcolor       = black
font2color    = blue
label density = 25
bump density  = 100
# where to link to when user clicks in detailed view
link          = AUTO

################## TRACK CONFIGURATION ####################
# the remainder of the sections configure individual tracks
###########################################################


[DNA]
glyph          = dna
global feature = 1
height         = 40
do_gc          = 1
fgcolor        = red
axis_color     = blue
strand         = both
category       = Examples
key            = DNA/GC Content

[Translation]
glyph          = translation
global feature = 1
height         = 40
fgcolor        = purple
start_codons   = 0
stop_codons    = 1
category       = Proteins
translation    = 6frame
key            = 6-frame translation
 
[AUGUSTUS.PE]
feature      = gene:AUGUSTUS.PE mRNA:AUGUSTUS.PE
glyph        = segments
max_score    = 1	
min_score    = 0
stranded     = sub { 
	          my $feature = shift;	
	         return 1 if $feature->primary_tag eq 'mRNA';
		 return 0;
	      }
# set the filling color depending on the probability of the feature
bgcolor      = \&prob_color
fgcolor      = sub {
	          my $feature = shift;
		  return 'black' if $feature->primary_tag eq 'intron';
		  return 'black';
                }
height       = sub {
	          my $feature = shift;
		  return 10 if $feature->primary_tag =~ /UTR/;
		  return 10 if $feature->primary_tag eq 'intron';
		  return 10;
               }
key          = AUGUSTUS using proteins and ESTs
citation     = Genes predicted by AUGUSTUS (http://augustus.gobics.de). The predictions are based on hints 
               coming from BLAT alignments of Galdieria sulphuraria ESTs and from BLAST protein alignments 
               with proteins of the algae C.merolae. See also track description of 'AUGUSTUS ab initio'.
[CDS]
feature      = coding
glyph        = cds
key          = Frame usage

[AUGUSTUS]
feature      = gene:AUGUSTUS mRNA:AUGUSTUS
glyph        = segments
max_score    = 1	
min_score    = 0
stranded     = sub { 
	          my $feature = shift;	
	         return 1 if $feature->primary_tag eq 'mRNA';
		 return 0;
	      }
bgcolor      = \&prob_color
fgcolor      = sub {
	          my $feature = shift;
		  return 'black' if $feature->primary_tag eq 'intron';
		  return 'black';
                }
height       = sub {
	          my $feature = shift;
		  return 10 if $feature->primary_tag =~ /UTR/;
		  return 10 if $feature->primary_tag eq 'intron';
		  return 10;
               }
key          = AUGUSTUS ab initio
citation     = Genes predicted with the ab initio version of AUGUSTUS (http://augustus.gobics.de). The predictions are solely based on the Galdieria contig.
               AUGUSTUS has been trained on all genes that have been predicted by a previous version of AUGUSTUS. This previous version has been trained on 
               genes that have been reconstructed using Galdieria ESTs. The color intensity of reflects the posterior probability of exons and introns.
[CDS]
feature      = coding
glyph        = cds
key          = Frame usage

[EST]
feature      = match:est match:prot
glyph        = segments
height       = 6
draw_target   = 1
show_mismatch = 1
canonical_strand = 1
bgcolor      =  sub {
                   my $feature = shift;
                   return "lightgreen" if $feature->source eq 'prot';
		   return "darkgreen";
		   return "black";
               }
key          = EST alignments
citation     = Galdieria sulphuraria ESTs aligned with BLAT

[Hints]
feature      = exonparthint intronparthint intronhint exonhint starthint
               stophint asshint dsshint
glyph        = sub {
	          my $feature = shift;
		  return "diamond" if $feature->primary_tag =~ /(starthint|stophint|asshint|dsshint)/;
		  return "generic";
                }		  
stranded     = 1
bgcolor      = sub {
                   my $feature = shift;
                   return "darkblue" if $feature->primary_tag eq 'exonhint';
		   return "lightblue" if $feature->primary_tag eq 'exonparthint';
                   return "yellow" if $feature->primary_tag eq 'intronhint';
		   return "lightyellow" if $feature->primary_tag eq 'intronparthint';
		   return "black";
               }
height       = sub {
	         my $feature = shift;
		 return "8" if $feature->source eq 'AGRIPPA';
		 return "15";
	     }
key          = Hints from ESTs and proteins
citation     = These hints were given to AUGUSTUS for the track 'AUGUSTUS using proteins and ESTs'. The wider bars are from ESTs,
               the thinner bars are from proteins. The diamonds are hints about a splice site or the translation start or translation stop, 
               depending on the context. Exon hints are dark blue, exonpart hints are light blue, intron hints are yellow.