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

#slight modifications by Scott Cain to include with GBrowse dist
# should work well with current flybase GFF3

[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::mysql
database    = dbi:mysql:database=flybase
user        = nobody
passwd      =

aggregators = transcript  alignment

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 = BatchDumper FastaDumper GFFDumper 

cache_overview = 360
cachedir = 360

# Web site configuration info
stylesheet  = /gbrowse/gbrowse.css
buttons     = /gbrowse/images/buttons
tmpimages   = /gbrowse/tmp
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 'http://flybase.org/cgi-bin/fbidq.html?'.$1; }
  elsif ($d =~ /(FB\w\w\d+)/){ return 'http://flybase.org/cgi-bin/fbidq.html?'.$1; }
  elsif ($d =~ /((C[GR]|TE)\d+)/ ){ return 'http://flybase.org/cgi-bin/fbidq.html?'.$1; }
  if ($f->name()) { return 'http://flybase.org/cgi-bin/fbsymq.html?'.$f->name(); } 
  }

title = sub { my $f= shift;
	return $f->method .":". $f->info . " ". $f->seq_id .':'.$f->start."..".$f->end;
	}

## suggested display name change ? is this active
## this works .. 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'));
    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 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: 03.fly.conf,v 1.3 2005-12-09 22:19:09 mwz444 Exp $</pre>


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

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


[gene]
feature       = gene transcript  
glyph         = transcript2
bgcolor       = lightblue
fgcolor       = blue
secondary     = mRNA
secondary_bgcolor = mediumblue
secondary_fgcolor = mediumblue
highlight_color = red
higlighted = 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 Model
category = '   Genomic features'
citation     = Gene and mRNA (transcript) features  (annotation DB ; Chado)

[genespan]
feature       = gene 
glyph = segments
stranded = 1
bgcolor       = lightblue
fgcolor       = blue
highlight_color = red
higlighted = 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)

# an aggregator feature
[mRNA]
feature  = transcript
glyph = segments
stranded = 1
translation  = 1frame
bgcolor = palegoldenrod
fgcolor = goldenrod
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'

[CDS]
feature  = CDS
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'

[intron]
feature  = intron
glyph = segments
stranded     = 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 = 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 = 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
fgcolor       = orange
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
bgcolor       = magenta
fgcolor       = magenta
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'

[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());  
  if ($d =~ /(FBti\d+)/||$d =~ /((FB\w\w|TE)\d+)/) { return 'http://flybase.org/cgi-bin/fbidq.html?'.$1; }
  if ($f->name()) { return 'http://flybase.org/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 'http://flybase.org/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 'http://flybase.org/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 'http://flybase.org/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 'http://flybase.org/cgi-bin/fbannq.html?synonym='.$v;  
 }

[mature_peptide]
feature  = mature_peptide
glyph = segments
strand_arrow  = 1
bgcolor = palegoldenrod
fgcolor       = orange
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 'http://flybase.org/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 'http://flybase.org/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 'http://flybase.org/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 'http://flybase.org/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 'http://flybase.org/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;  
  }

[EST]
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:

[oligo]
feature  = oligo
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())?'http://flybase.org/cgi-bin/fbannq.html?oligo='.$f->name() : ''; }
 
#-------- Analysis -------------------

# from match:promoter ?
[transcription_start_site]
feature  = transcription_start_site 
glyph         = generic
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 = "#"


[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 = 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     = AUTO
           #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_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)?'http://flybase.org/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
height        = 4
key           = GenBank Scaffold
citation     = golden_path segment (annotation DB ; Chado)
category = '  Genome reagents'
link = sub { my $nm= shift->name(); return ($nm)?'http://flybase.org/cgi-bin/fbannq.html?ARM='.$nm : ''; }

### feature count table: update  w/ fsource grouping
# 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, ft.fsource;
# 
# 
# +--------------+---------+-------------------------------------+-----------------------------+
# | count(f.fid) | ftypeid | fmethod                             | fsource                     |
# +--------------+---------+-------------------------------------+-----------------------------+
# |           79 |      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                            | .                           |
# |        93075 |      12 | exon                                | .                           |
# |        21634 |      11 | five_prime_UTR                      | .                           |
# |        14066 |      20 | gene                                | .                           |
# |          408 |      63 | insertion_site                      | .                           |
# |        73345 |      34 | intron                              | .                           |
# |          434 |       5 | match                               | assembly:path               |
# |       207911 |      30 | match                               | blastx:aa_SPTR.dmel         |
# |        16610 |      51 | match                               | blastx:aa_SPTR.insect       |
# |        21451 |      35 | match                               | blastx:aa_SPTR.othinv       |
# |        18036 |      37 | match                               | blastx:aa_SPTR.othvert      |
# |        11997 |      47 | match                               | blastx:aa_SPTR.plant        |
# |        20850 |      33 | match                               | blastx:aa_SPTR.primate      |
# |        21644 |      45 | match                               | blastx:aa_SPTR.rodent       |
# |        13765 |      41 | match                               | blastx:aa_SPTR.worm         |
# |         5593 |      39 | match                               | blastx:aa_SPTR.yeast        |
# |        11063 |      94 | match                               | genie                       |
# |        17811 |      28 | match                               | genscan                     |
# |          139 |      99 | match                               | HDP                         |
# |        11758 |      58 | match                               | repeatmasker                |
# |          110 |      78 | match                               | RNAiHDP                     |
# |         1062 |      65 | match                               | sim4:na_ARGs.dros           |
# |          984 |      66 | match                               | sim4:na_ARGsCDS.dros        |
# |        85910 |      25 | match                               | sim4:na_dbEST.diff.dmel     |
# |       169078 |      14 | match                               | sim4:na_dbEST.same.dmel     |
# |         6458 |      13 | match                               | sim4:na_DGC_dros            |
# |        14249 |      22 | match                               | sim4:na_gadfly_dmel_r2      |
# |        26531 |       8 | match                               | sim4:na_gb.dmel             |
# |         2214 |      68 | match                               | sim4:na_gb.tpa.dmel         |
# |           98 |      75 | match                               | sim4:na_smallRNA.dros       |
# |        19001 |      23 | match                               | sim4:na_transcript_dmel_r31 |
# |        18799 |      24 | match                               | sim4:na_transcript_dmel_r32 |
# |        23748 |      93 | match                               | sim4tandem:na_gb.dmel       |
# |       101190 |      49 | match                               | tblastx:na_agambiae         |
# |        34107 |      53 | match                               | tblastx:na_dbEST.insect     |
# |       263465 |      43 | match                               | tblastx:na_dpse             |
# |          295 |      81 | match:tRNAscan-SE                   | .                           |
# |          434 |       6 | match_part                          | assembly:path               |
# |       364002 |      29 | match_part                          | blastx:aa_SPTR.dmel         |
# |        37018 |      52 | match_part                          | blastx:aa_SPTR.insect       |
# |        52260 |      36 | match_part                          | blastx:aa_SPTR.othinv       |
# |        40052 |      38 | match_part                          | blastx:aa_SPTR.othvert      |
# |        24905 |      48 | match_part                          | blastx:aa_SPTR.plant        |
# |        52032 |      32 | match_part                          | blastx:aa_SPTR.primate      |
# |        53213 |      46 | match_part                          | blastx:aa_SPTR.rodent       |
# |        32318 |      42 | match_part                          | blastx:aa_SPTR.worm         |
# |        11381 |      40 | match_part                          | blastx:aa_SPTR.yeast        |
# |        41282 |      95 | match_part                          | genie                       |
# |        72887 |      27 | match_part                          | genscan                     |
# |          164 |     100 | match_part                          | HDP                         |
# |        11758 |      59 | match_part                          | repeatmasker                |
# |         9198 |      91 | match_part                          | repeat_runner_seg           |
# |          294 |      79 | match_part                          | RNAiHDP                     |
# |         5621 |      64 | match_part                          | sim4:na_ARGs.dros           |
# |         4720 |      67 | match_part                          | sim4:na_ARGsCDS.dros        |
# |       158509 |      26 | match_part                          | sim4:na_dbEST.diff.dmel     |
# |       347084 |      16 | match_part                          | sim4:na_dbEST.same.dmel     |
# |        10821 |      15 | match_part                          | sim4:na_DGC_dros            |
# |        57603 |      17 | match_part                          | sim4:na_gadfly_dmel_r2      |
# |        78406 |       9 | match_part                          | sim4:na_gb.dmel             |
# |         2260 |      69 | match_part                          | sim4:na_gb.tpa.dmel         |
# |          124 |      76 | match_part                          | sim4:na_smallRNA.dros       |
# |        86217 |      18 | match_part                          | sim4:na_transcript_dmel_r31 |
# |        89670 |      19 | match_part                          | sim4:na_transcript_dmel_r32 |
# |        68525 |      92 | match_part                          | sim4tandem:na_gb.dmel       |
# |       101190 |      50 | match_part                          | tblastx:na_agambiae         |
# |        51275 |      54 | match_part                          | tblastx:na_dbEST.insect     |
# |       263465 |      44 | match_part                          | tblastx:na_dpse             |
# |          295 |      82 | match_part:tRNAscan-SE              | .                           |
# |            8 |      74 | mature_peptide                      | .                           |
# |        16884 |      21 | mRNA                                | .                           |
# |          140 |      87 | ncRNA                               | .                           |
# |       197525 |      55 | oligo                               | .                           |
# |          458 |      71 | point_mutation                      | .                           |
# |          123 |      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                               | .                           |
# |        16020 |      56 | three_prime_UTR                     | .                           |
# |        36921 |      10 | transcription_start_site            | .                           |
# |         1571 |      61 | transposable_element                | .                           |
# |        16404 |      60 | transposable_element_insertion_site | .                           |
# |          295 |      83 | tRNA                                | .                           |
# +--------------+---------+-------------------------------------+-----------------------------+
# 100 rows in set (7 min 6.01 sec)

