AcePerl

 view release on metacpan or  search on metacpan

Ace.pm  view on Meta::CPAN


use Data::Dumper;
use AutoLoader 'AUTOLOAD';
require Exporter;
use overload 
  '""'  => 'asString',
  'cmp' => 'cmp';

@ISA = qw(Exporter);

# Items to export into callers namespace by default.
@EXPORT = qw(STATUS_WAITING STATUS_PENDING STATUS_ERROR);

# Optional exports
@EXPORT_OK = qw(rearrange ACE_PARSE);
$VERSION = '1.92';

use constant STATUS_WAITING => 0;
use constant STATUS_PENDING => 1;
use constant STATUS_ERROR   => -1;
use constant ACE_PARSE      => 3;

Ace.pm  view on Meta::CPAN

require Ace::Object;
eval qq{use Ace::Freesubs};  # XS file, may not be available

# Map database names to objects (to fix file-caching issue)
my %NAME2DB;

# internal cache of objects
my %MEMORY_CACHE;

my %DEFAULT_CACHE_PARAMETERS = (
				default_expires_in  => '1 day',
				auto_purge_interval => '12 hours',
				);

# Preloaded methods go here.
$Error = '';

# Pseudonyms and deprecated methods.
*list      = \&fetch;
*Ace::ERR  = *Error;

Ace.pm  view on Meta::CPAN

frequently reused.  To activate this mechanism, the
Cache::SizeAwareFileCache module must be installed, and you must pass
the -cache argument during the connect() call.

The value of -cache is a hash reference containing the arguments to be
passed to Cache::SizeAwareFileCache.  For example:

   -cache => {
              cache_root         => '/usr/tmp/acedb',
              cache_depth        => 4,
              default_expires_in => '1 hour'
              }

If not otherwise specified, the following cache parameters are assumed:

       Parameter               Default Value
       ---------               -------------
       namespace               Server URL (e.g. sace://localhost:2005)
       cache_root              /tmp/FileCache (dependent on system temp directory)
       default_expires_in      1 day
       auto_purge_interval     12 hours

By default, the cache is not size limited (the "max_size" property is
set to $NO_MAX_SIZE).  To adjust the size you may consider calling the
Ace object's cache() method to retrieve the physical cache and then
calling the cache object's limit_size($max_size) method from time to
time.  See L<Cache::SizeAwareFileCache> for more details.

=item B<-program>

By default AcePerl will use its internal compiled code calls to
establish a connection to Ace servers, and will launch a I<tace>
subprocess to communicate with local Ace databases.  The B<-program>
argument allows you to customize this behavior by forcing AcePerl to
use a local program to communicate with the database.  This argument
should point to an executable on your system.  You may use either a
complete path or a bare command name, in which case the PATH
environment variable will be consulted.  For example, you could force
AcePerl to use the I<aceclient> program to connect to the remote host
by connecting this way:

  $db = Ace->connect(-host => 'beta.crbm.cnrs-mop.fr',
                     -port => 20000100,
                     -program=>'aceclient');

=item B<-classmapper>

The optional B<-classmapper> argument (alias B<-class>) points to the
class you would like to return from database queries.  It is provided
for your use if you subclass Ace::Object.  For example, if you have
created a subclass of Ace::Object called Ace::Object::Graphics, you
can have the database return this subclass by default by connecting
this way:

  $db = Ace->connect(-host => 'beta.crbm.cnrs-mop.fr',
                     -port => 20000100,
	             -class=>'Ace::Object::Graphics');

The value of B<-class> can be a hash reference consisting of AceDB
class names as keys and Perl class names as values.  If a class name
does not exist in the hash, a key named _DEFAULT_ will be looked for.
If that does not exist, then Ace will default to Ace::Object.

The value of B<-class> can also be an object or a classname that
implements a class_for() method.  This method will receive three
arguments containing the AceDB class name, object ID and database
handle.  It should return a string indicating the perl class to
create.

=item B<-timeout>

If no response from the server is received within $timeout seconds,

Ace.pm  view on Meta::CPAN

Apache/mod_perl.

=item B<-query_timeout>

If any query takes longer than $query_timeout seconds, will return an
undefined value.  This value can only be set at connect time, and cannot
be changed once set.

=back

If arguments are omitted, they will default to the following values:

    -host          localhost
    -port          200005;
    -path          no default
    -program       tace
    -class         Ace::Object
    -timeout       25
    -query_timeout 120

If you prefer to use a more Smalltalk-like message-passing syntax, you
can open a connection this way too:

  $db = connect Ace -host=>'beta.crbm.cnrs-mop.fr',-port=>20000100;

Ace.pm  view on Meta::CPAN

Protocols:

=over 4

=item sace://hostname:port

Connect to a socket server at the indicated hostname and port.  Example:

   sace://stein.cshl.org:1880

If not provided, the port defaults to 2005.

=item rpcace://hostname:port

Connect to an RPC server at the indicated hostname and RPC service number.  Example:

  rpcace://stein.cshl.org:400000

If not provided, the port defaults to 200005

=item tace:/path/to/database

Open up the local database at F</path/to/database> using tace.  Example:

  tace:/~acedb/elegans

=item /path/to/database

Same as the previous.

Ace.pm  view on Meta::CPAN

processing the request.  When this happens, undef or an empty list
will be returned, and a string describing the error can be retrieved
by calling Ace->error.

When retrieving database objects, it is possible to retrieve a
"filled" or an "unfilled" object.  A filled object contains the entire
contents of the object, including all tags and subtags.  In the case
of certain Sequence objects, this may be a significant amount of data.
Unfilled objects consist just of the object name.  They are filled in
from the database a little bit at a time as tags are requested.  By
default, fetch() returns the unfilled object.  This is usually a
performance win, but if you know in advance that you will be needing
the full contents of the retrieved object (for example, to display
them in a tree browser) it can be more efficient to fetch them in
filled mode. You do this by calling fetch() with the argument of
B<-fill> set to a true value.

The B<-filltag> argument, if provided, asks the database to fill in
the subtree anchored at the indicated tag.  This will improve
performance for frequently-accessed subtrees.  For example:

Ace.pm  view on Meta::CPAN


=head2 parse_file() method

  @objects = $db->parse_file('/path/to/file');
  @objects = $db->parse_file('/path/to/file',1);

This will call parse() to parse each of the objects found in the
indicated .ace file, returning the list of objects successfully loaded
into the database.

By default, parsing will stop at the first object that causes a parse
error.  If you wish to forge on after an error, pass a true value as
the second argument to this method.

Any parse error messages are accumulated in Ace->error().

=head2 new() method

  $object = $db->new($class => $name);

This method creates a new object in the database of type $class and

Ace.pm  view on Meta::CPAN

cannot be used again.  You can have multiple iterators open at once
and they will operate independently of each other.

Like B<fetch()>, B<fetch_many()> takes an optional B<-fill> (or
B<-filled>) argument which retrieves the entire object rather than
just its name.  This is efficient on a network with high latency if 
you expect to be touching many parts of the object (rather than
just retrieving the value of a few tags).

B<fetch_many()> retrieves objects from the database in groups of a
certain maximum size, 40 by default.  This can be tuned using the
optional B<-chunksize> argument.  Chunksize is only a hint to the
database.  It may return fewer objects per transaction, particularly
if the objects are large.

You may provide raw Ace query string with the B<-query> argument.  If
present the B<-name> and B<-class> arguments will be ignored.

=head2 find_many() method

This is an alias for fetch_many().  It is now deprecated.

Ace.pm  view on Meta::CPAN

This performs a "grep" on the database, returning all object names or
text that contain the indicated grep pattern.  In a scalar context
this call will return the number of matching objects.  In an array
context, the list of matching objects are retrieved.  There is also a
named-parameter form of the call, which allows you to specify the
number of objects to retrieve, the offset from the beginning of the
list to retrieve from, whether the retrieved objects should be filled
initially.  You can use B<-total> to discover the total number of
objects that match, while only retrieving a portion of the list.

By default, grep uses a fast search that only examines class names and
lexiques.  By providing a true value to the B<-long> parameter, you
can search inside LongText and other places that are not usually
touched on, at the expense of much more CPU time.

Due to "not listable" objects that may match during grep, the list of
objects one can retrieve may not always match the count.

=head2 model() method

  $model = $db->model('Author');

Ace.pm  view on Meta::CPAN

=head2 date_style() method

  $style = $db->date_style();
  $style = $db->date_style('ace');
  $style = $db->date_style('java');

For historical reasons, AceDB can display dates using either of two
different formats.  The first format, which I call "ace" style, puts
the year first, as in "1997-10-01".  The second format, which I call
"java" style, puts the day first, as in "01 Oct 1997 00:00:00" (this
is also the style recommended for Internet dates).  The default is to
use the latter notation.

B<date_style()> can be used to set or retrieve the current style.
Called with no arguments, it returns the current style, which will be
one of "ace" or "java."  Called with an argument, it will set the
style to one or the other.

=head2 timestamps() method

  $timestamps_on = $db->timestamps();

Ace.pm  view on Meta::CPAN

by calling the method with no arguments.

Note that activating timestamps disables some of the speed
optimizations in AcePerl.  Thus they should only be activated if you
really need the information.

=head2 auto_save()

Sets or queries the I<auto_save> variable.  If true, the "save"
command will be issued automatically before the connection to the
database is severed.  The default is true.

Examples:

   $db->auto_save(1);
   $flag = $db->auto_save;

=head2 error() method

    Ace->error;

Ace.pm  view on Meta::CPAN


  $datetime = Ace->datetime($time);
  $today    = Ace->datetime();
  $date     = Ace->date($time);
  $today    = Ace->date([$time]);

These convenience functions convert the UNIX timestamp given by $time
(seconds since the epoch) into a datetime string in the format that
ACEDB requires.  date() will truncate the time portion.

If not provided, $time defaults to localtime().

=head1 OTHER METHODS

=head2 debug()

  $debug_level = Ace->debug([$new_level])

This class method gets or sets the debug level.  Higher integers
increase verbosity.  0 or undef turns off debug messages.

Ace.pm  view on Meta::CPAN

strings to the server and to retrieve the results.  The class that
exports the low-level calls is named Ace::AceDB.

The following methods are available in Ace::AceDB:

=over 4

=item new($host,$port,$query_timeout)

Connect to the host $host at port $port. Queries will time out after
$query_timeout seconds.  If timeout is not specified, it defaults to
120 (two minutes).

If successful, this call returns an Ace::AceDB connection object.
Otherwise, it returns undef.  Example:

  $acedb = Ace::AceDB->new('localhost',200005,5) 
           || die "Couldn't connect";

The Ace::AceDB object can also be accessed from the high-level Ace
interface by calling the ACE::db() method:

Ace.pm  view on Meta::CPAN


  $acedb->query("find Sequence D*");
  die "Got an error ",$acedb->error() if $acedb->status == STATUS_ERROR;
  while ($acedb->status == STATUS_PENDING) {
     $result .= $acedb->read;
  }

=item status()

Return the status code from the last operation.  Status codes are
exported by default when you B<use> Ace.pm.  The status codes you may
see are:

  STATUS_WAITING    The server is waiting for a query.
  STATUS_PENDING    A query has been sent and Ace is waiting for
                    you to read() the result.
  STATUS_ERROR      A communications or syntax error has occurred

=item error()

Returns a more detailed error code supplied by the Ace server.  Check
this value when STATUS_ERROR has been returned.  These constants are
also exported by default.  Possible values:

 ACE_INVALID
 ACE_OUTOFCONTEXT
 ACE_SYNTAXERROR
 ACE_UNRECOGNIZED

Please see the ace client library documentation for a full description
of these error codes and their significance.

=item encore()

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

  PrintTop($obj);
  print $obj->asHTML;
  PrintBottom();

=head1 DESCRIPTION

Ace::Browser::AceSubs exports a set of routines that are useful for
creating search pages and displays for AceBrowser CGI pages. See
http://stein.cshl.org/AcePerl/AceBrowser.

The following subroutines are exported by default:

  AceError
  AceMissing
  AceNotFound
  Configuration
  DoRedirect
  GetAceObject
  Object2URL
  ObjectLink
  OpenDatabase

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

  AceMultipleChoices
  AceRedirect
  DB_Name
  Footer
  Header
  ResolveUrl
  Style
  Toggle
  TypeSelector

To load the default subroutines load the module with:

   use Ace::Browser::AceSubs;

To bring in a set of optionally routines, load the module with:

   use Ace::Browser::AceSubs qw(AceInit AceRedirect);

To bring in all the default subroutines, plus some of the optional
ones:

   use Ace::Browser::AceSubs qw(:DEFAULT AceInit AceRedirect);

There are two main types of AceBrowser scripts:

=over 4

=item display scripts

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

######################### This is the list of exported subroutines #######################
@EXPORT = qw(
	     GetAceObject AceError AceNotFound AceMissing DoRedirect
	     OpenDatabase Object2URL Url
	     ObjectLink Configuration PrintTop PrintBottom);
@EXPORT_OK = qw(AceRedirect Toggle ResolveUrl AceInit AceAddCookie
		AceHeader TypeSelector Style AcePicRoot
		Header Footer DB_Name AceMultipleChoices);
%EXPORT_TAGS = ( );

use constant DEFAULT_DATABASE  => 'default';
use constant PRIVACY           => 'misc/privacy';  # privacy/cookie statement
use constant SEARCH_BROWSE     => 'search';   # a fallback search script
my %VALID;  # cache for get_symbolic() lookups

=item AceError($message)

This subroutine will print out an error message and exit the script.
The text of the message is taken from $message.

=cut

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

    PrintTop(undef,undef,'Error');
    print CGI::font({-color=>'red'},$msg);
    PrintBottom();
    Apache->exit(0) if defined &Apache::exit;
    exit(0);
}

=item AceHeader()

This function prints the HTTP header and issues a number of cookies
used for maintaining AceBrowser state.  It is not exported by default.

=cut

=item AceAddCookie(@cookies)

This subroutine, which must be called b<after> OpenDatabase() and/or
GetAceObject() and b<before> PrintTop(), will add one or more cookies
to the outgoing HTTP headers that are emitted by AceHeader().  
Cookies must be CGI::Cookie objects.

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

  print @COOKIES ? header(-cookie=>\@COOKIES,@_) : header(@_);

  @COOKIES = ();
  $HEADER++;
}

=item AceInit()

This subroutine initializes the AcePerl connection to the configured
database.  If the database cannot be opened, it generates an error
message and exits.  This subroutine is not exported by default, but is 
called by PrintTop() and Header() internally.

=cut

# Subroutines used by all scripts.
# Will generate an HTTP 'document not found' error if you try to get an 
# undefined database name.  Check the return code from this function and
# return immediately if not true (actually, not needed because we exit).
sub AceInit   {
  $HEADER   = 0;

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


   $symbol   The keyword or query string the user was searching
             on, undef if none.

   $report   The symbolic name of the current display, or undef
	     if none.

   $objects  An array reference containing the Ace objects in
	     question.

This subroutine is not exported by default.

=cut

sub AceMultipleChoices {
  my ($symbol,$report,$objects) = @_;
  if ($objects && @$objects == 1) {
    my $destination = Object2URL($objects->[0]);
    AceHeader(-Refresh => "1; URL=$destination");
    print start_html (
			   '-Title' => 'Redirect',

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

	       strong("The $class named \"$name\" is not found in the database.")));
  PrintBottom();
  Apache->exit(0) if defined &Apache::exit;
  exit(0);
}

=item ($uri,$physical_path) = AcePicRoot($directory)

This function returns the physical and URL paths of a temporary
directory in which the pic script can write pictures.  Not exported by
default.  Returns a two-element list containing the URL and physical
path.

=cut

sub AcePicRoot {
  my $path = shift;
  my $umask = umask();
  umask 002;  # want this writable by group
  my ($picroot,$uri);
  if ($ENV{MOD_PERL} && Apache->can('request')) { # we have apache, so no reason not to take advantage of it

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


  $obj = GetAceObject();
  if ($obj->CDS) {
    my $protein	= $obj->Corresponding_protein;
    AceRedirect('protein',$protein);
  }

AceRedirect must be called b<before> PrintTop() or  AceHeader().  It
invokes exit(), so it will not return.

This subroutine is not exported by default.  It differs from
DoRedirect() in that it displays a message to the user for two seconds
before it generates the new page. It also allows the display to be set
explicitly, rather than determined automatically by the AceBrowser
system.

=cut

###############  redirect to a different report #####################
sub AceRedirect {
  my ($report,$object) = @_;

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


# get the configuration object for this database
sub Configuration {
  my $s = get_symbolic()||return;
  return Ace::Browser::SiteDefs->getConfig($s);
}

=item $name = DB_Name()

This function returns the symbolic name of the current database, for
example "default".

=cut

*DB_Name = \&get_symbolic;

=item DoRedirect($object)

This subroutine immediately redirects to the default display for the
Ace::Object indicated by $object and exits the script.  It must be
called before PrintTop() or any other HTML-generating code.  It
differs from AceRedirect() in that it generates a fast redirect
without alerting the user.

This function is not exported by default.

=cut

# redirect to the URL responsible for an object
sub DoRedirect {
    my $obj = shift;
    print redirect(Object2URL($obj));
    Apache->exit(0) if defined &Apache::exit;
    exit(0);
}

=item $footer = Footer()

This function returns the contents of the footer as a string, but does 
not print it out.  It is not exported by default.

=cut

# Contents of the HTML footer.  It gets printed immediately before the </BODY> tag.
# The one given here generates a link to the "feedback" page, as well as to the
# privacy statement.  You may or may not want these features.
sub Footer {
  if (my $footer = Configuration()->Footer) {
    return $footer;
  }

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

    AceMultipleChoices($name,'',\@objs);
    Apache->exit(0) if defined &Apache::exit;
    exit(0);
  }
  return $objs[0];
}

=item $html = Header()

This subroutine returns the boilerplate at the top of the HTML page as 
a string, but does not print it out.  It is not exported by default.

=cut

sub Header {
  my $config = Configuration();
  my $dbname = get_symbolic();

  return unless my $searches = $config->Searches;
  my $banner                 = $config->Banner;

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

  my @targ = $target ? (-target=>$target) : ();
  return a({-href=>Object2URL($object,@_),-name=>"$object",@targ},($link_text || "$object"));
}

=item $db = OpenDatabase()

This function opens the Acedb database designated by the configuration
file.  In modperl environments, this function caches database handles
and reuses them, pinging and reopening them in the case of timeouts.

This function is not exported by default.

=cut

use Carp 'cluck';

################ open a database #################
sub OpenDatabase {
  my $name = shift || get_symbolic();
  AceInit();
  $name =~ s!/$!!;
  my $db = $DB{$name};
  return $db if $db && $db->ping;

  my ($host,$port,$user,$password,
      $cache_root,$cache_size,$cache_expires,$auto_purge_interval)
    = getDatabasePorts($name);
  my @auth  = (-user=>$user,-pass=>$password) if $user && $password;
  my @cache = (-cache => { cache_root=>$cache_root,
			   max_size            => $cache_size || $Cache::SizeAwareCache::NO_MAX_SIZE || -1,  # hardcoded $NO_MAX_SIZE constant
			   default_expires_in  => $cache_expires       || '1 day',
			   auto_purge_interval => $auto_purge_interval || '6 hours',
			 } 
	      ) if $cache_root;
  $DB{$name} = Ace->connect(-host=>$host,-port=>$port,-timeout=>50,@auth,@cache);
  return $DB{$name};
}

=item PrintTop($object,$class,$title,@html_headers)

The PrintTop() function generates all the boilerplate at the top of a

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

configured stylesheet, in the following format:

  { -src => '/ace/stylesheets/current_stylesheet.css' }

This hash is suitable for passing to the -style argument of CGI.pm's
start_html() function, or for use as an additional header in
PrintTop().  You may add locally-defined stylesheet elements to the
hash before calling start_html().  See the pic script for an example
of how this is done this.

This function is not exported by default.

=cut

=item $url = ResolveUrl($url,$param)

Given a URL and a set of parameters, this function does the necessary
magic to add the symbolic database name to the end of the URL (if
needed) and then tack the parameters onto the end.

A typical call is:

  $url = ResolveUrl('/cgi-bin/ace/generic/tree','name=fred;class=Author');

This function is not exported by default.

=cut

sub ResolveUrl {
    my ($url,$param) = @_;
    my ($main,$query,$frag) = $url =~ /^([^?\#]+)\??([^\#]*)\#?(.*)$/ if defined $url;
    $main ||= '';
    
    if (!defined $APACHE_CONF) {
      $APACHE_CONF = eval { Apache->request->dir_config('AceBrowserConf') } ? 1 : 0;

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

      print $link,br;
      return $OPEN{$section};
    }
}

=item $html = TypeSelector($name,$class)

This subroutine generates the HTML for the type selector navigation
bar.  The links in the bar are dynamically generated based on the
values of $name and $class.  This function is called by PrintTop().
It is not exported by default.

=cut

# Choose a set of displayers based on the type.
sub TypeSelector {
    my ($name,$class) = @_;
    return unless $class;

    my ($n,$c) = (escape("$name"),escape($class));
    my @rows;

    # add the special displays
    my @displays       = Configuration()->class2displays($class,$name);
    my @basic_displays = Configuration()->class2displays('default');
    @basic_displays    = Ace::Browser::SiteDefs->getConfig(DEFAULT_DATABASE)->class2displays('default') 
      unless @basic_displays;

    my $display = url(-absolute=>1,-path=>1);

    foreach (@displays,@basic_displays) {
 	my ($url,$icon,$label) = @{$_}{qw/url icon label/};
	next unless $url;
	my $u = ResolveUrl($url,"name=$n;class=$c");
	($url = $u) =~ s/[?\#].*$//;

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

    }
  }

  # otherwise, the hard way
  (my $name = path_info())=~s!^/!!;
  return $name if defined $name && $name ne '';  # get from additional path info
  my $path = url(-absolute=>1);
  return $VALID{$path} if exists $VALID{$path};
  my @path = split '/',$path;
  pop @path;
  for my $name ((reverse @path),'default') {
    next unless $name;
    return $VALID{$path} if exists $VALID{$name};
    return $VALID{$path} = $name if Ace::Browser::SiteDefs->getConfig($name);
    $VALID{$path} = undef;
  }
  return;
}

1;
__END__

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

  foreach (param()) {
    push(@hidden,hidden(-name=>$_,-value=>[param($_)]));
  }

  push(@buttons,
       td({-valign=>'MIDDLE',-align=>'CENTER'},
	  start_form({-name=>'form1'}),
	  submit(-name=>'Go',-label=>'Go to'),
	  'page',
	  popup_menu(-name=>'scroll',-Values=>\@v,-labels=>\%v,
		     -default=>($page-1)*MAXOBJECTS-$offset,
		     -override=>1,
		     -onChange=>'document.form1.submit()'),
	  "of $pages",
	  @hidden,
	  end_form()
	 )
      );

  push(@buttons,td({-align=>'LEFT',-valign=>'MIDDLE'},
		   $offset + MAXOBJECTS <= $count 

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

  }
  return $CACHETIME{$name};
}

sub AUTOLOAD {
    my($pack,$func_name) = $AUTOLOAD=~/(.+)::([^:]+)$/;
    my $self = shift;
    croak "Unknown field \"$func_name\"" unless $func_name =~ /^[A-Z]/;
    return $self->{$func_name} = $_[0] if defined $_[0];
    return $self->{$func_name} if defined $self->{$func_name};
    # didn't find it, so get default
    return if (my $dflt = $pack->getConfig('default')) == $self;
    return $dflt->{$func_name};
}

sub DESTROY { }

sub map_url {
  my $self = shift;
  my ($display,$name,$class) = @_;
  $class ||= $name->class if ref($name) and $name->can('class');

  my (@result,$url);

  if (my $code = $self->Url_mapper) {
    if (@result = $code->($display,$name,$class)) {
      return @result;
    }
  }

  # if we get here, then take the first display
  my @displays = $self->displays($class,$name);
  push @displays,$self->displays('default') unless @displays;
  my $n = CGI::escape($name);
  my $c = CGI::escape($class);
  return ($displays[0],"name=$n;class=$c") if $displays[0];

  return unless @result = $self->getConfig('default')->Url_mapper->($display,$name,$class);
  return unless $url = $self->display($result[0],'url');
  return ($url,$result[1]);
}

sub searches {
  my $self = shift;
  return unless my $s = $self->Searches;
  return @{$s} unless defined $_[0];
  return $self->Search_titles->{$_[0]};
}

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 {
  my $self = shift;
  return $self->option('label') ? HEIGHT + $self->labelheight + 2 : HEIGHT;
}

# override draw method
sub draw {
  my $self = shift;
  my $gd = shift;
  my ($x1,$y1,$x2,$y2) = $self->calculate_boundaries(@_);

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

  See L<Ace::Graphics::Panel> and L<Ace::Graphics::Glyph>.

=head1 DESCRIPTION

This glyph draws a series of filled rectangles connected by up-angled
connectors or "hats".  The rectangles indicate exons; the hats are
introns.  The direction of transcription is indicated by a small arrow
at the end of the glyph, rightward for the + strand.

The feature must respond to the exons() and optionally introns()
methods, or it will default to the generic display.  Implied introns
(not returned by the introns() method) are drawn in a contrasting
color to explicit introns.

=head2 OPTIONS

In addition to the common options, the following glyph-specific
option is recognized:

  Option                Description                    Default
  ------                -----------                    -------

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

  toomany     A "cloud", to indicate too many features to show
	      individually.  This is a placeholder that will be
	      replaced by something more clever, such as a histogram
	      or density plot.

  group	      A group of related features connected by a dashed line.
	      This is used internally by the Track class and should
	      not be called explicitly.

If the glyph name is omitted from add_track(), the "box" glyph will be
used by default.

The @options array is a list of name/value pairs that control the
attributes of the track.  The options are in turn passed to the
glyphs.  Each glyph has its own specialized subset of options, but
some are shared by all glyphs:

  Option      Description               Default
  ------      -----------               -------

  -glyph      Glyph to use              none

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


The background color is used for the background color of the track
itself.  The foreground color controls the color of lines and strings.
The interior color is used for filled objects such as boxes.

The -label argument controls whether or not the ID of the feature
should be printed next to the feature.  It is accepted by most, but
not all of the glyphs.

The -bump argument controls what happens when glyphs collide.  By
default, they will simply overlap (value 0).  A -bump value of +1 will
cause overlapping glyphs to bump downwards until there is room for
them.  A -bump value of -1 will cause overlapping glyphs to bump
upwards.

The -key argument declares that the track is to be shown in a key
appended to the bottom of the image.  The key contains a picture of a
glyph and a label describing what the glyph means.  The label is
specified in the argument to -key.

If present, the -glyph argument overrides the glyph given in the first

Ace/Iterator.pm  view on Meta::CPAN

If true, then retrieve complete objects from the database, rather than
empty object stubs.  Retrieving filled objects uses more memory and
network bandwidth than retrieving unfilled objects, but it's
recommended if you know in advance that you will be accessing most or
all of the objects' fields, for example, for the purposes of
displaying the objects.

=item -chunksize

The iterator will fetch objects from the database in chunks controlled
by this argument.  The default is 40.  You may want to tune the
chunksize to optimize the retrieval for your application.

=back

=head2 next() method

  $object = $iterator->next;

This method retrieves the next object from the query, performing
whatever database accesses it needs.  After the last object has been

Ace/Local.pm  view on Meta::CPAN

  }

=head2 low_read()

Read whatever data's available, or undef if none.  This is only used
by the ace.pl replacement for giface/tace.

=head2 status()

Return the status code from the last operation.  Status codes are
exported by default when you B<use> Ace.pm.  The status codes you may
see are:

  STATUS_WAITING    The server is waiting for a query.
  STATUS_PENDING    A query has been sent and Ace is waiting for
                    you to read() the result.
  STATUS_ERROR      A communications or syntax error has occurred

=head2 error()

May return a more detailed error code supplied by Ace.  Error checking

Ace/Local.pm  view on Meta::CPAN

B<encore()> is functionally equivalent to:

   $encore = $accessor->status == STATUS_PENDING;

In fact, this is how it's implemented.

=head2 auto_save()

Sets or queries the I<auto_save> variable.  If true, the "save"
command will be issued automatically before the connection to the
database is severed.  The default is true.

Examples:

   $accessor->auto_save(1);
   $flag = $accessor->auto_save;

=head1 SEE ALSO

L<Ace>, L<Ace::Object>, L<Ace::Iterator>, L<Ace::Model>

Ace/Object.pm  view on Meta::CPAN

coordinates of a single mouse click.  There is currently no way to
pass information about middle or right mouse clicks, dragging
operations, or keystrokes.  You may also specify a B<-dimensions> to
control the width and height of the returned GIF.  Since there is no
way of obtaining the preferred size of the image in advance, this is
not usually useful.

The optional B<-display> argument allows you to specify an alternate
display for the object.  For example, Clones can be displayed either
with the PMAP display or with the TREE display.  If not specified, the
default display is used.

The optional B<-view> argument allows you to specify an alternative
view for MAP objects only.  If not specified, you'll get the default
view.

The option B<-coords> argument allows you to provide the top and
bottom of the display for MAP objects only.  These coordinates are in
the map's native coordinate system (cM, bp).  By default, AceDB will
show most (but not necessarily all) of the map according to xace's
display rules.  If you call this method with the B<-getcoords>
argument and a true value, it will return a two-element array
containing the coordinates of the top and bottom of the map.

asGIF() returns a two-element array.  The first element is the GIF
data.  The second element is an array reference that indicates special 
areas of the image called "boxes."  Boxes are rectangular areas that
surround buttons, and certain displayed objects.  Using the contents
of the boxes array, you can turn the GIF image into a client-side

Ace/Object.pm  view on Meta::CPAN


=head2 factory() method

WARNING - THIS IS DEFUNCT AND NO LONGER WORKS.  USE THE Ace->class() METHOD INSTEAD

    $package = $object->factory;

When a root Ace object instantiates its tree of tags and values, it
creates a hierarchical structure of Ace::Object objects.  The
factory() method determines what class to bless these subsidiary
objects into.  By default, they are Ace::Object objects, but you can
override this method in a child class in order to create more
specialized Ace::Object classes.  The method should return a string
corresponding to the package to bless the object into.  It receives
the current Ace::Object as its first argument.

=head2 debug() method

    $object->debug(1);

Change the debugging mode.  A zero turns off debugging messages.

Ace/Object.pm  view on Meta::CPAN


# AUTOLOADED METHODS GO HERE

### Return the pretty-printed HTML table representation ###
### may pass a code reference to add additional formatting to cells ###
sub asHTML {
    my $self = shift;
    my ($modify_code) = rearrange(['MODIFY'],@_);
    return unless defined($self->right);
    my $string = "<TABLE BORDER>\n<TR ALIGN=LEFT VALIGN=TOP><TH>$self</TH>";
    $modify_code = \&_default_makeHTML unless $modify_code;
    $self->right->_asHTML(\$string,1,2,$modify_code);
    $string .= "</TR>\n</TABLE>\n";
    return $string;
}

### Get the FASTA-format DNA/Peptide representation for this object ###
### (if appropriate) ###
sub asDNA {
  return shift()->_special_dump('dna');
}

Ace/Object.pm  view on Meta::CPAN

	$$out .= "\n" . "\t" x $level unless $self->down && !defined($self->right);
      }
      $level = $self->right->_asTable($out,$level,$level+1)
	if defined $self->right;
      $$out .= "\n" if defined($self = $self->down);
      $position = 0;
    } while defined $self;
    return --$level;
}

# This is the default code that will be called during construction of
# the HTML table.  It returns a two-member list consisting of the modified
# entry and (optionally) a true value if we are to prune here.  The returned string
# will be placed inside a <TD></TD> tag.  There's nothing you can do about that.
sub _default_makeHTML {
  my $self = shift;
  my ($string,$prune) = ("$self",0);
  return ($string,$prune) unless $self->isObject || $self->isTag;

  if ($self->isTag) {
    $string = "<B>$self</B>";
  } elsif ($self->isComment) {
    $string = "<I>$self</I>";
  }  else {
    $string = qq{<FONT COLOR="blue">$self</FONT>} ;

Ace/Sequence.pm  view on Meta::CPAN


Ordinarily the feature entries in the GFF file will be returned in
coordinates relative to the start of the I<Ace::Sequence> object.
Position 1 will be the start of the sequence object, and the "+"
strand will be the sequence object's natural orientation.  However if
a true value is provided to B<-abs>, the coordinate system used will
be relative to the start of the source sequence, i.e. the native ACeDB
Sequence object (usually a cosmid sequence or a link).  

If a reference sequence was provided when the I<Ace::Sequence> was
created, it will be used by default to set the coordinate system.
Relative coordinates can be reenabled by providing a false value to
B<-abs>.  

Ordinarily the coordinate system manipulations automatically "do what
you want" and you will not need to adjust them.  See also the abs()
method described below.

=item -features

The B<-features> argument filters the features according to a list of

Ace/Sequence.pm  view on Meta::CPAN

a fatal error.

=head2 absolute()

 $abs = $seq->absolute;
 $abs = $seq->absolute(1);

This method controls whether the coordinates of features are returned
in absolute or relative coordinates.  "Absolute" coordinates are
relative to the underlying source or reference sequence.  "Relative"
coordinates are relative to the I<Ace::Sequence> object.  By default,
coordinates are relative unless new() was provided with a reference
sequence.  This default can be examined and changed using absolute().

=head2 automerge()

  $merge = $seq->automerge;
  $seq->automerge(0);

This method controls whether groups of features will automatically be
merged together by the features() call.  If true (the default), then
the left and right end of clones will be merged into "clone" features,
introns, exons and CDS entries will be merged into
Ace::Sequence::Transcript objects, and similarity entries will be
merged into Ace::Sequence::GappedAlignment objects.

=head2 db()

  $db = $seq->db;

Returns the L<Ace> database accessor associated with this sequence.

Ace/Sequence/GappedAlignment.pm  view on Meta::CPAN

  @segments = $gene->segments;

Return a list of Ace::Sequence::Feature objects corresponding to
similar segments.

=item relative()

  $relative = $gene->relative;
  $gene->relative(1);

This turns on and off relative coordinates.  By default, the exons and
intron features will be returned in the coordinate system used by the
gene.  If relative() is set to a true value, then coordinates will be
expressed as relative to the start of the gene.  The first exon will
(usually) be 1.

=head1 SEE ALSO

L<Ace>, L<Ace::Object>, L<Ace::Sequence>,L<Ace::Sequence::Homol>,
L<Ace::Sequence::Feature>, L<Ace::Sequence::FeatureList>, L<GFF>

Ace/Sequence/Gene.pm  view on Meta::CPAN

  @cds = $gene->cds;

Return a list of Ace::Sequence::Feature objects corresponding to
coding sequence.  THIS IS NOT YET IMPLEMENTED.

=item relative()

  $relative = $gene->relative;
  $gene->relative(1);

This turns on and off relative coordinates.  By default, the exons and
intron features will be returned in the coordinate system used by the
gene.  If relative() is set to a true value, then coordinates will be
expressed as relative to the start of the gene.  The first exon will
(usually) be 1.

=head1 SEE ALSO

L<Ace>, L<Ace::Object>, L<Ace::Sequence>,L<Ace::Sequence::Homol>,
L<Ace::Sequence::Feature>, L<Ace::Sequence::FeatureList>, L<GFF>

Ace/Sequence/Transcript.pm  view on Meta::CPAN

  @cds = $gene->cds;

Return a list of Ace::Sequence::Feature objects corresponding to
coding sequence.  THIS IS NOT YET IMPLEMENTED.

=item relative()

  $relative = $gene->relative;
  $gene->relative(1);

This turns on and off relative coordinates.  By default, the exons and
intron features will be returned in the coordinate system used by the
gene.  If relative() is set to a true value, then coordinates will be
expressed as relative to the start of the gene.  The first exon will
(usually) be 1.

=head1 SEE ALSO

L<Ace>, L<Ace::Object>, L<Ace::Sequence>,L<Ace::Sequence::Homol>,
L<Ace::Sequence::Feature>, L<Ace::Sequence::FeatureList>, L<GFF>

ChangeLog  view on Meta::CPAN

1.67	9/5/2000
	1. Many updates to support socket server.
	2. find_many() will now be much faster for complex queries.
	3. Single-argument shortcut form for connect()
	4. The Ace->find_many() and Ace->models() methods, formerly deprecated,
		are now no longer supported.
	
1.62	5/18/2000
	1. **NOTE** Redid the automatic accessors.  There is now always an implicit 
	move to the *right* of a tag when you fetch it as a method.  Use
	$object->Tag(0) to get the old default behavior.  Be warned, you used to
	have to do this to get to the object to the right of the Sequence tag
		$sequence = $clone->Sequence->right
	You now only have to do this:
		$sequence = $clone->Sequence
	2. Removed some uninitialized variable warnings from Ace::Sequence
1.60	11/01/99
	1. Fixed suspended giface processes when using iterators.
	2. Added explicit close() method.
1.59	9/8/99
	1. Patches to Ace::Local & Ace::Object from Tim Cutts <tim.cutts@incyte.com> 

ChangeLog  view on Meta::CPAN

	tag[2] semantics.

	5. fetch() now takes an optional tag argument which will be followed
	prior to fetching from the database.  $obj->fetch('Laboratory') will
	return the Laboratory object.

	6. tace can be used to access local databases, by passing a -path
 	argument to the Ace::connect() method.

	7. dates are displayed in Java style (3 March 1998 hh:mm:ss) by 
	default.  This can be altered with a call to Ace::date_style().

	8. Default port has changed to 23456

1.34    5/20/98 Fixed bug in Ace.xs caused by 1.33 change!  Only some objects
	were retrieved by fetch().

1.33    5/19/98 Fixed bug in Ace.xs that caused client to crash on "quit" query.

1.01	3/20/98 Fixed bug in _appendToTable() routine that caused asHTML to hang.

MANIFEST  view on Meta::CPAN

acebrowser/cgi-bin/generic/tree
acebrowser/cgi-bin/generic/xml
acebrowser/cgi-bin/misc/feedback
acebrowser/cgi-bin/misc/privacy
acebrowser/cgi-bin/moviedb/movie
acebrowser/cgi-bin/moviedb/person
acebrowser/cgi-bin/searches/basic
acebrowser/cgi-bin/searches/browser
acebrowser/cgi-bin/searches/query
acebrowser/cgi-bin/searches/text
acebrowser/conf/default.pm
acebrowser/conf/elegans.pm
acebrowser/conf/moviedb.pm
acebrowser/conf/simple.pm
acebrowser/htdocs/ico/a_down.gif
acebrowser/htdocs/ico/a_up.gif
acebrowser/htdocs/ico/a_world.gif
acebrowser/htdocs/ico/a_zoomin.gif
acebrowser/htdocs/ico/a_zoomout.gif
acebrowser/htdocs/ico/arrows/cylarrw.gif
acebrowser/htdocs/ico/arrows/cyrarrw.gif

Makefile.PL  view on Meta::CPAN

		  "\nWhat do you want to build?\n\n" .
		  "  1) Interface to Ace socket server and local databases (pure Perl)\n" .
		  "  2) The above plus XS optimizations (requires C compiler)\n" .
		  "  3) The above plus RPC server interface (requires C compiler)\n\n" .
		  "Enter your choice: ", "1");
  if ($reply =~ /(\d+)/) {
    $choice = $1;
    die "invalid choice: $choice!" if $choice < 1  ||  $choice > 3;
  }
}
$choice ||= 1; # safe default


my @extlib = ();
push @extlib,'Freesubs' if $choice >= 2;
push @extlib,'RPC'      if $choice >= 3;

print "\n";
setup_sitedefs() if prompt("Do you want to install Ace::Browser? ","n") =~ /[yY]/;

my $headers  = "./acelib/wh";

Makefile.PL  view on Meta::CPAN

	      'clean'        => {'FILES' => 'acelib/lib* acelib/*.o acelib/rpcace*.[ch]'},
);

exit 0;

sub setup_sitedefs {
  my ($conf_path,$cgi_path,$html_path);
  eval 'use Ace::Browser::LocalSiteDefs qw($SITE_DEFS $CGI_PATH $HTML_PATH)';
  if ($SITE_DEFS) {
    print "\n";
    print "You have installed Ace::Browser before, using old settings for defaults.\n";
    $conf_path = $SITE_DEFS;
    $cgi_path  = $CGI_PATH;
    $html_path = $HTML_PATH;
  }
  $conf_path ||= '/usr/local/apache/conf/ace';
  $cgi_path  ||= '/usr/local/apache/cgi-bin/ace';
  $html_path ||= '/usr/local/apache/htdocs/ace';

  get_path("site-specific configuration files",\$conf_path);
  get_path("acebrowser CGI scripts",\$cgi_path);

README  view on Meta::CPAN


4. make

   This will build the ACEDB client library, libaceperl.a, in the ace
   subdirectory.  It will then link in the Perl client subs.

5. make test (optional)

   You may "make test" to test the system.  It will attempt to open a
   connection to a database at beta.crbm.cnrs-mop.fr:20000100.  You may
   change these defaults by setting the environment variables ACEDB_HOST
   and ACEDB_PORT, or by defining them on the command line, as in:

    make test ACEDB_HOST=localhost ACEDB_PORT=200005

   However, since some of the tests are dependent on specific values in
   the database, this may cause some tests to fail.  Do not be alarmed if
   a handful of tests fail.  Do be alarmed if all of the tests fail.

  6. make install

  This will install AcePerl into your perl5 library directory.

  You may need to be root (superuser) in order to "make install".  This
  is because Perl will want to install the newly-built files into its
  library tree, /usr/local/lib/perl5/site_perl (or something similar),
  and this tree is usually not writable by mere mortals.  Do not
  despair: see the next section.

INSTALLING ACEPERL IN A NON-STANDARD LOCATION

By default, Perl will install AcePerl's library files within the
site-specific subdirectory of its library tree, usually
/usr/local/lib/perl5/site_perl.  If you wish, you can install the
library files elsewhere.

Simply change to the AcePerl distribution directory and run the
Makefile.PL script with the INSTALLSITELIB switch set to the full path 
of the directory you want to install into:

  perl Makefile.PL INSTALLSITELIB=/path/to/library

README.ACEBROWSER  view on Meta::CPAN

The install script will attempt to create any directories that do not
already exist.

  a. Site-specific configuration file directory

	Acebrowser needs access to one or more configuration files.
	Each file describes a data source and how information from
	the data source is to be rendered.  All configuration files
	are stored in a directory at the location indicated here.

	The default is /usr/local/apache/conf/ace/.

  b. Acebrowser CGI script directory

        The core of Acebrowser is a set of CGI scripts.  This is the
	directory that will contain them.  Choose a directory that will
	be recognized by the web server as containing CGI script.  If
	you are using Apache/mod_perl, select a directory under the 
	control of Apache::Registry.

        The default is /usr/local/apache/cgi-bin/ace/

  c. Acebrowser HTML files and images

	Acebrowser uses a small number of static HTML files and images.
	This is the directory that will contain them.  Choose a directory
	that is located under the web server's document root.

	The default is /usr/local/apache/htdocs/ace/

Depending on the permissions of your web server directories, you may
have to be root in order to create some of these directories.

4. Run "make", "make test" and "make install" as described in the main
README.  If this is successful, run "make install-browser".  This will
copy the acebrowser files into the directories chosen in step (3).
Depending on the permissions of your web server directories, you may
have to be root in order to complete this step.

5. If you installed the CGI scripts in their default location, you
should now be able to search the C. elegans database by fetching the
following URL:

	http://your.host/cgi-bin/ace/searches/text

You can then follow the links to browse the database.  A slightly more 
sophisticated search allows you to search a subset of object classes:

        http://your.host/cgi-bin/ace/searches/basic

or the entire list of object classes:

        http://your.host/cgi-bin/ace/searches/browser

There is also a default Acebrowser "home page" installed at the URL:

	http://your.host/ace/index.html

You may have to adjust these URLs for the locations of the directories
chosen in step (3).

CONFIGURATION

Acebrowser is configured to allow access to multiple ACEDB databases.
You can customize each database extensively by changing the appearance

README.ACEBROWSER  view on Meta::CPAN

to a configuration file located in the site-specific configuration
directory.  There are three databases defined in a new Acebrowser
installation: 

  simple   An acedb database running on port 2005 of the 
	   local host

  moviedb  An example database of movies running on port 200008 
	   of stein.cshl.org

  default  An oldish snapshot of the C. elegans database running
	   on port 2005 of stein.cshl.org

To select among the data sources, append the symbolic name to the end
of the URL of the desired CGI script.  For example, to do a text
search on the "moviedb" database, fetch this URL:

  http://your.site/cgi-bin/ace/searches/text/moviedb

If no symbolic name is specified, the default database is assumed.
  http://your.site/cgi-bin/ace/searches/text 

is equivalent to

  http://your.site/cgi-bin/ace/searches/text/default

As described in EXTENDING ACEBROWSER, another way to select among
databases is to place the CGI script itself in a directory with the
same name as the database.  For example, if you have written a
specialized CGI script called screenplay that is designed to work with 
the "moviedb" database, you could place it in a subdirectory named
moviedb, and refer to it this way:

  http://your.site/cgi-bin/ace/moviedb/screenplay

README.ACEBROWSER  view on Meta::CPAN


The configuration files are located in the directory selected for
acebrowser configuration.  Their names are formed by appending ".pm"
to the symbolic name of the database.  For example, the configuration
file "simple.pm" corresponds to the database "simple".

Each of the configuration files is actually an executable Perl script.
As such it can use any Perl constructions you wish, including variable
interpolation.  The purpose of the configuration file is to set a
series of configuration variables, which by convention are all
uppercase.  For example, here is an excerpt from the default.pm
configuration file:

 $HOST = 'stein.cshl.org';
 $PORT = 2005;
 $USERNAME = '';
 $PASSWORD = '';

In addition to scalar variables, the configuration file is used to set 
arrays, hashes and specially-named functions.

If you are only interested in accessing a single database, it is
easiest to modify the default.pm configuration file.  To serve
multiple databases, just make a copy of default.pm and edit the copy.

If, for some reason, Acebrowser cannot find its configuration files,
it will generate an internal server error.  The location of the
configuration files directory is stored in the module
Ace::Browser::LocalSiteDefs, typically somewhere inside the
"site_perl" subdirectory of the Perl library directory (use "perl -V"
to see where that is).  You can find out where Acebrowser expects to
find its configuration files by running the following command:

  perl -MAce::Browser::LocalSiteDefs \
       -e 'print $Ace::Browser::LocalSiteDefs::SITE_DEFS,"\n"'

To change this value, either reinstall Aceperl or edit
LocalSiteDefs.pm manually.

EDITING THE CONFIGURATION FILE

The settings in the default.pm configuration file distributed with
AcePerl should work with little, if any modification.  The following
variables may need to be tweaked:

  $ROOT = '/cgi-bin/ace';

This is the root (top level) for all the Acebrowser CGI scripts.
Change this if necessary.

 $DOCROOT = '/ace';

README.ACEBROWSER  view on Meta::CPAN

holds icons and other small static images.  Note how the
previously-defined $DOCROOT variable is used.  You will probably not
need to change this.

 $IMAGES = "$DOCROOT/images";

This is where Acebrowser expects to find its "images" subdirectory.
This directory contains images generated dynamically by the ACEDB
database.  It *must* be writable by the web server user, usually
"nobody".  When the AcePerl install script creates this directory, it
makes it world-writable by default.  You may prefer to make it owned
by the "nobody" user and/or group.

 $HOST = 'stein.cshl.org';

This is the name of the host where the desired acedb server can be
found.

 $PORT = 2005;

This is the network port on which the desired acedb server is

README.ACEBROWSER  view on Meta::CPAN

The $SEARCH_ICON variable selects an icon to use for the search
button.


 @HOME      = (
	      $DOCROOT => 'Home Page'
	     );


Select the URL and label for the "home" link appearing on the bottom
of each Acebrowser-generated page.  By default, the home will point to 
"/ace" directory on the local machine.

 %DISPLAYS = (	
	     tree => {
		      'url'     => "generic/tree",
		      'label'   => 'Tree Display',
		      'icon'    => '/ico/text.gif' },
	     pic => {
		     'url'     => "generic/pic",
		     'label'   => 'Graphic Display',    

README.ACEBROWSER  view on Meta::CPAN

AceBrowser's use of cookies.

 @FEEDBACK_RECIPIENTS = (
			[ " $ENV{SERVER_ADMIN}", 'general complaints and suggestions', 1 ]
 );

This array contains a list of recipient e-mail addresses for the
"feedback" page.  Each recipient is an array reference containing
least two elements, the e-mail address and a comment.  A third,
optional, element, if true, indicates that this recipient should be
selected by default.  The default is the webmaster's e-mail address.
Comment out the entire section of you do not want the feedback link to 
appear.

 # configuration for the "basic" search script
 @BASIC_OBJECTS = 
   ('Any'          =>   '<i>Anything</i>',
    'Locus'        =>   'Confirmed Gene',
    'Predicted_gene'    =>   'Predicted Gene',
    'Sequence'     =>   'Sequence (any)',
    'Genome_sequence', => 'Sequence (genomic)',
    'Author'       =>    'Author',
    'Genetic_map'  => 'Genetic Map',
    'Sequence_map' => 'Sequence Map',
    'Strain'       =>  'Worm Strain',
    'Clone'        => 'Clone'
   );

The @BASIC_OBJECTS array is used by the "basic" search script.  It
indicates the Acedb classes to offer to the user to search on, and the
labels to use for each class.  For example, the default configuration
will present the user with a radio button labeled "Confirmed Gene" for
use in searching the Acedb class "Locus".

USING ACEBROWSER WITH MOD-PERL

Acebrowser is designed to work well with modperl
(http://perl.apache.org).  In fact, using it with a modperl-enabled
Apache server will increase its performance dramatically.

To use Acebrowser with modperl, install the CGI scripts into a

RPC/RPC.pm  view on Meta::CPAN


use strict;
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK $AUTOLOAD);

use Carp 'croak';
require Exporter;
require DynaLoader;

@ISA = qw(Exporter DynaLoader);

# Items to export into callers namespace by default.
@EXPORT = qw();

# Optional exports
@EXPORT_OK = qw(
	ACE_INVALID
	ACE_OUTOFCONTEXT
	ACE_SYNTAXERROR
	ACE_UNRECOGNIZED
	ACE_PARSE
);

acebrowser/cgi-bin/generic/pic  view on Meta::CPAN

	    my $n = escape($box->{'name'});
	    my $c = escape($box->{'class'});
	    my $href = Object2URL($box->{'name'},$box->{'class'});
            push(@lines,qq(<AREA shape="rect"
                                 onMouseOver="return s(this,'$jcomment')"
                                 coords="$coords"
                                 href="$href">));
	}
    }

    # Create default handling.  Bad use of javascript, but can't think of any other way.
    my $url = Url('pic', query_string());
    my $simple_url = $url;
    $url .= "&click=$old_clicks";
    $url .= "," if $old_clicks;
    push(@lines,qq(<AREA shape="default"
                         alt=""
                         onClick="send_click(event,'$url'); return false"
                         onMouseOver="return s(this,'clickable region')"
                         href="$simple_url">)) if $modern;
    print qq(<map name="theMap">),join("\n",@lines),qq(</map>),"\n";
}

# special case for maps
# this builds the whole map control/navigation panel
sub build_map_navigation_panel {

acebrowser/cgi-bin/misc/feedback  view on Meta::CPAN

    my $title = 'Data Submissions and Comments';
    print start_html (
		      '-Title'   => $title,
		      '-style'   => Style(),
		    ),
	Header,
	h1($title);
}

sub print_instructions {
  my @defaults;
  for (my $i=0; $i<@FEEDBACK_RECIPIENTS; $i++) {
    push @defaults,$i if $FEEDBACK_RECIPIENTS[$i][2];
  }
  print
    p({-class=>'small'},
      "Use this form to send new data or corrections to",
      "the maintainers of this database.  An e-mail message",
      "will be sent to the individuals selected from the list",
      "below."),
	blockquote({-class=>'small'},
		   checkbox_group(-name    => 'recipients',
				  -Values  => [(0..$#FEEDBACK_RECIPIENTS)],
				  -Labels  => { map {
				    $_=>"$FEEDBACK_RECIPIENTS[$_]->[0] ($FEEDBACK_RECIPIENTS[$_]->[1])"
				  } (0..$#FEEDBACK_RECIPIENTS) },
				  -defaults=>\@defaults,
				  -linebreak=>1));
}

sub print_bottom {
    print Footer;
}

sub print_form {
    my ($name,$class,$db,$where_from) = @_;
    print

acebrowser/cgi-bin/searches/basic  view on Meta::CPAN



sub display_search_form {
  CGI::autoEscape(0);
    print start_form(-name=>'SimpleForm'),
      table(
          TR({-valign=>TOP},
             td(radio_group(-name=>'class',
			    -Values=>\@classlist,
			    -Labels=>{@$classlist},
			    -default=>'Any',
			    -rows=>3)),
             td({-align=>LEFT,-class=>'large'},
                b('Name:'),textfield(-name=>'query'),br,
		submit(-name=>'Search')
		)
	     ),
	    );
  CGI::autoEscape(1);
    print  end_form();
}

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

		     'icon'    => "$ICONS/text.gif" },
	     model => {
		     'url'     => "generic/model",
		     'label'   => 'AceDB Schema',
		     'icon'    => "$ICONS/text.gif" },
	    );

# ========= %CLASSES =========
# displays to show
%CLASSES = (	
	    # default is a special "dummy" class to fall back on
	     Default => [ qw/tree pic model xml/ ],
	   );


# ========= &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);

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

use CGI 'escape','img';

# here's the root of all our stuff
$ROOT = '/perl/ace/elegans';
$WB   = '/wormbase';  # The root is at the top level

# ========= $NAME =========
# symbolic name of the database (defaults to name of file, lowercase)
$NAME = 'elegans';

# ========= $HOST  =========
# name of the host to connect to
#$HOST = 'brie2.cshl.org';
#$HOST = 'stein.cshl.org';
$HOST = 'localhost';
#$HOST = 'brie.cshl.org';

# ========= $PORT  =========

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


# ======== BLAST DATABASES ===========
# location of BLAST databases
$BLAST_ROOT = '/usr/local/wublast';;
$BLAST_BIN   = "$BLAST_ROOT/bin/";
$BLAST_MATRIX  = "$BLAST_ROOT/matrix";
$BLAST_FILTER  = "$BLAST_ROOT/filter";
$BLAST_DB      = "/usr/local/acedb/elegans/blast";
$BLAST_CUTOFF  = 0.001;
$BLAST_MAXHITS = 20;
@BLAST_default = ('blastp' => 'WormPep');
%BLAST_labels  = ('EST_Elegans' => 'elegans ESTs',
		  'Elegans'     => 'elegans genomic',
		  'WormPep'     => 'WormPep');
%BLAST_ok      = ('blastn'  => [qw/Elegans EST_Elegans/],
		  'tblastn' => [qw/Elegans EST_Elegans/],
		  'blastp'  => [qw/WormPep/],
		  'blastx'  => [qw/WormPep/]
		 );
# ========= $BANNER =========
# Banner HTML

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

	     Paper     => [ 'paper' ],

	     Cell      => [ 'cell','pedigree' ],

	     Map       => [ 'pic', 'geneapplet' ],

	     Laboratory     => [ 'laboratory' ],
	     
	     Expr_pattern     => [ 'expr_pattern' ],
	    
	    # default  has special meaning
	     Default => [ qw/tree xml pic/ ],
	   );

# ========= &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 = escape($name);
    my $c = escape($class);
    my $qs = "name=$n";
    my $qsc = "name=$n&class=$c";

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

    return (expr_pattern => $qs)          if $class eq 'Expr_pattern';
    return (author => $qs )               if $class eq 'Author';
    return (tree => $qsc)                 if $class eq 'Metabolite';
    return (cell => $qs)                  if $class eq 'Cell';

    if ($class eq 'Pathway') {
      return (pic  => $qsc )  if $name =~ /^\*/;
      return (tree => $qsc) if $name !~ /^\*/;
    }
    
    # maps are always displayed graphically by default
    return (pic => $qsc )         if $class =~ /map/i;

    # pictures remain pictures
    return (pic => $qsc )  if $display eq 'pic';
    return (tree => $qsc );
}

# ========= Configuration information for the simple search script
@SIMPLE = ('Any'              => '<i>Anything</i>',
	   'Accession_number' => 'Genbank Accession Number',

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

		 'url'     => "generic/xml",
		 'label'   => 'XML Display',
		    },
	    );

# ========= %CLASSES =========
# displays to show
%CLASSES = (
	    Person => ['person'],
	    Movie  => ['movie'],
	    # default is a special "dummy" class to fall back on
	    Default => [ qw/tree xml pic/ ],
	    );

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

# ========= $BANNER =========
# Banner HTML
# This will appear at the top of each page. 
$BANNER = <<END;
<center><span class=banner><font size=+3>Movie Database (Test)</font></span></center><p>

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


	     model => {
		     'url'     => "generic/model",
		     'label'   => 'AceDB Schema',
		     'icon'    => "$ICONS/text.gif" },
	    );

# ========= %CLASSES =========
# displays to show
%CLASSES = (	
	    # default is a special "dummy" class to fall back on
	     Default => [ qw/tree pic model xml/ ],
	   );



# ========= &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);

acebrowser/htdocs/index.html  view on Meta::CPAN

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html> <head>
<title>AceBrowser</title>
<link rel="stylesheet" href="stylesheets/aceperl.css" />
</head>

<body>
<h1>AceBrowser Default Page</h1>

<p>
This is the default page installed by AceBrowser.  You'd better change it!
</p>

<p>

If you have stored the cgi-bin scripts at the URL
http://your.host/cgi-bin/ace, then the following links should work.
Otherwise change them as appropriate.  </p>

<ol>
  <li><a href="/cgi-bin/ace/searches/text">Text Search</a>

acebrowser/htdocs/stylesheets/aceperl.css  view on Meta::CPAN

                    bump: +1;
                    key: 'Miscellaneous';
                  }
.Clone            { color: black;
                    height: 7;
                    bump: +1;
                    key: 'YACs\ &\ Cosmids';
                  }

/* this is all das stuff */
default.default {
  glyph: GENERIC;
  das: 1;
  label: 1;
  bump: +1;
  height: 6;
  color: wheat;
}
Sequence.default {
  glyph: GENERIC;
  das: 1;
  label: 1;
  bump: +1;
  height: 6;
  color: black;
  background-color: gray;
}
ALLELE.default {
  glyph: ANCHORED_ARROW;
  das: 1;
  label: 1;
  bump: +1;
  height: 3;
  color: black;
  background-color: tomato;
}
translation.default {
  glyph: GENERIC;
  das: 1;
  height: 5;
  bump: +1;
  point: 2;
  color: blue;
}
translated.default {
  glyph: GENERIC;
  das: 1;
  height: 5;
  label: 1;
  bump: +1;
  height: 6;
  color: blue;
}
translated.stopsite {
  glyph: GENERIC;

acebrowser/htdocs/stylesheets/aceperl.css  view on Meta::CPAN

  height: 2;
  color: green;
}
translated.CDS {
  glyph: ARROW;
  das: 1;
  label: 1;
  height: 6;
  color: cyan;
}
Predicted_gene.default {
  glyph: TRANSCRIPT;
  das: 1;
  label: 1;
  bump: +1;
  height: 10;
  color: dodgerblue;
  background-color: dodgerblue;
}
transcription.default {
  glyph: TRANSCRIPT;
  das: 1;
  label: 1;
  bump: +1;
  height: 10;
  color: black;
  background-color: wheat;
}
transcription.transcript {
  glyph: TRANSCRIPT;

acebrowser/htdocs/stylesheets/aceperl.css  view on Meta::CPAN

transcription.splice3 {
  glyph: ARROW;
  das: 1;
  label: 1;
  color: green;
  height: 2;
  parallel: yes;
  northeast: yes;
  southwest: no;
}
variation.default {
  glyph: GENERIC;
  das: 1;
  label: 1;
  bump: +1;
  height: 2;
  color: gray;
}
variation.insertion {
  glyph: ARROW;
  das: 1;

acebrowser/htdocs/stylesheets/aceperl.css  view on Meta::CPAN

variation.substitution {
  glyph: ARROW;
  das: 1;
  label: 1;
  color: cyan;
  height: 5;
  parallel: no;
  northeast: yes;
  southwest: no;
}
structural.default {
  glyph: ANCHORED_ARROW;
  das: 1;
  bump: +1;
  label: 1;
  height: 4;
  linewidth: 1;
  color: red;
}
structural.Link {
  glyph: ANCHORED_ARROW;

acebrowser/htdocs/stylesheets/aceperl.css  view on Meta::CPAN

  background-color: white;
}
structural.SNP {
  glyph: TRIANGLE;
  point: 1;
  das: 1;
  label: 1;
  height: 2;
  color: green;
}
Homol_data.default {
  glyph: SEGMENTS;
  das: 1;
  bump: +1;
  label: 1;
  height: 3;
  color: black;
  background-color: red;
}
Homol_data.NN {
  glyph: TOOMANY;

acebrowser/htdocs/stylesheets/aceperl.css  view on Meta::CPAN

  linewidth: 1;
}
Homol_data.PP {
  glyph: SEGMENTS;
  das: 1;
  label: 1;
  height: 50;
  color: #666666;
  linewidth: 1;
}
similarity.default {
  glyph: SEGMENTS;
  das: 1;
  label: 1;
  bump: +1;
  height: 5;
  background-color: limegreen;
  color: black;
}
similarity.BLAT_EST_GENOME {
  glyph: SEGMENTS;

acebrowser/htdocs/stylesheets/aceperl.css  view on Meta::CPAN

  color: dodgerblue;
}
similarity.TBLASTX_EST {
  glyph: SEGMENTS;
  das: 1;
  bump: +1;
  height: 5;
  background-color: darkgray;
  color: dodgerblue;
}
repeat.default {
  glyph: GENERIC;
  das: 1;
  bump: +1;
  height: 3;
  background-color: #ffe4c4;
  color: #8b7d6b;
}
repeat.microsatellite {
  glyph: GENERIC;
  das: 1;

acebrowser/htdocs/stylesheets/aceperl.css  view on Meta::CPAN

  height: 5;
  color: #6699cc;
}
repeat.LINE {
  glyph: GENERIC;
  das: 1;
  label: 1;
  height: 5;
  color: #6699cc;
}
experimental.default {
  glyph: GENERIC;
  das: 1;
  label: 1;
  bump: +1;
  height: 5;
  color: black;
  background-color: #b8860b;
}
experimental.cDNA_for_RNAi {
  glyph: SPAN;

acebrowser/htdocs/stylesheets/aceperl.css  view on Meta::CPAN

  das: 1;
  label: 1;
  color: blue;
}
experimental.mutant {
  glyph: GENERIC;
  das: 1;
  label: 1;
  color: violet;
}
partial_gene.default {
  glyph: GENERIC;
  das: 1;
  label: 1;
  background-color: yellow;
  color: orange;
  height: 5;
  bump: +1;
}

acelib/Makefile  view on Meta::CPAN

true = 1
false = 0
RANLIB_NEEDED = true	# default overridable in $(ACEDB_MACHINE)_DEF
AR_OPTIONS = rlu	# default overridable in $(ACEDB_MACHINE)_DEF

RPCGEN_FLAGS = -I -K -1
# -I -K -1  good for alpha
# -b  -I -K -1  good for linux, probably solaris ?

# suppress auto SCCS extraction
.SCCS_GET:

#################################################################
########## Machine dependent compiler modification ##############

acelib/Makefile  view on Meta::CPAN

#
CC =        $(COMPILER) $(USEROPTS) $(IDIR) -D$(NAME) -c
COMPILE.c = $(COMPILER) $(USEROPTS) $(IDIR) -D$(NAME) -c

###########################################################
## make targets.
##
##
.KEEP_STATE: 

# "all" should always be the first target so that it is the default make action.
all : libaceperl.a

clean:
	\rm -f *.o *.a core $(RPCGEN_PRODUCTS)

depend:
	makedepend $(IDIR) *.c

################## libraries #########################



( run in 1.622 second using v1.01-cache-2.11-cpan-0a6323c29d9 )