AcePerl

 view release on metacpan or  search on metacpan

Ace/Browser/AceSubs.pm  view on Meta::CPAN

	}
	  push (@rows,td({-align=>'CENTER',-class=>'small'},$cell));
	}
    return table({-width=>'100%',-border=>0,-class=>'searchtitle'},
		 TR({-valign=>'bottom'},@rows));
}

=item $url = Url($display,$params)

Given a symbolic display name, such as "tree" and a set of parameters, 
this function looks up its URL and then calls ResolveUrl() to create a 
single Url.

When hard-coding relative URLs into AceBrowser scripts, it is
important to pass them through Url().  The reason for this is that
AceBrowser may need to attach the database name to the URL in order to
identify it.

Example:

  my $url = Url('../sequence_dump',"name=$name;long_dump=yes");

Ace/Graphics/Glyph.pm  view on Meta::CPAN

 @ISA = 'Ace::Graphics::Glyph';

Then override the methods you need to.  Typically, just the draw()
method will need to be overridden.  However, if you need additional
room in the glyph, you may override calculate_height(),
calculate_left() and calculate_right().  Do not directly override
height(), left() and right(), as their purpose is to cache the values
returned by their calculating cousins in order to avoid time-consuming
recalculation.

A simple draw() method looks like this:

 sub draw {
  my $self = shift;
  $self->SUPER::draw(@_);
  my $gd = shift;

  # and draw a cross through the box
  my ($x1,$y1,$x2,$y2) = $self->calculate_boundaries(@_);
  my $fg = $self->fgcolor;
  $gd->line($x1,$y1,$x2,$y2,$fg);

Ace/Graphics/Glyph/primers.pm  view on Meta::CPAN

package Ace::Graphics::Glyph::primers;
# package to use for drawing something that looks like
# primer pairs.

use strict;
use vars '@ISA';
@ISA = 'Ace::Graphics::Glyph';

use constant HEIGHT => 4;

# we do not need the default amount of room
sub calculate_height {

Ace/Sequence.pm  view on Meta::CPAN

  my $gff = shift;
  my $parent  = $self->parent;
  my $strand  = $self->{strand};
  my $source  = $self->source;
  my ($ref_source,$ref_offset,$ref_strand)  = $self->refseq;
  $ref_source ||= $source;
  $ref_strand ||= $strand;

  if ($ref_strand > 0) {
    my $o = defined($ref_offset) ? $ref_offset : ($self->p_offset + $self->offset);
    # find anything that looks like a numeric field and subtract offset from it
    $$gff =~ s/(?<!\")\s+(-?\d+)\s+(-?\d+)/"\t" . ($1 - $o) . "\t" . ($2 - $o)/eg;
    $$gff =~ s/^$parent/$source/mg;
    $$gff =~ s/\#\#sequence-region\s+\S+/##sequence-region $ref_source/m;
    $$gff =~ s/FMAP_FEATURES\s+"\S+"/FMAP_FEATURES "$ref_source"/m;
    return;
  } else {  # strand eq '-'
    my $o = defined($ref_offset) ? (2 + $ref_offset) : (2 + $self->p_offset - $self->offset);
    $$gff =~ s/(?<!\")\s+(-?\d+)\s+(-?\d+)\s+([.\d]+)\s+(\S)/join "\t",'',$o-$2,$o-$1,$3,$plusminus{$4}/eg;
    $$gff =~ s/(Target \"[^\"]+\" )(-?\d+) (-?\d+)/$1 $3 $2/g;
    $$gff =~ s/^$parent/$source/mg;

acebrowser/conf/default.pm  view on Meta::CPAN

# ========= &URL_MAPPER  =========
# mapping from object type to URL.  Return empty list to fall through
# to default.
sub URL_MAPPER {
  my ($display,$name,$class) = @_;

  # Small Ace inconsistency: Models named "#name" should be
  # transduced to Models named "?name"
  $name = "?$1" if $class eq 'Model' && $name=~/^\#(.*)/;

  my $n = CGI->escape("$name"); # looks superfluous, but avoids Ace::Object name conversions errors
  my $c = CGI->escape($class);

  # pictures remain pictures
  if ($display eq 'pic') {
    return ('pic' => "name=$n&class=$c");
  }
  # otherwise display it with a tree
  else {
    return ('tree' => "name=$n&class=$c");
  }

acebrowser/conf/simple.pm  view on Meta::CPAN

# ========= &URL_MAPPER  =========
# mapping from object type to URL.  Return empty list to fall through
# to default.
sub URL_MAPPER {
  my ($display,$name,$class) = @_;

  # Small Ace inconsistency: Models named "#name" should be
  # transduced to Models named "?name"
  $name = "?$1" if $class eq 'Model' && $name=~/^\#(.*)/;

  my $n = CGI::escape("$name"); # looks superfluous, but avoids Ace::Object name conversions errors
  my $c = CGI::escape($class);

  # pictures remain pictures
  if ($display eq 'pic') {
    return ('pic' => "name=$n&class=$c");
  } 
  # otherwise display it with a tree
  else {
    return ('tree' => "name=$n&class=$c");
  }

docs/ACE_SERVER_TRAPS.HOWTO  view on Meta::CPAN

   export DBDIR
   (PATH was already exported)
   
      Testing the Solution
      
   Use the echo command to make sure the environment variables are in
   place. We put our "contacts" database under /home/httpd because that
   directory is accessible to the web server. This is a requirement of
   AceBrowser, which we want to use as the primary interface.
   
   A test of the $ACEDB environment variable looks like this:
   echo $ACEDB (return)
   
   It returns this:
   /home/httpd/database/contacts/
   
      Consequences of the Solution
      
   The NOTES file distributed with this version of ACEDB advises you to
   move the acedb and textace scripts to /usr/local/bin, and using them
   to start the program. With your environment variables in place, you

docs/ACE_SERVER_TRAPS.HOWTO.html  view on Meta::CPAN


<p>ACEDB=[pathname to database]<br>
DBDIR=[pathname to database]/database/<br>
PATH=$PATH:[pathname to ace software directory]/bin<br>
export ACEDB<br>
export DBDIR<br>
(PATH was already exported)</p>

<p><h5>Testing the Solution</h5></p>
<p>Use the <em>echo</em> command to make sure the environment variables are in place.  We put our "contacts" database  under /home/httpd because that directory is accessible to the web server.  This is a requirement of AceBrowser, which we want to us...
<p>A test of the $ACEDB environment variable looks like this:<br>
<em>echo $ACEDB (return)</em></p>
<p>It returns this:<br>
<em>/home/httpd/database/contacts/</em></p>

<p><h5>Consequences of the Solution</h5></p>
<p>The <strong>NOTES</strong> file distributed with this version of ACEDB advises you to move the <em>acedb</em> and <em>textace</em> scripts to /usr/local/bin, and using them to start the program.  With your environment variables in place, you can s...

<p><h4>Permissions</h4></p>
<p>Take your permissions seriously.  Richard Durbin's Installation Guide is out of date, but gives good advice in this department.</p>



( run in 0.389 second using v1.01-cache-2.11-cpan-64827b87656 )