# 07.dmel41my.conf
# gbrowse config file for gff mysql-indexed gene features
# d.gilbert, may05


[GENERAL]
description = D. melanogaster (dmelr41; MySQL)
header =  <h2><i>D. melanogaster</i> Genome,
  <small>Annotation Release 4.1; Feb 2005 
  using MySQL-GFF data adaptor
  </small> </h2>


adaptor     = dbi::mysqlopt
#database    = dbi:mysql:database=dmel_r41_20050207;host=localhost
database    = dbi:mysql:database=dmel_r41_20050207;host=localhost;port=3306;mysql_socket=/tmp/fbmysql.sock
#?? or do we need this dbi opt: mysql_read_default_file=/usr/local/mysql/data/my.cnf
user        = flybase
#passwd      =
# fasta_files = 
aggregators = transcript05  alignment

## need this for flybase Chado segment lookup in Browser.pm _feature_get ...
# reference class = chromosome_arm
## ^^ bad for mysql-gff gbrowse

default name = 4:100000-200000

# examples to show in the introduction
examples = 
    X  2L  2R 3L 3R 4
    chromosome_arm:4
    2L:80,000..120,000
    4:200000..500000
    plex*  Ank
    Gadfly:CG11186  FlyBase:FBan0011186


# plugins = SequenceDumper FastaDumper RestrictionAnnotator
plugins = BatchDumper TextMapDumper FeatureFastaDumper FastaDumper GFFDumper 

cache_overview = 360
cachedir = 360

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

# Default glyph settings
glyph       = generic
height      = 8
bgcolor     = cyan
fgcolor     = cyan
label density = 25
bump density  = 100

# where to link to when user clicks in detaild view
# NOTlink           =AUTO
# generic FB link - should work if FB id is in data
link = sub {
  my $f= shift;  
  my $d= join(',',$f->each_tag_value('ID'),$f->id(),$f->each_tag_value('Dbxref'));
  my $tp= $f->class;
  my $best='(FB\w\w\d+)';
  if($tp =~ /gene/i) { $best='(FBgn\d+)'; } # FBgn or FBan?
  elsif($tp =~ /MRNA|CDS/i) { $best='(C[GR]\d+)'; }
  elsif($tp =~ /intron|UTR/i) { $best='(C[GR]\d+)'; }
  elsif($tp =~ /transposable_element/i) { $best='(FBti\d+)'; }
  elsif($tp =~ /cyto/i) { $best='(FB(ab|ba)\d+)'; }
  if ($d =~ /$best/){ return '/flybase/cgi-bin/fbidq.html?'.$1; }
  elsif ($d =~ /(FB\w\w\d+)/){ return '/flybase/cgi-bin/fbidq.html?'.$1; }
  elsif ($d =~ /((C[GR]|TE)\d+)/ ){ return '/flybase/cgi-bin/fbidq.html?'.$1; }
  if ($f->name()) { return '/flybase/cgi-bin/fbsymq.html?'.$f->name(); } 
  }

## NOTE: this is used by TextMapDumper plugin
#  my $link  = $browser->config->code_setting($label,'dbx_link');
#  $link     = $browser->config->code_setting(general=>'dbx_link') unless defined $link;
dbx_link = sub {
  my $dbx= shift; my $f= shift; #?
  my $r='';
  foreach my $x (split(/[,;]\s*/,$dbx)) {
    my($h,$v);
    my($db,$ac)= split/:/,$x,2;
    if ($x =~ /(FB\w\w\d+)/) { $v=$1; $h= '/flybase/cgi-bin/fbidq.html?'.$v; }
    elsif ($db =~ /FlyBase/i) { $v=$ac; $h= '/flybase/cgi-bin/fbsymq.html?'.$ac;  } 
    elsif ($db =~ /Gadfly/i) { $x=$ac; } # drop Gadfly
    elsif ($db eq 'GB_protein') { 
      $v= $ac;
      $h= 'http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Search&db=Protein&doptcmdl=GenBank&tool=FlyBase&term='.$ac;
      }
    elsif ($db eq 'GB') { 
      $v= $ac;
      $h= 'http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Search&db=Nucleotide&doptcmdl=GenBank&tool=FlyBase&term='.$ac;
      }
    elsif ($db eq 'GO') { 
      $v= $ac;
      $h= '/flybase/cgi-bin/goreport?id='.$ac;
      }
    if ($h && $v) { $r.= '<a href="'.$h.'">'.$v.'</a>, '; }
    else { $r.= $x.', '; }
    }
  return $r;
  }

# title = sub { my $f=shift; return ($f->name())? $f->name(): "" ; }
# make_title in Browser should be doing this, but get only "Gene" == class?
## the perl syntax ->method||'' was causing failure !
title = sub { my $f= shift;
	# return $f->class .":". $f->info . " ". $f->seq_id .':'.$f->start."..".$f->end;
	return $f->method .":". $f->info . " ". $f->seq_id .':'.$f->start."..".$f->end;
	}

## suggested display name change ? is this active
## this works .. tracing code is convoluted; see Bio/Graphics/Glyph/Factory:options()
## but cant do at general level here; needs to be in each feature def ??
label = sub { my $f = shift;
    my @n = ($f->attributes('Name'), $f->attributes('Alias'));
    #my @n= ( $f->attributes('Name'), $f->each_tag_value('Name'),$f->each_tag_value('Alias'));
    return $n[0] || $f->display_name;
    }

# what image widths to offer
image widths  = 450 640 800 1024

# default width of detailed view (pixels)
default width = 800
default features =  gene scaffold

# max and default segment sizes for detailed view
max segment = 1000001
default segment = 100000

# low-res boundary
low res = 200000

# zoom levels
zoom levels    = 100 200 1000 2000 5000 10000 20000 40000 100000 200000 500000 1000000

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

           

# "automatic" classes to try when an unqualified identifier is given
#automatic classes = gene
#automatic classes = Symbol Gene Clone
automatic classes = Gene Symbol 

language = en

# a footer
footer = <hr>
	<table width="100%">
	<TR>
	<TD align="LEFT" class="databody">
	For the source code for this browser, see the <a href="http://www.gmod.org">
	Generic Model Organism Database Project.</a>  For other questions, send
	mail to <a href="mailto:lstein@cshl.org">lstein@cshl.org</a>.
	</TD>
	</TR>
	</table>
	<hr>
	<pre>$Id: 07.dmel_mysql.conf,v1.0 2005/05/29 01:56:37 gilbertd Exp $</pre>


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


bac_insitu_pic = /images/lk/bac_insitu_pic
max bac pic = 3

# dgg;add flybase bacpix via html4 == sub bac_insitu_image
html4 = sub {
  my $segment  = shift;  
  my $settings = shift;
  my $maxpic = 3;
  return if ($maxpic < 1);  
  my $page_width = $settings->{width};
  my $title= "Tiling BAC in situ Image";
  my $imgcell='';
  my $hidden= 0; ## cookie/setting
  if (!$hidden && $segment  ) {
    my @tiling_bacs= $segment->features('BAC');
    my $nbacs= @tiling_bacs;
    $nbacs= $maxpic if ($nbacs > $maxpic);  
    if ($nbacs > 0) {  
      my $imgs='';
      my $base_url= "/images/lk/bac_insitu_pic/";
      foreach my $col (0..$nbacs-1) {  
        my $bac_name = $tiling_bacs[$col]->name;  
        $bac_name =~ s/\-.*$//;
        #$bac_name =~ s/\-(hsp|hit)$//;
        my $url = $base_url . $bac_name . ".jpeg";
        my $img = "<img src='$url' height=188 border=0 center=1 />\n";
        $imgs .= "<td align=center> $img<br/>$bac_name </td>\n";  
        }
      $imgcell = "<table width=\"95%\" align=\"center\" border=0 ><tr>"
        .$imgs." </tr></table><br/>\n";  
      }
    }
  return "<hr>" . CGI::Toggle::toggle_section( {on=>1}, "<b>Tiling BAC Image</b>", $imgcell );
  }

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


[gene]
#feature       = gene mRNA
feature       = gene transcript  
glyph         = transcript2
bgcolor       = lightblue
fgcolor       = blue
secondary     = mRNA
secondary_bgcolor = mediumblue
secondary_fgcolor = mediumblue
highlight_color = red
higlighted = 1
#label = 1
## this works .. tracing code is convoluted; see Bio/Graphics/Glyph/Factory:options()
label = sub { my $f = shift;
    my @n = ($f->attributes('Name'), $f->attributes('Alias'));
    return $n[0] || $f->display_name;
    }
label density = 50
bump density  = 150
key           = Gene Model
category = '   Genomic features'
citation     = Gene and mRNA (transcript) features  (annotation DB ; Chado)
NOTNOW_link = sub {
  my $f= shift; my ($d);
  $d= join(',',$f->each_tag_value('ID'),$f->each_tag_value('Dbxref'),$f->primary_id());  
  if ($d =~ /(FBan\d+)/){ return '/flybase/cgi-bin/fbidq.html?'.$1; }
  elsif ($d =~ /(FB\w\w\d+)/){ return '/flybase/cgi-bin/fbidq.html?'.$1; }
  elsif ($d =~ /((C[GR]|TE)\d+)/ ){ return '/flybase/cgi-bin/fbidq.html?'.$1; }
  if ($f->name()) { return '/flybase/cgi-bin/fbsymq.html?'.$f->name(); } # or fbannq.html?name 
  }

[genespan]
feature       = gene 
#glyph         = transcript2
glyph = segments
stranded = 1
bgcolor       = lightblue
fgcolor       = blue
highlight_color = red
higlighted = 1
#label = 1
label = sub { my $f = shift;
    my @n = ($f->attributes('Name'), $f->attributes('Alias'));
    return $n[0] || $f->display_name;
    }
label density = 50
bump density  = 150
key           = Gene span
category = '  Gene Model subfeatures'
citation     = Gene span features  (annotation DB ; Chado)
NOTNOW_link = sub {
  my $f= shift; my ($d);
  $d= join(',',$f->each_tag_value('ID'),$f->each_tag_value('Dbxref'),$f->primary_id());  
  if ($d =~ /(FBan\d+)/){ return '/flybase/cgi-bin/fbidq.html?'.$1; }
  elsif ($d =~ /(FB\w\w\d+)/){ return '/flybase/cgi-bin/fbidq.html?'.$1; }
  elsif ($d =~ /((C[GR]|TE)\d+)/ ){ return '/flybase/cgi-bin/fbidq.html?'.$1; }
  if ($f->name()) { return '/flybase/cgi-bin/fbsymq.html?'.$f->name(); } # or fbannq.html?name 
  }


# an aggregator feature
[mRNA]
#feature  = transcript05
feature  = transcript
#glyph         = transcript2
glyph = segments
stranded = 1
translation  = 1frame
bgcolor = palegoldenrod
fgcolor = goldenrod
#label = 1
label = sub { my $f = shift;
    my @n = ($f->attributes('Name'), $f->attributes('Alias'));
    return $n[0] || $f->display_name;
    }
key  = mRNA
citation     = Transcript (mRNA; annotation DB ; Chado)
category = '  Gene Model subfeatures'
# link = "#"

# [mRNA]
# feature  = mRNA
# glyph = segments
# stranded     = 1
# translation  = 1frame
# bgcolor = palegoldenrod
# fgcolor = goldenrod
# label = 1
# key  = mRNA
# citation     = Protein coding sequence (CDS or translation; annotation DB ; Chado)
# # category = '  Gene Model subfeatures'
# # link = "#"

[CDS]
feature  = CDS
# glyph = translation
glyph = segments
stranded     = 1
translation  = 1frame
bgcolor = palegoldenrod
fgcolor = goldenrod
#label = 1
label = sub { my $f = shift;
    my @n = ($f->attributes('Name'), $f->attributes('Alias'));
    return $n[0] || $f->display_name;
    }
key  = CDS
citation     = Protein coding sequence (CDS or translation; annotation DB ; Chado)
category = '  Gene Model subfeatures'
# link = "#"

[intron]
feature  = intron
glyph = segments
stranded     = 1
#label = 1
label = sub { my $f = shift;
    my @n = ($f->attributes('Name'), $f->attributes('Alias'));
    return $n[0] || $f->display_name;
    }
key  = intron
citation     = intron  
category = '  Gene Model subfeatures'
link = "#"

[five_prime_UTR]
feature  = five_prime_UTR
glyph = segments
stranded     = 1
#label = 1
label = sub { my $f = shift;
    my @n = ($f->attributes('Name'), $f->attributes('Alias'));
    return $n[0] || $f->display_name;
    }
key  = 5prime UTR
citation     = five_prime_UTR  
category = '  Gene Model subfeatures'
link = "#"

[three_prime_UTR]
feature  = three_prime_UTR
glyph = segments
stranded     = 1
#label = 1
label = sub { my $f = shift;
    my @n = ($f->attributes('Name'), $f->attributes('Alias'));
    return $n[0] || $f->display_name;
    }
key  = 3prime UTR
citation     = three_prime_UTR  
category = '  Gene Model subfeatures'
link = "#"


#---------------------------------

[pseudogene]
feature  = pseudogene
glyph = segments
strand_arrow  = 1
#glyph         = anchored_arrow
fgcolor       = orange
#label = 1
label = sub { my $f = shift;
    my @n = ($f->attributes('Name'), $f->attributes('Alias'));
    return $n[0] || $f->display_name;
    }
key           = Pseudogene
category = '   Genomic features'


[tRNA]
feature      = tRNA
bgcolor      = white
fgcolor      = black
curatedexon  = slateblue
fontcolor    = slateblue
height       = 3
key          = tRNAs
category = '   Genomic features'

[noncodingRNA]
feature      = ncRNA snoRNA snRNA miscRNA
glyph        = generic
bgcolor      = peachpuff
height       = 4
stranded     = 1
key          = Various non coding RNAs
category = '   Genomic features'

[transposable]
feature  = transposable_element
# fgcolor       = violet
bgcolor       = magenta
fgcolor       = magenta
#label = 1
label = sub { my $f = shift;
    my @n = ($f->attributes('Name'), $f->attributes('Alias'));
    return $n[0] || $f->display_name;
    }
glyph         = anchored_arrow
key           = Natural transposon
citation     = Natural transposon (annotation DB ; Chado)
category = '   Genomic features'
NOTNOW_link = sub {
  my $f= shift; my($d);
  $d= join(',',$f->each_tag_value('ID'),$f->each_tag_value('Dbxref'),$f->primary_id());  
  #($d)= $f->each_tag_value('note');
  if ($d =~ /(FBti\d+)/||$d =~ /((FB\w\w|TE)\d+)/) { return '/flybase/cgi-bin/fbidq.html?'.$1; }
  #$d= $f->primary_id() if $f->can('primary_id');
  #$d= $f->source() unless($d);
  #if ($d =~ /((FB\w\w|TE)\d+)/){ return '/flybase/cgi-bin/fbidq.html?'.$1; }
  #elsif ($d =~ /^TE/ ){ return '/flybase/cgi-bin/fbannq.html?acc='.$d; }
  if ($f->name()) { return '/flybase/cgi-bin/fbinsq.html?symbol='.$f->name(); }
  }
# ids now hidden in note


[tinsert]
feature  = transposable_element_insertion_site
glyph         = pinsertion
bgcolor       = darkturquoise
fgcolor       = darkturquoise
bump          = 1
label         = 0
key           = Transgene insertion site
citation     = Transgene insertion site (annotation DB ; Chado)
category = '   Genomic features'
link = sub {
  my $f= shift; my($d);
  $d= join(',',$f->each_tag_value('ID'),$f->each_tag_value('Dbxref'),$f->primary_id());  
  #($d)= $f->each_tag_value('note');
  if ($d =~ /(FBti\d+)/||$d =~ /((FB\w\w|TE)\d+)/) { return '/flybase/cgi-bin/fbidq.html?'.$1; }
  #$d= $f->primary_id() if $f->can('primary_id');
  #$d= $f->source() unless($d);
  #if ($d =~ /((FB\w\w|TE)\d+)/){ return '/flybase/cgi-bin/fbidq.html?'.$1; }
  #elsif ($d =~ /^TE/ ){ return '/flybase/cgi-bin/fbannq.html?acc='.$d; }
  if ($f->name()) { return '/flybase/cgi-bin/fbinsq.html?symbol='.$f->name(); }
  }


#-------- Misc. Genomic features -------------------


[polyA_site]
feature  = polyA_site
#glyph = segments
strand_arrow  = 1
bgcolor       = lightslategray
fgcolor       = lightslategray
key           = polyA_site 
citation     = polyA_site (annotation DB ; Chado)
category = '  Misc. Genomic features'
link = sub {
  my $v=shift->name(); $v=~s/\-\d+.*$/\*/; $v=~s/\+/\?/g; return '/flybase/cgi-bin/fbannq.html?synonym='.$v;  
 }
# Gsc-polyA_site-585205..585205 2L


[point_mutation]
feature  = point_mutation
# glyph = segments
bgcolor       = lightslategray
fgcolor       = lightslategray
key           = point_mutation 
citation     = point_mutation (annotation DB ; Chado)
category = '  Misc. Genomic features'
link = sub {
  my $v=shift->name(); $v=~s/\-\d+.*$/\*/; $v=~s/\+/\?/g; return '/flybase/cgi-bin/fbannq.html?synonym='.$v;  
 }
 
 
[protein_binding_site]
feature  = protein_binding_site
# glyph = segments
strand_arrow  = 1
bgcolor       = lightslategray
fgcolor       = lightslategray
key           = protein_binding_site 
citation     = protein_binding_site (annotation DB ; Chado)
category = '  Misc. Genomic features'
link = sub {
  my $v=shift->name(); $v=~s/\-\d+.*$/\*/; $v=~s/\+/\?/g; return '/flybase/cgi-bin/fbannq.html?synonym='.$v;  
 }

[rescue_fragment]
feature  = rescue_fragment
# glyph = segments
strand_arrow  = 1
bgcolor       = lightslategray
fgcolor       = lightslategray
key           = rescue_fragment 
citation     = rescue_fragment (annotation DB ; Chado)
category = '  Misc. Genomic features'
link = sub {
  my $v=shift->name(); $v=~s/\-\d+.*$/\*/; $v=~s/\+/\?/g; return '/flybase/cgi-bin/fbannq.html?synonym='.$v;  
 }

[mature_peptide]
feature  = mature_peptide
glyph = segments
strand_arrow  = 1
bgcolor = palegoldenrod
fgcolor       = orange
#label = 1
key  = mature_peptide
citation     = mature_peptide (annotation DB ; Chado)
category = '  Misc. Genomic features'
link = sub {
  my $v=shift->name(); $v=~s/\-\d+.*$/\*/; $v=~s/\+/\?/g; return '/flybase/cgi-bin/fbannq.html?synonym='.$v;  
  }

[enhancer]
feature  = enhancer
# glyph = segments
strand_arrow  = 1
bgcolor       = lightslategray
fgcolor       = lightslategray
key           = enhancer 
citation     = enhancer (annotation DB ; Chado)
category = '  Misc. Genomic features'
link = sub {
  my $v=shift->name(); $v=~s/\-\d+.*$/\*/; $v=~s/\+/\?/g; return '/flybase/cgi-bin/fbannq.html?synonym='.$v;  
 }

[aberration_junction]
feature  = aberration_junction
# glyph = segments
strand_arrow  = 1
bgcolor       = lightslategray
fgcolor       = lightslategray
key           = aberration_junction 
citation     = aberration_junction (annotation DB ; Chado)
category = '  Misc. Genomic features'
link = sub {
  my $v=shift->name(); $v=~s/\-\d+.*$/\*/; $v=~s/\+/\?/g; return '/flybase/cgi-bin/fbannq.html?synonym='.$v;  
 }

# add: regulatory_region and sequence_variant
[regulatory_region]
feature  = regulatory_region
# glyph = segments
strand_arrow  = 1
bgcolor       = lightslategray
fgcolor       = lightslategray
key           = regulatory_region 
citation     = regulatory_region (annotation DB ; Chado)
category = '  Misc. Genomic features'
link = sub {
  my $v=shift->name(); $v=~s/\-\d+.*$/\*/; $v=~s/\+/\?/g; return '/flybase/cgi-bin/fbannq.html?synonym='.$v;  
 }

[sequence_variant]
feature  = sequence_variant
# glyph = segments
strand_arrow  = 1
bgcolor       = lightslategray
fgcolor       = lightslategray
key           = sequence_variant 
citation     = sequence_variant (annotation DB ; Chado)
category = '  Misc. Genomic features'
link = sub {
  my $v=shift->name(); $v=~s/\-\d+.*$/\*/; $v=~s/\+/\?/g; return '/flybase/cgi-bin/fbannq.html?synonym='.$v;  
 }


[DNA_motif]
feature  = DNA_motif RNA_motif
# glyph         = segments
bgcolor       = plum
fgcolor       = plum
secondary     = RNA_motif
secondary_bgcolor = mediumseagreen
secondary_fgcolor = mediumseagreen
strand_arrow  = 1
bump          = 1
label         = 0
key           = DNA / RNA motif
citation     = DNA_motif and RNA_motif (annotation DB ; Chado)
category = '  Misc. Genomic features'
link = "#"


[chromosome_band]
feature      = chromosome_band
glyph        = generic
bgcolor       = blue
fgcolor       = blue
height       = 4
key          = chromosome_band
##category = '  Misc. Genomic features'

#---------- Small Genome reagents --------------

[DGC]
feature = match:sim4:na_DGC_dros
glyph         = segments
strand_arrow  = 1
label = sub { my $f = shift;
    my @n = ($f->attributes('Name'), $f->attributes('Alias'));
    return $n[0] || $f->display_name;
    }
bgcolor       = plum
fgcolor       = black
key           = DGC EST/cDNA
citation      = DGC cDNA_clone (annotation DB ; Chado)
category = '  Genome reagents'
link = sub { 
  my $f= shift;
  my $v= $f->name();  my @v= $f->each_tag_value('Name');
  $v= shift @v if (@v>0);
  $v=~s/[:.].*(prime|contig).*$//;  $v=~s/^(GB)[:]//;  
  return 'http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Search&db=Nucleotide&doptcmdl=GenBank&tool=FlyBase&term='.$v;  
  }
# name = sub { 
#   my $f= shift;
#   my $v= $f->name();  my @v= $f->each_tag_value('Name');
#   $v= shift @v if (@v>0);
#   return $v;
#   }

[EST]
#OLD_feature       = EST cDNA_clone
feature       = match:sim4:na_dbEST.same.dmel match:sim4:na_dbEST.diff.dmel 
glyph         = segments
strand_arrow  = 1
bgcolor       = lightgreen
fgcolor       = green
key           = EST 
citation      = EST (annotation DB ; Chado)
category = '  Genome reagents'
link = sub { my $v=shift->name();  $v=~s/[:.].*(prime|contig).*$//;  $v=~s/^(GB)[:]//;  
  return 'http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Search&db=Nucleotide&doptcmdl=GenBank&tool=FlyBase&term='.$v;  
  }
#drop from link name: .5prime_revcomp .5prime, :contig1, SD02026:contig1, CK02552.5prime
# but for ones like GB:AV399447 drop db:
#link = http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Search&db=Nucleotide&doptcmdl=GenBank&tool=FlyBase&term=$info

[oligo]
feature  = oligo
#glyph         = triangle
glyph         = generic
bgcolor       = tomato
fgcolor       = tomato
height       = 4
bump          = 0
bump density  = 1
label         = 0
label density = 0
key           = Affy Oligo
citation     = oligonucleotide (annotation DB ; Chado)
category = '  Genome reagents'
link = sub { my $f= shift;
 return ($f->name())?'/flybase/cgi-bin/fbannq.html?oligo='.$f->name() : ''; }
 
#-------- Analysis -------------------

# from match:promoter ?
[transcription_start_site]
feature  = transcription_start_site 
glyph         = promoter
bgcolor       = purple
fgcolor       = purple
bump          = 1
label         = 0
label density = 0
key = Promoter prediction
citation     = Transcription promoter prediction (annotation DB ; Chado)
category = ' Analysis features'
link = "#"
#key           = Transcription start


[repeat_region]
feature   = repeat_region match:repeat_runner_seg match:repeatmasker
# glyph         = extending_arrow
bgcolor       = darkorchid
fgcolor       = darkorchid
height        = 3
connector     = solid
bump          = 1
strand_arrow  = 0
label         = 0
label density = 0
key           = Repeat region
citation     = repeat_region (annotation DB ; Chado)
category = ' Analysis features'
link = "#"

[mRNA_genscan]
feature   = mRNA_genscan match:genscan
glyph         = segments
strand_arrow  = 1
bgcolor       = tan
fgcolor       = brown
connector     = solid
bump          = 1
#label         = 0
#label density = 0
label = sub { my $f = shift;
    my @n = ($f->attributes('Name'), $f->attributes('Alias'));
    return $n[0] || $f->display_name;
    }
key           = Genscan prediction
citation     = Genscan (gene prediction) (annotation DB ; Chado)
category = ' Analysis features'
link = "#"


[mRNA_genie]
feature   = mRNA_piecegenie match:genie
glyph         = segments
strand_arrow  = 1
bgcolor       = yellow
fgcolor       = brown
connector     = solid
bump          = 1
label         = 0
label density = 0
key           = Genie prediction 
citation     = PieceGenie (gene prediction) (annotation DB ; Chado)
category = ' Analysis features'
link = "#"


[match_HDP]
feature = match:HDP
glyph         = segments
strand_arrow  = 1
bgcolor       = yellow
fgcolor       = brown
connector     = solid
bump          = 1
label         = 0
key           =HDP prediction 
citation     = HDP  (annotation DB ; Chado)
category = ' Analysis features'
link = "#"


[match_RNAiHDP]
feature = match:RNAiHDP
glyph         = segments
strand_arrow  = 1
bgcolor       = tan
fgcolor       = brown
connector     = solid
bump          = 1
label         = 0
key           = RNAiHDP prediction 
citation     = RNAiHDP  (annotation DB ; Chado)
category = ' Analysis features'
link = "#"



[tRNA_trnascan]
feature   = tRNA:trnascan
glyph = transcript2
bgcolor       = yellow
fgcolor       = brown
connector     = solid
bump          = 1
label         = 0
key           = tRNAscan prediction
citation     = tRNAscan (tRNA prediction) (annotation DB ; Chado)
category = ' Analysis features'
link = "#"


#-- BLAST features; combined some

[mb_aa_SPTR.dmel]
feature  = match:blastx:aa_SPTR.dmel
glyph    = segments
bgcolor  = lightslategray
fgcolor  = black
key      = D melanogaster protein
citation = match:blastx:aa_SPTR.dmel
category = ' Blast features'
link = sub { my $ac=shift->name(); $ac=~s/[:.].*$//;  
  if ($ac=~/^(L|N|M|P|Q|O|R|S|T|U|V|W)/) { return 'http://www.uniprot.org/entry/'.$ac; }
  elsif ($ac) { return 'http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Search&db=Protein&doptcmdl=GenPept&tool=FlyBase&term='.$ac; }
  }
  
[mx_nadpse]
feature  = match:tblastx:na_dpse
glyph    = segments
bgcolor  = lightslategray
fgcolor  = black
label    = 1
link = sub {my $v=shift->name(); $v=~s/\-\d+.*$//; return '?source=dpse_overview&id='.$v if($v); }
key      = D pseudoobscura contigs
citation = match:tblastx:na_dpse
category = ' Blast features'

[mb_na_agambiae]
feature  = match:tblastx:na_agambiae
glyph    = segments
bgcolor  = lightslategray
fgcolor  = black
key      = Mosquito NA 
citation = match:tblastx:na_agambiae
category = ' Blast features'
link = sub { my $v=shift->name();  $v=~s/^(GB)[:]//;  $v=~s/[:.].*$//; 
  return 'http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Search&db=Nucleotide&doptcmdl=GenBank&tool=FlyBase&term='.$v;  
  }

[mb_aa_SPTR.insect]
feature  = match:blastx:aa_SPTR.insect
glyph    = segments
bgcolor  = lightslategray
fgcolor  = black
key      = Insect protein
citation = match:blastx:aa_SPTR.insect
category = ' Blast features'
link = sub { my $ac=shift->name(); $ac=~s/[:.].*$//;  
  if ($ac=~/^(L|N|M|P|Q|O|R|S|T|U|V|W)/) { return 'http://www.uniprot.org/entry/'.$ac; }
  elsif ($ac) { return 'http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Search&db=Protein&doptcmdl=GenPept&tool=FlyBase&term='.$ac; }
  }

[mb_na_dbEST.insect]
feature  = match:tblastx:na_dbEST.insect
glyph    = segments
bgcolor  = lightslategray
fgcolor  = black
key      = Insect dbEST 
citation = match:tblastx:na_dbEST.insect
category = ' Blast features'
link = sub { my $v=shift->name();  $v=~s/[:.].*(prime|contig).*$//;  $v=~s/^(GB)[:]//;  
  return 'http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Search&db=Nucleotide&doptcmdl=GenBank&tool=FlyBase&term='.$v;  
  }

[mb_aa_SPTR.worm]
feature  = match:blastx:aa_SPTR.worm
glyph    = segments
bgcolor  = lightslategray
fgcolor  = black
key      = Worm protein 
citation = match:blastx:aa_SPTR.worm
category = ' Blast features'
link = sub { my $ac=shift->name(); $ac=~s/[:.].*$//;  
  if ($ac=~/^(L|N|M|P|Q|O|R|S|T|U|V|W)/) { return 'http://www.uniprot.org/entry/'.$ac; }
  elsif ($ac) { return 'http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Search&db=Protein&doptcmdl=GenPept&tool=FlyBase&term='.$ac; }
  }


[mb_aa_SPTR.yeast]
feature  = match:blastx:aa_SPTR.yeast
glyph    = segments
bgcolor  = lightslategray
fgcolor  = black
key      = Yeast protein 
citation = match:blastx:aa_SPTR.yeast
category = ' Blast features'
link = sub { my $ac=shift->name(); $ac=~s/[:.].*$//;  
  if ($ac=~/^(L|N|M|P|Q|O|R|S|T|U|V|W)/) { return 'http://www.uniprot.org/entry/'.$ac; }
  elsif ($ac) { return 'http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Search&db=Protein&doptcmdl=GenPept&tool=FlyBase&term='.$ac; }
  }


[mb_aa_SPTR.othinv]
feature  = match:blastx:aa_SPTR.othinv
glyph    = segments
bgcolor  = lightslategray
fgcolor  = black
key      = Other invert. protein
citation = match:blastx:aa_SPTR.othinv
category = ' Blast features'
link = sub { my $ac=shift->name(); $ac=~s/[:.].*$//;  
  if ($ac=~/^(L|N|M|P|Q|O|R|S|T|U|V|W)/) { return 'http://www.uniprot.org/entry/'.$ac; }
  elsif ($ac) { return 'http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Search&db=Protein&doptcmdl=GenPept&tool=FlyBase&term='.$ac; }
  }


[mb_aa_SPTR.primate]
feature  = match:blastx:aa_SPTR.primate
glyph    = segments
bgcolor  = lightslategray
fgcolor  = black
key      = Primate protein 
citation = match:blastx:aa_SPTR.primate
category = ' Blast features'
link = sub { my $ac=shift->name(); $ac=~s/[:.].*$//;  
  if ($ac=~/^(L|N|M|P|Q|O|R|S|T|U|V|W)/) { return 'http://www.uniprot.org/entry/'.$ac; }
  elsif ($ac) { return 'http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Search&db=Protein&doptcmdl=GenPept&tool=FlyBase&term='.$ac; }
  }

# [mb_aa_SPTR.rodent]
# feature  = match:blastx:aa_SPTR.rodent
# glyph    = segments
# bgcolor  = lightslategray
# fgcolor  = black
# key      = match:blastx:aa_SPTR.rodent
# citation = match:blastx:aa_SPTR.rodent
# category = ' Blast features'

[mb_vert]
feature  = match:blastx:aa_SPTR.rodent match:blastx:aa_SPTR.othvert
glyph    = segments
bgcolor  = lightslategray
fgcolor  = black
key      = Vertebrate protein 
citation = Blastx rodent, vertebrate aa_SPTR 
category = ' Blast features'
link = sub { my $ac=shift->name(); $ac=~s/[:.].*$//;  
  if ($ac=~/^(L|N|M|P|Q|O|R|S|T|U|V|W)/) { return 'http://www.uniprot.org/entry/'.$ac; }
  elsif ($ac) { return 'http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Search&db=Protein&doptcmdl=GenPept&tool=FlyBase&term='.$ac; }
  }


[mb_aa_SPTR.plant]
feature  = match:blastx:aa_SPTR.plant
glyph    = segments
bgcolor  = lightslategray
fgcolor  = black
key      = Plant protein 
citation = match:blastx:aa_SPTR.plant
category = ' Blast features'
link = sub { my $ac=shift->name(); $ac=~s/[:.].*$//;  
  if ($ac=~/^(L|N|M|P|Q|O|R|S|T|U|V|W)/) { return 'http://www.uniprot.org/entry/'.$ac; }
  elsif ($ac) { return 'http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Search&db=Protein&doptcmdl=GenPept&tool=FlyBase&term='.$ac; }
  }



#--- sim4 features


[ms_na_gb.dmel]
feature  = match:sim4:na_gb.dmel
glyph    = segments
bgcolor  = lightslategray
fgcolor  = black
key = Dmel genbank
citation = match:sim4:na_gb.dmel
category = ' Sim4 features'
link = sub { my $v=shift->name();  $v=~s/^(GB)[:]//;  $v=~s/[:.].*$//; 
  return 'http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Search&db=Nucleotide&doptcmdl=GenBank&tool=FlyBase&term='.$v;  
  }

[mst_na_gb.dmel]
feature  = match:sim4tandem:na_gb.dmel
glyph    = segments
bgcolor  = lightslategray
fgcolor  = black
key      = Dmel genbank (sim4tandem)
citation = match:sim4tandem:na_gb.dmel
category = ' Sim4 features'
link = sub { my $v=shift->name();  $v=~s/^(GB)[:]//;  $v=~s/[:.].*$//; 
  return 'http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Search&db=Nucleotide&doptcmdl=GenBank&tool=FlyBase&term='.$v;  
  }

[ms_na_gb.tpa.dmel]
feature  = match:sim4:na_gb.tpa.dmel
glyph    = segments
bgcolor  = lightslategray
fgcolor  = black
key = Dmel genbank tpa
citation = match:sim4:na_gb.tpa.dmel
category = ' Sim4 features'
link = sub { my $v=shift->name();  $v=~s/^(GB)[:]//;  $v=~s/[:.].*$//; 
  return 'http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Search&db=Nucleotide&doptcmdl=GenBank&tool=FlyBase&term='.$v;  
  }


[ms_na_transcript_dmel_r32]
feature  = match:sim4:na_transcript_dmel_r32
glyph    = segments
bgcolor  = lightslategray
fgcolor  = black
key = Dmel r32 transcript
citation = match:sim4:na_transcript_dmel_r32
category = ' Sim4 features'
link = "#"


[ms_na_transcript_dmel_r31]
feature  = match:sim4:na_transcript_dmel_r31
glyph    = segments
bgcolor  = lightslategray
fgcolor  = black
key = Dmel r31 transcript
citation = match:sim4:na_transcript_dmel_r31
category = ' Sim4 features'
link = "#"


[ms_na_gadfly_dmel_r2]
feature  = match:sim4:na_gadfly_dmel_r2
glyph    = segments
bgcolor  = lightslategray
fgcolor  = black
key = Dmel r2 transcript
citation = match:sim4:na_gadfly_dmel_r2
category = ' Sim4 features'
link = "#"



[ms_na_smallRNA.dros]
feature  = match:sim4:na_smallRNA.dros
glyph    = segments
bgcolor  = lightslategray
fgcolor  = black
key =  Dros smallRNA
citation = match:sim4:na_smallRNA.dros
category = ' Sim4 features'
link = "#"


[ms_na_ARGs.dros]
feature  = match:sim4:na_ARGs.dros
glyph    = segments
bgcolor  = lightslategray
fgcolor  = black
key = Dmel ARGs
citation = match:sim4:na_ARGs.dros
category = ' Sim4 features'
link = "#"


[ms_na_ARGsCDS.dros]
feature  = match:sim4:na_ARGsCDS.dros
glyph    = segments
bgcolor  = lightslategray
fgcolor  = black
key = Dmel ARGs CDS
citation = match:sim4:na_ARGsCDS.dros
category = ' Sim4 features'
link = "#"





#-------- Genome reagents -------------------
# see dgc,est above


# keep here so shows at top near BAC track
[blast]
feature       = blast
glyph         = alignment
bgcolor       = darkorchid
fgcolor       = darkorchid
bump          = 1
label         = 1
key           = Blast hit
height        = 8
citation      = BLAST alignment hit
#category = 'hidden'
#hidden = 1
link = "#"

[BAC]
feature  = BAC
glyph         = extending_arrow
no_arrows     = 1
base          = 0
bgcolor       = lightslategray
fgcolor       = lightslategray
linewidth     = 2
bump          = 1
label         = 1
key           = Tiling BAC
citation     = BAC (annotation DB ; Chado)
category = '  Genome reagents'
link = sub { my $nm= shift->name();  return ($nm)?'/flybase/cgi-bin/fbannq.html?DBX='.$nm : ''; }

## aug04 - was segment; renamed to SO equivalent golden_path ???
[scaffold]
feature  =    scaffold  
glyph         = anchored_arrow
no_arrows     = 1
base          = 0
fgcolor       = black
bgcolor       = black
linewidth     = 2
bump          = 1
label         = 1
# relative_coords  = 1
height        = 4
key           = GenBank Scaffold
citation     = golden_path segment (annotation DB ; Chado)
category = '  Genome reagents'
link = sub { my $nm= shift->name(); return ($nm)?'/flybase/cgi-bin/fbannq.html?ARM='.$nm : ''; }


## feature to put into oview ...
# [overview]
# feature       = golden_path
# glyph         = drosophila_arrow
# bgcolor       = lavender
# label         = 1
# height        = 5


# mysql> select count(f.fid),ft.ftypeid,ft.fmethod,ft.fsource 
#     ->  from fdata f,ftype ft where f.ftypeid = ft.ftypeid 
#     ->  group by ft.fmethod;
# +--------------+---------+-------------------------------------+---------------+
# | count(f.fid) | ftypeid | fmethod                             | fsource       |
# +--------------+---------+-------------------------------------+---------------+
# |           78 |      70 | aberration_junction                 | .             |
# |          674 |      57 | BAC                                 | .             |
# |        18941 |      31 | CDS                                 | .             |
# |            6 |       2 | chromosome                          | .             |
# |            6 |       7 | chromosome_arm                      | .             |
# |         5770 |       3 | chromosome_band                     | .             |
# |            6 |       1 | Component                           | reference     |
# |            5 |      96 | DNA_motif                           | .             |
# |           27 |      84 | enhancer                            | .             |
# |        63033 |      12 | exon                                | .             |
# |        17251 |      11 | five_prime_UTR                      | .             |
# |        14066 |      20 | gene                                | .             |
# |          404 |      63 | insertion_site                      | .             |
# |        47070 |      34 | intron                              | .             |
# |      1146066 |       5 | match                               | assembly:path |
# |          295 |      81 | match:tRNAscan-SE                   | .             |
# |      2128688 |       6 | match_part                          | assembly:path |
# |          295 |      82 | match_part:tRNAscan-SE              | .             |
# |            8 |      74 | mature_peptide                      | .             |
# |        16884 |      21 | mRNA                                | .             |
# |          140 |      87 | ncRNA                               | .             |
# |       197525 |      55 | oligo                               | .             |
# |          458 |      71 | point_mutation                      | .             |
# |          107 |      73 | polyA_site                          | .             |
# |           92 |      85 | protein_binding_site                | .             |
# |           39 |      80 | pseudogene                          | .             |
# |           30 |      86 | region                              | .             |
# |          137 |      88 | regulatory_region                   | .             |
# |         9199 |      90 | repeat_region                       | .             |
# |          135 |      62 | rescue_fragment                     | .             |
# |           96 |      98 | rRNA                                | .             |
# |          437 |       4 | scaffold                            | .             |
# |          209 |      72 | sequence_variant                    | .             |
# |            1 |      97 | signal_peptide                      | .             |
# |           28 |      89 | snoRNA                              | .             |
# |           29 |      77 | snRNA                               | .             |
# |        11692 |      56 | three_prime_UTR                     | .             |
# |        36921 |      10 | transcription_start_site            | .             |
# |         1571 |      61 | transposable_element                | .             |
# |        16404 |      60 | transposable_element_insertion_site | .             |
# |          295 |      83 | tRNA                                | .             |
# +--------------+---------+-------------------------------------+---------------+
# 41 rows in set (2 min 47.37 sec)
.
