AcePerl

 view release on metacpan or  search on metacpan

Ace.pm  view on Meta::CPAN

    return $class->connect(-url=>shift);
  }

  # multi-argument (traditional) form
  ($host,$port,$user,$pass,
   $path,$objclass,$timeout,$query_timeout,$url,$cache,$other) = 
     rearrange(['HOST','PORT','USER','PASS',
		'PATH',['CLASS','CLASSMAPPER'],'TIMEOUT',
		'QUERY_TIMEOUT','URL','CACHE'],@_);

  ($host,$port,$u,$pass,$p,$server_type) = $class->process_url($url) 
    or croak "Usage:  Ace->connect(-host=>\$host,-port=>\$port [,-path=>\$path]\n"
      if defined $url;

  if ($path) { # local database
    $server_type = 'Ace::Local';
  } else { # either RPC or socket server
    $host      ||= 'localhost';
    $user      ||= $u || '';
    $path      ||= $p || '';
    $port        ||= $server_type eq 'Ace::SocketServer' ? DEFAULT_SOCKET : DEFAULT_PORT;

Ace.pm  view on Meta::CPAN

  }

  $selected_class ||= 'Ace::Object';

  eval "require $selected_class; 1;" || croak $@
    unless $selected_class->can('new');

  $selected_class;
}

sub process_url {
  my $class = shift;
  my $url = shift;
  my ($host,$port,$user,$pass,$path,$server_type) = ('','','','','','');

  if ($url) {  # look for host:port
    local $_ = $url;
    if (m!^rpcace://([^:]+):(\d+)$!) {  # rpcace://localhost:200005
      ($host,$port) = ($1,$2);
      $server_type = 'Ace::RPC';
    } elsif (m!^sace://([\w:]+)\@([^:]+):(\d+)$!) { # sace://user@localhost:2005

Ace.pm  view on Meta::CPAN

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,

Ace.pm  view on Meta::CPAN

In the examples below, the first line of code will fetch the Sequence
object whose database ID is I<D12345>.  The second line will retrieve
all objects matching the pattern I<D1234*>.  The third line will
return the count of objects that match the same pattern.

   $object =  $db->fetch(Sequence => 'D12345');
   @objects = $db->fetch(Sequence => 'D1234*');
   $cnt =     $db->fetch(Sequence =>'D1234*');

A variety of communications and database errors may occur while
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

Ace.pm  view on Meta::CPAN

=head2 put() method

   $cnt = $db->put($obj1,$obj2,$obj3);

This method will put the list of objects into the database,
overwriting like-named objects if they are already there.  This can
be used to copy an object from one database to another, provided that
the models are compatible.

The method returns the count of objects successfully written into the
database.  In case of an error, processing will stop at the last
object successfully written and an error message will be placed in
Ace->error();

=head2 parse() method

  $object = $db->parse('data to parse');

This will parse the Ace tags contained within the "data to parse"
string, convert it into an object in the databse, and return the
resulting Ace::Object.  In case of a parse error, the undefined value

Ace.pm  view on Meta::CPAN


Create a new object in the database with the indicated class and name
and return a pointer to it.  Will return undef if the object already
exists in the database.  The object isn't actually written into the database
until you call Ace::Object::commit().

=head2 raw_query() method

    $r = $db->raw_query('Model');

Send a command to the database and return its unprocessed output.
This method is necessary to gain access to features that are not yet
implemented in this module, such as model browsing and complex
queries.

=head2 classes() method

   @classes = $db->classes();
   @all_classes = $db->classes(1);

This method returns a list of all the object classes known to the

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


Return the height of the label, if any.

=item $label = $glyph->label

Return a human-readable label for the glyph.

=back

These methods are called by Ace::Graphics::Track during the layout
process:

=over 4

=item $glyph->move($dx,$dy)

Move the glyph in pixel coordinates by the indicated delta-x and
delta-y values.

=item ($x1,$y1,$x2,$y2) = $glyph->box

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

Ace::Graphics::Glyph::group - The group glyph

=head1 SYNOPSIS

none

=head1 DESCRIPTION

This is an internal glyph type, used by Ace::Graphics::Track for
moving sets of glyphs around as a group.  This glyph is created
automatically when processing a set of features passed to
Ace::Graphics::Panel->new as an array ref.

=head2 OPTIONS

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

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

Ace/Object.pm  view on Meta::CPAN

before it is incorporated into the table, for example by turning it
into an HREF link.  The callback takes a single argument containing
the object, and must return a string-valued result.  It may also
return a list as its result, in which case the first member of the
list is the string representation of the object, and the second
member is a boolean indicating whether to prune the table at this
level.  For example, you can prune large repetitive lists.

Here's a complete example:

   sub process_cell {
     my $obj = shift;
     return "$obj" unless $obj->isObject || $obj->isTag;

     my @col = $obj->col;
     my $cnt = scalar(@col);
     return ("$obj -- $cnt members",1);  # prune
            if $cnt > 10                 # if subtree to big

     # tags are bold
     return "<B>$obj</B>" if $obj->isTag;  

     # objects are blue
     return qq{<FONT COLOR="blue">$obj</FONT>} if $obj->isObject; 
   }

   $object->asHTML(\&process_cell);

=head2 asXML() method

   $result = $object->asXML;

asXML() returns a well-formed XML representation of the object.  The
particular representation is still under discussion, so this feature
is primarily for demonstration.

=head2 asGIF() method

Ace/Object.pm  view on Meta::CPAN

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
image map.  Unfortunately, not everything that is clickable is
represented as a box.  You still have to pass clicks on unknown image
areas back to the server for processing.

Each box in the array is a hash reference containing the following
keys:

    'coordinates'  => [$left,$top,$right,$bottom]
    'class'        => object class or "BUTTON"
    'name'         => object name, if any
    'comment'      => a text comment of some sort

I<coordinates> points to an array of points indicating the top-left and 

Ace/Object.pm  view on Meta::CPAN

  my $data = $self->db->raw_query(join(' ; ',@commands));

  # A $' has been removed here to improve speed -- tim.cutts@incyte.com 2 Sep 1999

  # did this query succeed?
  my ($bytes, $trim);
  return unless ($bytes, $trim) = $data=~m!^// (\d+) bytes\n\0*(.+)!sm;

  my $gif = substr($trim,0,$bytes);

  # now process the boxes
  my @b;
  my @boxes = split("\n",substr($trim,$bytes));
  foreach (@boxes) {
    last if m!^//!;
    chomp;
    my ($left,$top,$right,$bottom,$class,$name,$comments) = 
      m/^\s*\d*\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\w+):"(.+)"\s*(.*)/;
    next unless defined $left;
    $comments=~s/\s+$//; # sometimes there's extra white space at the end
    my $box = {'coordinates'=>[$left,$top,$right,$bottom],

ChangeLog  view on Meta::CPAN

1.71
	1. Fixed the Ace::Sequence _make_filter() function to respect the value of automerge()
	2. Made it possible to change the color of introns and exons depending on curation status
		(will need more work)
	3. Fixed Ace::Sequence to correctly report start and end of alignment targets when viewed
		from the perspective of a reversed reference sequence (order swapped).
1.70	3/5/2001
	1. Folded AceBrowser functionality into package.
	2. Added GD graphics.
1.69	10/17/2000
	1. fixes to url processing
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> 
		to improve efficiency.
1.58	8/3/99
	1. Tiny change in Model.pm to accomodate @tags.
1.57	7/22/99
	1. 1.56 was contaminated with leftover rpc* files in the ace/ subdirectory, this causes
		builds on several architectures to fail.
	2. Fixed "ambiguous variable" warnings in the regression tests.

ChangeLog  view on Meta::CPAN

1.47-49	Internal releases
    
1.46	1. Fixed nasty bug in which newlines appeared as "n" in text
        fields.
    
1.45.   1. Fixed problems with autogeneration
	2. Added the format() routine 3. Added the model() methods and
 	Ace::Model class
    
1.44	1. Added the auto_save() routine to the API
	2. Fixed problem of hanging tace processes after quitting local sessions
	3. Fixed problem with creation of new objects in local
        sessions.
    
1.43	1. Moved the unescape routine into the C level for performance reasons.
	2. Should now escape \? correctly and handle most protection issues.

1.42	1. Numerous small bug fixes

1.41	1. Fixed problem with truncation of trees at zero values
	2. Fixed implementation of updating wrt new aceservers

1.46    1. Fixed nasty replacement of newlines by "n" characters in text fields.

1.45    Internal release only.

1.44	1. Added the auto_save() routine to the API
	2. Fixed problem of hanging tace processes after quitting local sessions
	3. Fixed problem with creation of new objects in local sessions.

1.43	1. Moved the unescape routine into the C level for performance reasons.
	2. Should now escape \? correctly and handle most protection issues.

1.42	1. Numerous small bug fixes

1.41	1. Fixed problem with truncation of trees at zero values
	2. Fixed implementation of updating wrt new aceservers

README  view on Meta::CPAN

   installed.  If you answer in the affirmative, then you will be asked a number
   of directory configuration questions.  See README.ACEBROWSER for more details
   on installation.

   At this point, Makefile.PL will create the make files necessary to build
   AcePerl.  Among other things, the Makefile.PL script will attempt
   to guess the type of your machine and its operating system.  This information
   is needed to select the correct makefile in the ACEDB library
   directory, AcePerl-X.XX/ace/.

   If AcePerl fails to make correctly later in the process, it may be
   because the script guessed wrong.  You can override this guess by
   setting the machine type using the ACEDB_MACHINE environment
   variable.  On a C-shell or TC-shell machine, use a command like
   this one:
 
     setenv ACEDB_MACHINE ALPHA_4_GCC; perl Makefile.PL
  
   On a Bourne-shell or Korn-shell system, use:

    ACEDB_MACHINE=ALPHA_4_GCC; export ACEDB_MACHINE

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

	unless my $from = param('from');
    push @missing,"A properly formatted e-mail address"
	if $from && $from !~ /.+\@[\w.]+/;
    push @missing,"A subject line"          
	unless my $subject = param('subject');
    push @missing,"A comment or correction" 
	unless my $remark = param('remark');
    if (@missing) {
	print
	    p({-class=>'error'},
	      "Your submission could not be processed because",
	      "the following information was missing:"),
	    ol({-class=>'error'},
	       li(\@missing)),
	    p({-class=>'error'},
	      "Please fill in the missing fields and try again.");
	return;
    }


    my $error = <<END;

acelib/aceclientlib.c  view on Meta::CPAN

	 through the string first and count the number of '\0''s 
	 and substract this from the memoryblock we allocate */
      if (!length )   /* empty string */
	{ *answerPtr = 0;
	  return returnValue;
	}
      if ((answer = (char *)malloc(length+1)) == NULL) 
	{ free(binaryAnswer);
	  return(ENOMEM);
	}
      /* initial step of the copy process */
      loop = (char *)binaryAnswer;
      strcpy(answer,loop);
      i = *loop ? strlen(loop): 0 ;
      loop += i;
      for (;(*loop == '\0')&&(i<length) ;loop++,i++);
      
      for (;i<length;) 
	{ strcat(answer,loop);
	  i += strlen(loop);
	  loop +=  strlen(loop);

acelib/rpcace.x  view on Meta::CPAN

/* $Id: rpcace.x,v 1.1 2003/01/29 21:33:28 lstein Exp $ */

/*
** This file gets processed by rpcgen to make machine specific 
** rpc library hooks
**
** ace_data is for transfer from client to server
** ace_reponse is the canonical rpcgen union.
*/

/* 
   question:
      set by client: a buffer containing the request

acelib/texthelp.c  view on Meta::CPAN

/* counter-part to graphWebBrowser(), which remote-controls 
   netscape using the -remote command line option. Useful
   for textual applications running in an X11 environment,
   where x-apps can be called from within the application,
   but the Xtoolkit (used to drive netscape via X-atoms)
   shouldn't be linked in, because it is a textual app. */
/************************************************************/
UTIL_FUNC_DEF BOOL  helpWebBrowser(char *link)
{
  /* currently impossible, because it is hard to find out whether
     a netscape process is already running.
     Stupidly enough 'netscape -remote...' doesn't exit
     with code 1, if it can't connect to an existing process
*/
  return FALSE;
} /* helpWebBrowser */





/************************************************************/
/******************                   ***********************/

acelib/wh/mystdlib.h  view on Meta::CPAN

 *-------------------------------------------------------------------
 * This file is part of the ACEDB genome database package, written by
 * 	Richard Durbin (MRC LMB, UK) rd@mrc-lmb.cam.ac.uk, and
 *	Jean Thierry-Mieg (CRBM du CNRS, France) mieg@kaa.cnrs-mop.fr
 *
 * Description:
 ** Prototypes of system calls
 ** One should in principle use stdlib, however on the various machines,
    stdlibs do not always agree, I found easier to look by hand 
    and copy here my human interpretation of what I need.
    Examples of problems are: reservations for multi processor
    architectures on some Silicon machines, necessity to define myFile_t on
    some machines and not on others etc.
 * Exported functions:
 * HISTORY:
 * Last edited: Dec  4 16:03 1998 (fw)
 * * Feb  6 14:04 1997 (srk)
 * * Jun 11 16:46 1996 (rbrusk): WIN32 tace fixes
 * * Jun 10 17:46 1996 (rbrusk): strcasecmp etc. back to simple defines...
 * * Jun  9 19:29 1996 (rd)
 * * Jun 5 15:36 1996 (rbrusk): WIN32 port details

acelib/wh/mystdlib.h  view on Meta::CPAN

   the same as MALLOC_ALIGNMENT, but for most 32 bit pointer machines
   we align stacks to 4 bytes to save memory.

   STACK_DOUBLE_ALIGNMENT
   Alignment of doubles required on stack, if this is greater than
   STACK_ALIGNMENT, we read and write doubles on a stack by steam.


   Put specific exceptions first, the defaults below should cope 
   with most cases. Oh, one more thing, STACK_ALIGNMENT and
   STACK_DOUBLE ALIGNMENT are used on pre-processor constant 
   expressions so no sizeofs, sorry.
*/


/* 680x0 processors can fix up unaligned accesses so we trade off speed
   against memory usage on a Mac. I have no idea if this is a good
   trade-off, I only program real computers - srk */

#if defined(NEXT) || defined(MACINTOSH) 
#  define STACK_ALIGNMENT 2
#  define STACK_DOUBLE_ALIGNMENT 2
#  define MALLOC_ALIGNMENT 4
#endif

/* Alpha pointers are 8 bytes, so align the stack to that */

acelib/wh/version.h  view on Meta::CPAN

/* These tools assume that various numbers/strings are defined, e.g.         */
/*                                                                           */
/* #define SOME_TITLE   "UT library"         (definitive name for library)   */
/* #define SOME_DESC    "brief description"  (purpose of library - one liner)*/
/* #define SOME_VERSION 1                    (major version)                 */
/* #define SOME_RELEASE 0                    (minor version)                 */
/* #define SOME_UPDATE  1                    (latest fix number)             */
/*                                                                           */

/* 1) Use UT_MAKESTRING to make strings out of #define'd numbers.            */
/*    (required because of the way ANSI preprocessor handles strings)        */
/*    e.g. UT_MAKESTRING(6)  produces "6"                                    */
/*                                                                           */
#define UT_PUTSTRING(x) #x
#define UT_MAKESTRING(x) UT_PUTSTRING(x)

/* 2) Make a single version number out of the version, release and update    */
/*    numbers.                                                               */
/* NOTE that there will be no more than 100 (i.e. 0 - 99) revisions per      */
/* version, or updates per revision, otherwise version will be wrong.        */
/*                                                                           */

docs/ACE_SERVER_TRAPS.HOWTO  view on Meta::CPAN

   will make the document available for download on the Spatial Focus
   private web page. Although the document is marked "draft" and dated
   1994, it is thorough and simple. Doesn't appear to be significantly
   out of date.
   
   The moviedb database is the best simple example of a database.
   
  Editors
  
   ACEDB is picky about its ascii. vi works great. Can't vouch for emacs
   ;-). Don't use anything nasty like a word processor.
   
  White Space
  
   It really likes alignment, and it likes tabs. Combining tabs and
   spaces kills otherwise perfectly good models every five seconds.
   
    To Do
    
   Solve the mysteries of the failure of AceBrowser. Every other means of
   access works now.

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

<p>Our individual <em>inetd.conf</em> files were completely commented out, and the daemon stopped because of our dispersed locations.  Append the required line to the file, and enter:</p>
<p><em>Killall -HUP inetd</em></p>
<p><h4>server.log</h4></p>
<p>The server really wants a <em>server.log</em> file, writable by the user to whom the <em>gifaceserver</em> is assigned in the <em>inetd.conf</em> file.  We created one by opening the <em>gifaceserver</em> on a fake port number (12345):</p>
<p><em> /usr/local/bin/gifaceserver /home/httpd/database/contacts 12345 1200:1200:10</em></p> 
<p><h2>Models</h2></p>
<p><h3>Documentation</h3></p>
The <strong>best</strong> documentation for models is in <em>/acedocs/exploring/*.</em>  The table of contents is in <em>/acedocs/exploring/toc_models.html</em>.  Unfortunately, like all the ACEDB documentation, it uses absolute pathnames.  We have c...
<p>The moviedb database is the best simple example of a database.</p>
<p><h3>Editors</h3></p>
<p>ACEDB is picky about its ascii.  <em>vi</em> works great.  Can't vouch for <em>emacs</em> ;-).  <strong>Don't</strong> use anything nasty like a word processor.</p>
<p><h3>White Space</h3></p>
<p>It really likes alignment, and it likes tabs.  Combining tabs and spaces kills otherwise perfectly good models every five seconds.</p>
<p><h4>To Do</h4></p>
Solve the mysteries of the failure of AceBrowser.  Every other means of access works now.</p>
</body>
</html>

docs/GFF_Spec.html  view on Meta::CPAN

<!-- INDEX END -->
<HR>
<A NAME="introduction"><h2>Introduction</h2></A>
<P>
Essentially all current approaches to gene finding in higher organisms
use a variety of recognition methods that give scores to likely
signals (starts, splice sites, stops etc.) or to extended regions
(exons, introns etc.), and then combine these to give complete gene
structures.  Normally the combination step is done in the same program
as the feature detection, often using dynamic programming methods.  We
would like to enable these processes to be decoupled, by proposing a
format called GFF (Gene-Finding Format) for the transfer of feature
information.  It would then be possible to take features from an
outside source and add them in to an existing program, or in the
extreme to write a dynamic programming system which only took external
features.
<P>

In particular, establishing GFF would allow people to develop features
and have them tested without having to maintain a complete
gene-finding system.  Equally, it would help those developing and
applying integrated gene-finding programs to test new feature
detectors developed by others, or even by themselves.
<P>

We want the GFF format to be easy to parse and process by a variety of
programs in different languages.  e.g. it would be useful if Unix
tools like grep, sort and simple perl and awk scripts could easily
extract information out of the file.  For these reasons, for the
primary format, we propose a record-based structure, where each
feature is described on a single line, and line order is not relevant.
<P>

We do not intend GFF format to be used for complete data management of
the analysis and annotation of genomic sequence.  Systems such as
Acedb, Genotator etc. that have much richer data representation
semantics have been designed for that purpose.  The disadvantages in
using their formats for data exchange (or other richer formats such as
ASN.1) are (1) they require more complexity in parsing/processing, (2)
there is little hope on achieving consensus on how to capture all
information.  GFF is intentionally aiming for a low common
denominator. <P>

Here are some example records:

<pre>
SEQ1	EMBL	atg	103	105	.	+	0
SEQ1	EMBL	exon	103	172	.	+	0
SEQ1	EMBL	splice5	172	173	.	+	.

make_docs.PLS  view on Meta::CPAN

<BODY BGCOLOR="white">
<!--NAVBAR-->
<hr>
<a href="http://stein.cshl.org/AcePerl">AcePerl Main Page</a>
END
;
      } else {
	print OUT;
      }
    }
  } else {  # child process
    open STDERR,">/dev/null";
    pod2html(
	     $pod,
	     '--podroot=.',
	     '--podpath=.',
	     '--noindex',
	     '--htmlroot=/AcePerl/docs',
	     "--infile=$pod",
	     "--outfile=-"
	    );



( run in 0.476 second using v1.01-cache-2.11-cpan-8d75d55dd25 )