# gbrowse config file for  genome maps
[GENERAL]

description = D. grimshawi scaffolds 20050801

header = 

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

# lucegene GFF adaptor
db_adaptor    = Bio::DB::GFF
db_args       = 
    -adaptor    lucegene
    -FORMAT     gff
    -LIB_NAME   dgri_ag0508
    -INDEX_ROOT /bio/argos/species/indices/lucene
    -JAVA_LIB   /bio/argos/common/perl/gbrowse/lib/java
    -DNA_LIB    /bio/argos/species/web/data/dgri/dna
    -use_server 1
    -dbport     7155
    -LOGFILE    /tmp/lugene-drospege.log
    
## mysql adaptor for same data
# adaptor     = dbi::mysqlopt
# database    = dbi:mysql:database=dgri_ag0508;host=localhost
# user        = 
# passwd      =

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


default_name = scaffold_25013:1..50000 
default_range = 1-500000

# examples to show in the introduction
examples =  scaffold_1:1..50000 
   &nbsp;&nbsp; ci Mad eve run jim loco &nbsp;&nbsp;
    odd stan can rut tin toy &nbsp;&nbsp;
    match:Abd* match:Ubx* 

plugins = BatchDumper TextMapDumper FeatureFastaDumper FastaDumper GFFDumper 

## option for these? transcript05 replaces transcript
##aggregators =  matchparts transcript05 alignment orf
aggregators =  transcript05 alignment orf
      nucleotide_match{match_part/match} 
      protein_match{match_part/match}

# protein_match2{match_part:HSP,match_part:endpoint/match}

uploads = 1

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

## need options here
default features = tblastDM tblastAM tblastAG tblastCE blastndmel
  markers:overview blastdmic

#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     = 1000001
default segment = 100000

# low-res boundary
low res = 200000

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

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

title = sub { my $f= shift;
  my $loc= $f->seq_id .':'.$f->start."..".$f->end;
  my $ftype= $f->method; if ($ftype =~ /^match/) { $ftype= $f->source(); }
  my ($nm)= ($f->attributes('Name'), $f->attributes('Alias'),
             $f->attributes('symbol'), $f->attributes('name'), $f->name() );
  my $sc= $f->score; $nm .= " p=$sc" if ($sc =~ /\d/);
  return $ftype .":". $nm . " ". $loc;
  }

## 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 ($db eq 'GB_protein') { 
      $v= $ac;
      $h= 'http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Search&db=Protein&doptcmdl=GenBank&tool=GMOD&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=GMOD&term='.$ac;
      }
    elsif ($db eq 'GO') { 
      $v= $ac;
      $h= '/cgi-bin/goreport?id='.$ac;
      }
    if ($h && $v) { $r.= '<a href="'.$h.'">'.$v.'</a>, '; }
    else { $r.= $x.', '; }
    }
  return $r;
  }
  
  

# 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 = match

language = en

# Default glyph settings
glyph       = generic
height      = 5
bgcolor     = palegoldenrod
fgcolor     = cyan
boxcolor    = blue
label density = 20
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
  

[dna]
feature       = scaffold
glyph         = dna
draw_dna      = 1
nodump = 1
strand        = forward
label         = 0
label density = 0
key           = DNA sequence
category = Genome features
link =

[tblastSC]
feature  = protein_match:tblastn:modsc 
#feature  = protein_match2:tblastn:modsc protein_match2:HSP
glyph    = segments
stranded     = 1
bgcolor  = lightslategray
fgcolor  = black
key      = Yeast protein 
citation = match:tblastn:modSC
category = Analysis
link = sub {
  my $f= shift; 
  my $d= join(',',$f->attributes('ID'),$f->attributes('Dbxref'),$f->primary_id());
  if ($d =~ /((S|L)\d+)/){ 
    return 'http://db.yeastgenome.org/cgi-bin/locus.pl?dbid='.$1; 
    }
  my @d= ($f->attributes('synonym'),$f->attributes('Name'),$f->name());
  $d= shift @d;
  if ($d){ 
    return 'http://db.yeastgenome.org/cgi-bin/locus.pl?locus='.$d; 
    }
  }
label = sub { my $f = shift;
    my @na= ($f->attributes('Name'), $f->attributes('Alias'), $f->attributes('symbol')); 
    return $na[0] || $f->display_name;
    }

[tblastDM]
feature  = protein_match:tblastn:moddm
#feature  = match:tblastn:moddm match_part:HSP
glyph    = segments
stranded     = 1
bgcolor  = lightslategray
fgcolor  = black
key      = Fruitfly protein
citation = match:tblastn:modDM
category = Analysis
link = sub {
  my $f= shift; 
  my $d= join(',',$f->attributes('ID'),$f->attributes('Dbxref'),$f->primary_id());  
  if ($d =~ /((C[GR]|TE|FB\w\w)\d+)/){ return '/flybase/cgi-bin/fbidq.html?'.$1; }
  }
label = sub { my $f = shift;
    my @na= ($f->attributes('Name'), $f->attributes('Alias'), $f->attributes('symbol')); 
    return $na[0] || $f->display_name;
    }


[blastndmel]
feature  = cross_genome_match:dmelchr
glyph    = segments
stranded     = 1
bgcolor  = lightslategray
fgcolor  = black
key      = D.mel chromosomes
citation = D.mel chromosomes
category = Genome features
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/dros_spp/?name='.$t;
    }
  my ($r)= $f->attributes('ID');
  if ($r) {
     $r=~s/\..*$//;
     return '/species/cgi-bin/gbrowse/dros_spp/?name='.$r;
     }
  }


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

[markers]
feature = match:marker:modDM
bgcolor  = green
glyph    = segments
stranded = 1
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;
    }


[blastdmic:overview]
##feature       =  nucleotide_match:blastn:drosmicsat
feature       =  match:blastn:drosmicsat
label         = 0
glyph         = generic
bgcolor       = lavender
height        = 5
key           = Microsatellites
bump  = 0
bump density  = 5
#overview label density = 160

[blastdmic]
# feature  = match:blastn:drosmicsat
feature  = nucleotide_match:blastn:drosmicsat
glyph    = segments
stranded     = 1
bgcolor  = lavender
fgcolor  = black
key      = Dros. microsatellites
citation = Dros. microsatellites
category = Analysis
label = sub { my $f = shift;
    my @na= ($f->attributes('Name'), $f->attributes('Alias'), $f->attributes('symbol'));
    return $na[0] || $f->display_name;
    }
link = sub {
  my($ac) = shift->attributes('ID'); $ac =~ s/[\.\|].*$//;
  return 'http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Search&db=Nucleotide&doptcmdl=GenBank&tool=GMOD&term='.$ac if ($ac);
  }

[tblastAG]
feature  = protein_match:tblastn:ensag
glyph    = segments
stranded     = 1
bgcolor  = lightslategray
fgcolor  = black
key      = Mosquito protein
citation = match:tblastn:ensAG
category = Analysis
label = sub { my $f = shift;
    my @na= ($f->attributes('Name'), $f->attributes('Alias'), $f->attributes('symbol')); 
    return $na[0] || $f->display_name;
    }
link = sub {
  my($ac) = shift->attributes('ID'); $ac =~ s/[\.\|].*$//;
  return 'http://www.ensembl.org/Anopheles_gambiae/protview?db=core;peptide='.$ac if($ac=~/ENS\w*P\d/);
  }

[tblastHS]
feature  = protein_match:tblastn:enshs
glyph    = segments
stranded     = 1
bgcolor  = lightslategray
fgcolor  = black
key      = Human protein
citation = match:tblastn:ensHS
category = Analysis
label = sub { my $f = shift;
    my @na= ($f->attributes('Name'), $f->attributes('Alias'), $f->attributes('symbol')); 
    return $na[0] || $f->display_name;
    }
link = sub {
  my($ac) = shift->attributes('ID'); $ac =~ s/[\.\|].*$//;
  return 'http://www.ensembl.org/Homo_sapiens/protview?db=core;peptide='.$ac if($ac=~/ENS\w*P\d/);
  }

[tblastCE]
feature  = protein_match:tblastn:modce
glyph    = segments
stranded     = 1
bgcolor  = lightslategray
fgcolor  = black
key      = C.elegans protein
citation = match:tblastn:modCE
category = Analysis
link = sub {
  my $f= shift; 
  my @d= ($f->attributes('ID'),$f->attributes('Name'),$f->primary_id());  
  if (@d){ return 'http://www.wormbase.org/db/get?name='.$d[0]; }
  }
label = sub { my $f = shift;
    my @na= ($f->attributes('Name'), $f->attributes('Alias'), $f->attributes('symbol')); 
    return $na[0] || $f->display_name;
    }

[tblastMM]
feature  = protein_match:tblastn:modmm
glyph    = segments
stranded     = 1
bgcolor  = lightslategray
fgcolor  = black
key      = Mouse protein
citation = match:tblastn:modMM
category = Analysis
link = sub {
  my $f= shift; 
  my @d= ($f->attributes('ID'),$f->primary_id());  
  if (@d){ return 'http://www.informatics.jax.org/searches/accession_report.cgi?id=' . $d[0]; }
  }
# http://www.informatics.jax.org/searches/accession_report.cgi?id=MGI:1915572
label = sub { my $f = shift;
    my @na= ($f->attributes('Name'), $f->attributes('Alias'), $f->attributes('symbol')); 
    return $na[0] || $f->display_name;
    }

[tblastDR]
feature  = protein_match:tblastn:ensdr
glyph    = segments
stranded     = 1
bgcolor  = lightslategray
fgcolor  = black
key      = Zebrafish protein
citation = match:tblastn:ensDR
category = Analysis
label = sub { my $f = shift;
    my @na= ($f->attributes('Name'), $f->attributes('Alias'), $f->attributes('symbol')); 
    return $na[0] || $f->display_name;
    }
link = sub {
  my($ac) = shift->attributes('ID'); $ac =~ s/[\.\|].*$//;
  return 'http://www.ensembl.org/Danio_rerio/protview?db=core;peptide='.$ac if($ac=~/ENS\w*P\d/);
  }

[tblastAM]
feature  = protein_match:tblastn:ensAM
glyph    = segments
stranded     = 1
bgcolor  = lightslategray
fgcolor  = black
key      = Bee protein
citation = match:tblastn:ensAM
category = Analysis
label = sub { my $f = shift;
    my @na= ($f->attributes('Name'), $f->attributes('Alias'), $f->attributes('symbol')); 
    return $na[0] || $f->display_name;
    }
link = sub {
  my($ac) = shift->attributes('ID'); $ac =~ s/[\.\|].*$//;
  return 'http://www.ensembl.org/Apis_mellifera/protview?db=core;peptide='.$ac if($ac=~/ENS\w*P\d/);
  }

[tblastAT]
feature  = protein_match:tblastn:ncbat
glyph    = segments
stranded     = 1
bgcolor  = lightslategray
fgcolor  = black
key      = Arabidopsis protein
citation = match:tblastn:ncbat
category = Analysis
label = sub { my $f = shift;
    my @na= ($f->attributes('Name'), $f->attributes('Alias'), $f->attributes('symbol')); 
    return $na[0] || $f->display_name;
    }


.
