# gbrowse config file for  genome maps
[GENERAL]

description = Dros. species overview, 2005-08

header = 
  <h2>Overview of Drosophila species, 2005-08</h2>

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: drosoview.conf,v1.0 gbrowseconf.xml Exp $</pre>


## dnalib; add all spp to it, with dbid prefix to scaffold.raw
# lucegene GFF adaptor
db_adaptor    = Bio::DB::GFF
db_args       = 
    -adaptor    lucegene
    -FORMAT     gff
    -LIB_NAME   dros_spp0508
    -INDEX_ROOT /bio/argos/species/indices/lucene
    -JAVA_LIB   /bio/argos/common/perl/gbrowse/lib/java
    -DNA_LIB    /bio/argos/species/web/data/dmel-dspp/dna
    -use_server 1
    -dbport     7155
    -LOGFILE    /tmp/lugene-drospege.log
    
## mysql adaptor for same data
# adaptor     = dbi::mysqlopt
# database    = dbi:mysql:database=dros_spp;host=localhost
# user        = 
# passwd      =


#test caching images; ggb now supports only overview cache
cache_overview = 360
cache_all = 1


default_name = 2L:1000000..2000000
default_range = 1-500000

# examples to show in the introduction
examples =  X 2L 2R 3L 3R 4 <br>
    ci Mad eve run jim loco &nbsp;&nbsp;
    odd stan can rut 4 tin
    
#    Mad eve can run 4 tin
#    odd stan can rut 4 tin
# 2L:  Mad/odd/tiptop/cad/raw/
# 2R:  so/eve/stan/Amy-p/prod/mam
# 3L:  jim/blot/polo/can/Sod/
# 3R:  tin/loco/Med/lab/bam/
# X:   fog/run/car/rut/mew/arm
# 4:   4/ci/toy? 
# chromosomes = chromosome_arm:2L 2L:1..50000 2L 2R 3L 3R 4 X 

# src="/species/cgi-bin/gbrowse_img/drosview/?name=2L;width=700;e=1;t=markers+dana+dere+dgri+dmoj+dpse+dsim+dvir+dyak"


#Aligner -- cant get to work (20k too big?)
plugins = 
 BatchDumper TextMapDumper FeatureFastaDumper FastaDumper GFFDumper 

# and below,later
#[Aligner:plugin]
#alignable_tracks   = scaffold blastdere blastdana
#upcase_tracks      = scaffold 
#upcase_default     = scaffold

## option for these? transcript05 replaces transcript
##aggregators =  matchparts transcript05 alignment orf
## read the docs: can do it here instead of perl.pm
aggregators =  transcript05 alignment orf
     matches{match_part,assembly_component/match}

uploads = 1

## need this for  Chado segment lookup in Browser.pm _feature_get ...
reference class = chromosome_arm

## need options here
default features =  
   markers:overview markers 
   dana dere dgri dmoj dpse dsim dvir dyak
   #scaffold chromosome_band 
   
   
primary_feature = gene

# ? these are flybase-specials ?
# scale_feature = cytoband
dumpviews = FastA GenBank GFF FFF
dataviews = "Default" "Collapse All" "Expand All" 

# Web site configuration info; urk FIXME ... installer
help        = /gbrowse
stylesheet  = /gbrowse/gbrowse.css
buttons     = /gbrowse/images/buttons
tmpimages   = /species/tmp/gbrowse

# stylesheet  = /gbrowse/gbrowse.css
# buttons     = /gbrowse/images/buttons
# tmpimages   = /gbrowse/tmp


# max and default segment sizes for detailed view
max segment     = 30000001
default segment = 1000000

# low-res boundary
low res = 200000

zoom levels =  20000  100000  500000 1000000
   5000000 10000000  20000000     
  

searchhelp = Search using Chromosome:base_start..end or Gene name/ID.

#panel property
pad_left    = 20
pad_right   = 30
key_style = between
key bgcolor = whitesmoke
overview bgcolor = whitesmoke
grid = 1

# put reversed features on same track or below ?
mix_strand = 1

# # where to link to when user clicks in detailed view
link    = AUTO
# # default dummy link to get popup title view
# link = sub { return "#"; }
# link = sub {
#   my $f= shift;
#   my $d= $f->primary_id() if $f->can('primary_id');
#   $d= $f->source() unless($d);
#   if ($d) { return '/cgi-bin/lookup?id='.$d; }
#   $d= $f->name();
#   if ($d) { return '/cgi-bin/lookup?name='.$d; }
#   }

title = sub { my $f= shift;
  my $loc= " " .$f->seq_id .':'.$f->start."..".$f->end;
  my $nm; my @na;
  my($id)= $f->each_tag_value('ID'); $id= $f->primary_id() unless($id);
  $id =~ s/\.\d+$//; # local id
  @na= $f->each_tag_value('Name'); if (@na>0) { $nm= shift @na; }
  unless($nm) { @na= $f->each_tag_value('Alias'); if (@na>0) { $nm= shift @na;  } }
  $nm= $f->name unless($nm);
  $nm .= " ($id)" unless($id =~ /$nm/);
  return $f->method .":$nm $loc";
  }


  

# 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

language = en

# Default glyph settings
glyph       = generic
height      = 5
bgcolor     = palegoldenrod
fgcolor     = cyan
boxcolor    = blue
label density = 15
bump density  = 50
overview label density = 160

image widths  = 450 640 800 950 1024
default width = 800

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


[BatchDumper:plugin]
fileformat = embl

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



[chromosome_band]
feature  = chromosome_band
#glyph    = segments
glyph = revcomp_arrow
bgcolor  = lightslategray
fgcolor  = black
label density = 200
height      = 2
bump density  = 0
key      = chromosome_band
citation = chromosome_band
category = Genome features
label = sub { my $f = shift;
    my @na= ($f->attributes('Name'),  $f->display_name);
    my $na= shift @na; $na =~ s/band-//;
    return $na;
    }
label_align = center
no_tick_label = 1
#tick = 2
#both = 1
#linewidth = 2

# 
# [gene]
# #feature       = gene transcript  
# #feature       = gene mRNA
# feature       = gene:.
# glyph         = transcript2
# bgcolor       = lightblue
# fgcolor       = blue
# #secondary     = mRNA
# #secondary_bgcolor = mediumblue
# #secondary_fgcolor = mediumblue
# highlight_color = red
# higlighted = 1
# label = 1
# label density = 50
# key           = D.melanogaster Genes
# category = Genome features
# citation     = Gene and mRNA (transcript) features  

[markers:overview]
feature = gene:marker
glyph         = generic
bgcolor       = green
height        = 5
label density = 520
bump density  = 550
key           = Dmel. marker
label = sub { my $f = shift;
    my @na= ($f->attributes('ID'), $f->attributes('Name')); 
    return $na[0] || $f->display_name;
    }
#?? marker Name or ID

[markers]
feature = gene:marker
bgcolor  = green
glyph    = segments
stranded = 1
label density = 520
bump density  = 550
key      = Dmel. marker
citation = Dmel. marker
category = Analysis
label = sub { my $f = shift;
    my @na= ($f->attributes('ID'), $f->attributes('Name')); 
    return $na[0] || $f->display_name;
    }
link = sub {
  my $f= shift; 
  my ($r)= ($f->attributes('ID'), $f->attributes('Name'), $f->display_name); 
  if ($r) { 
     #$r=~s/\..*$//; 
     return '/species/cgi-bin/gbrowse/dros_spp/?name='.$r;
     }
  }


#[match]
#feature  = match
#glyph    = segments
#bgcolor  = lightslategray
#fgcolor  = black
#key      = match
#citation = match
#category = Analysis

# and later
#[Aligner:plugin]
##alignable_tracks   = scaffold blastdere blastdana
#alignable_tracks   = gene blastdere blastdana
#upcase_tracks      = gene
#upcase_default     = gene

# [blastdvir]
# feature  = cross_genome_match:dvir_ag0508
# glyph    = segments 
# stranded     = 1
# label density = 50
# bgcolor  = slateblue
# # turquoise # lightslategray
# fgcolor  = black
# key      = D.virilis cross_genome
# category = Analysis
# link = sub {
#   my $f= shift; 
#   my ($t)= $f->attributes('Target');
#   if ($t) { 
#     $t=~s/^\w+://; $t=~s/[\s+]/:/; $t=~s/[\s+]/../;
#     return '/species/cgi-bin/gbrowse/dvir/?name='.$t;}
#   my ($r)= $f->attributes('ID');
#   if ($r) { 
#      $r=~s/\..*$//; 
#      return '/species/cgi-bin/gbrowse/dvir/?name='.$r;
#      }
#   }

##[dvir:overview]
[dvir]
feature  = cross_genome_match:dvir_ag0508
#glyph         = generic
glyph    = segments 
stranded     = 1
bgcolor        = slateblue
height        = 10
key           = D.virilis
category = Analysis
bump density  = 0
label = 0
link = sub {
  my $f= shift; 
  my ($t)= $f->attributes('Target');
  if ($t) { 
    $t=~s/^\w+://; $t=~s/[\s+]/:/; $t=~s/[\s+]/../;
    return '/species/cgi-bin/gbrowse/dvir/?name='.$t;}
  my ($r)= $f->attributes('ID');
  if ($r) { 
     $r=~s/\..*$//; 
     return '/species/cgi-bin/gbrowse/dvir/?name='.$r;
     }
  }

# [blastdmoj]
# feature  = cross_genome_match:dmoj_ag01aug05
# glyph    = segments
# stranded     = 1
# label density = 50
# bgcolor  = blanchedalmond
# # turquoise
# fgcolor  = black
# key      = D.mojavensis cross_genome
# category = Analysis
# link = sub {
#   my $f= shift; 
#   my ($t)= $f->attributes('Target');
#   if ($t) { 
#     $t=~s/^\w+://; $t=~s/[\s+]/:/; $t=~s/[\s+]/../;
#     return '/species/cgi-bin/gbrowse/dmoj/?name='.$t;}
#   my ($r)= $f->attributes('ID');
#   if ($r) { 
#      $r=~s/\..*$//; 
#      return '/species/cgi-bin/gbrowse/dmoj/?name='.$r;
#      }
#   }

#[dmoj:overview]
[dmoj]
feature  = cross_genome_match:dmoj_ag01aug05
#glyph         = generic
glyph    = segments
stranded     = 1
bump density  = 0
bgcolor  = blanchedalmond
height        = 10
key           = D.mojavensis
category = Analysis
link = sub {
  my $f= shift; 
  my ($t)= $f->attributes('Target');
  if ($t) { 
    $t=~s/^\w+://; $t=~s/[\s+]/:/; $t=~s/[\s+]/../;
    return '/species/cgi-bin/gbrowse/dmoj/?name='.$t;}
  my ($r)= $f->attributes('ID');
  if ($r) { 
     $r=~s/\..*$//; 
     return '/species/cgi-bin/gbrowse/dmoj/?name='.$r;
     }
  }

[dere]
feature  = cross_genome_match:dere_ag01aug05
glyph    = segments
stranded     = 1
bgcolor  = mediumspringgreen
# turquoise
bump density  = 0
fgcolor  = black
key      = D.erecta
category = Analysis
link = sub {
  my $f= shift; 
  my ($t)= $f->attributes('Target');
  if ($t) { 
    $t=~s/^\w+://; $t=~s/[\s+]/:/; $t=~s/[\s+]/../;
    return '/species/cgi-bin/gbrowse/dere/?name='.$t;}
  my ($r)= $f->attributes('ID');
  if ($r) { 
     $r=~s/\..*$//; 
     return '/species/cgi-bin/gbrowse/dere/?name='.$r;
     }
  }

[dgri]
feature  = cross_genome_match:dgri_ag01aug05
glyph    = segments
stranded     = 1
bump density  = 0
bgcolor  = orange
fgcolor  = black
key      = D.grimshawi
category = Analysis
link = sub {
  my $f= shift;
  my ($t)= $f->attributes('Target');
  if ($t) { 
    $t=~s/^\w+://; $t=~s/[\s+]/:/; $t=~s/[\s+]/../;
    return '/species/cgi-bin/gbrowse/dgri/?name='.$t;}
  my ($r)= $f->attributes('ID');
  if ($r) {  
     $r=~s/\..*$//; 
     return '/species/cgi-bin/gbrowse/dgri/?name='.$r;
     }
  }


[dana]   
feature  = cross_genome_match:dana_ag01aug05
glyph    = segments
stranded     = 1
bump density  = 0
bgcolor  = plum
#seashell # palevioletred # royalblue  peachpuff
fgcolor  = black
key      = D.annanasae
category = Analysis
link = sub {    
  my $f= shift;
  my ($t)= $f->attributes('Target');
  if ($t) { 
    $t=~s/^\w+://; $t=~s/[\s+]/:/; $t=~s/[\s+]/../;
    return '/species/cgi-bin/gbrowse/dana/?name='.$t;}
  my ($r)= $f->attributes('ID');
  if ($r) {
     $r=~s/\..*$//; 
     return '/species/cgi-bin/gbrowse/dana/?name='.$r;
     }
  }


[dyak]
#feature  = matches:blastn:dyak_wu040407
#glyph    = graded_segments
feature  = cross_genome_match:dyak_wu040407
glyph    = segments
stranded     = 1
bump density  = 0
bgcolor  = wheat
# gainsboro lightyellow  # wheat
fgcolor  = black
key      = D.yakuba 
category = Analysis
label = sub { my $f = shift;
    my @na= ($f->attributes('Name'),  $f->display_name);
    my $na= shift @na; $na =~ s/^\w+://;
    return $na;
    }
link = sub {    
  my $f= shift;
  my ($t)= $f->attributes('Target');
  if ($t) { 
    $t=~s/^\w+://; $t=~s/[\s+]/:/; $t=~s/[\s+]/../;
    return '/species/cgi-bin/gbrowse/dyak/?name='.$t;}
  my ($r)= $f->attributes('ID');
  if ($r) {  
     $r=~s/\..*$//; 
     return '/species/cgi-bin/gbrowse/dyak/?name='.$r;
     }
  }


[dsim]
feature  = cross_genome_match:dsim_dgpg20040929
glyph    = segments
stranded     = 1
bump density  = 0
bgcolor  = goldenrod
# gainsboro lightyellow  # wheat
fgcolor  = black
key      = D.simulans
category = Analysis
link = sub {
  my $f= shift;
  my ($t)= $f->attributes('Target');
  if ($t) { 
    $t=~s/^\w+://; $t=~s/[\s+]/:/; $t=~s/[\s+]/../;
    return '/species/cgi-bin/gbrowse/dsim/?name='.$t;}
  my ($r)= $f->attributes('ID');
  if ($r) {  
     $r=~s/\..*$//; 
     return '/species/cgi-bin/gbrowse/dsim/?name='.$r;
     }
  }


[dpse]
feature  = cross_genome_match:dpse_r1.04
glyph    = segments
stranded     = 1
bump density  = 0
bgcolor  = lightgrey
# gainsboro lightyellow  # wheat
fgcolor  = black
key      = D.pseudoobscura
category = Analysis
link = sub {
  my $f= shift;
  my ($t)= $f->attributes('Target');
  if ($t) { 
    $t=~s/^\w+://; $t=~s/[\s+]/:/; $t=~s/[\s+]/../;
    return '/species/cgi-bin/gbrowse/dpse/?name='.$t;}
  my ($r)= $f->attributes('ID');
  if ($r) {  
     $r=~s/\..*$//; 
     return '/species/cgi-bin/gbrowse/dpse/?name='.$r;
     }
  }


[scaffold]
## aug04 - renamed to SO equivalent golden_path; 
## sep04 - golden_path_fragment is better, or supercontig ?
feature  = scaffold golden_path_fragment 
glyph         = anchored_arrow
no_arrows     = 1
base          = 0
fgcolor       = black
bgcolor       = black
linewidth     = 2
#bump          = 1
#label         = 1
bump density  = 0
label density = 10
height        = 4
key           = D. melanogaster Scaffold
citation     = GenBank submission unit, a golden_path_fragment  
category = Genome features
#link = sub { my $f= shift; return ($f->name())?'/cgi-bin/fbannq.html?ARM='.$f->name() : ''; }

.
