AcePerl

 view release on metacpan or  search on metacpan

Ace.pm  view on Meta::CPAN

is absent or undefined, then the method will return a lightweight
"stub" object that is filled with information as requested in a lazy
fashion. If $fill is the number "1" then the retrieved object contains
all the relevant information contained within the database.  Any other
true value of $fill will be treated as a tag name: the returned object
will be prefilled with the subtree to the right of that tag.

Examples:

   # return lightweight stub for Author object "Sulston JE."
   $author = $db->get(Author=>'Sulston JE');

   # return heavyweight object
   $author = $db->get(Author=>'Sulston JE',1);

   # return object containing the Address subtree
   $author = $db->get(Author=>'Sulston JE','Address');

The get() method is equivalent to this form of the fetch()
method:

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

=head2 aql() method

    $count   = $db->aql($aql_query);
    @objects = $db->aql($aql_query);

Ace.pm  view on Meta::CPAN

  $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
will be returned and a (hopefully informative) description of the
error will be returned by Ace->error().

For example:

  $author = $db->parse(<<END);
  Author : "Glimitz JR"
  Full_name "Jonathan R. Glimitz"
  Mail	"128 Boylston Street"
  Mail	"Boston, MA"
  Mail	"USA"
  Laboratory GM
  END

This method can also be used to parse several objects, but only the
last object successfully parsed will be returned.

Ace.pm  view on Meta::CPAN

  $object = $db->parse($title,$text);

This will parse the long text (which may contain carriage returns and
other funny characters) and place it into the database with the given
title.  In case of a parse error, the undefined value will be returned
and a (hopefully informative) description of the error will be
returned by Ace->error(); otherwise, a LongText object will be returned.

For example:

  $author = $db->parse_longtext('A Novel Inhibitory Domain',<<END);
  We have discovered a novel inhibitory domain that inhibits
  many classes of proteases, including metallothioproteins.
  This inhibitory domain appears in three different gene families studied
  to date...
  END

=head2 parse_file() method

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

Ace.pm  view on Meta::CPAN

    @objects = $db->find(-query => $query_string,
                         -offset=> $offset,
                         -count => $count
                         -fill  => $fill);

This allows you to pass arbitrary Ace query strings to the server and
retrieve all objects that are returned as a result.  For example, this
code fragment retrieves all papers written by Jean and Danielle
Thierry-Mieg.

    @papers = $db->find('author IS "Thierry-Mieg *" ; >Paper');

You can find the full query syntax reference guide plus multiple
examples at http://probe.nalusda.gov:8000/acedocs/index.html#query.

In the named parameter calling form, B<-count>, B<-offset>, and
B<-fill> have the same meanings as in B<fetch()>.

=head2 fetch_many() method

    $obj = $db->fetch_many($class,$pattern);

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

This function converts an AceDB object into a hypertext link.  The
first argument is an Ace::Object.  The second, optional argument is
the text to use for the link.  If not provided, the object's name
becomes the link text.

This function is used extensively to create cross references between
Ace::Objects on AceBrowser pages.

Example:

  my $author = $db->fetch(Author => 'Sulston JE');
  print ObjectLink($author,$author->Full_name);

This will print out a link to a page that will display details on the
author page.  The text of the link will be the value of the Full_name
tag.

=cut

sub ObjectLink {
  my $object     = shift;
  my $link_text  = shift;
  my $target     = shift;
  my $url = Object2URL($object,@_) or return ($link_text || "$object");
  my @targ = $target ? (-target=>$target) : ();

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

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
typical AceBrowser page, including the HTTP header information, the
page title, the navigation bar for searches, the web site banner, the
type selector for choosing alternative displays, and a level-one
header.

Ace/Local.pm  view on Meta::CPAN

__END__

=head1 NAME

Ace::Local - use giface, tace or gifaceclient to open a local connection to an Ace database

=head1 SYNOPSIS

  use Ace::Local
  my $ace = Ace::Local->connect(-path=>'/usr/local/acedb/elegans');
  $ace->query('find author Se*');
  die "Query unsuccessful" unless $ace->status;
  $ace->query('show');
  while ($ace->encore) {
    print $ace->read;
  }

=head1 DESCRIPTION

This class is provided for low-level access to local (non-networked)
Ace databases via the I<giface> program.  You will generally not need

Ace/Object.pm  view on Meta::CPAN


   $map = $clone->get('Map')->fetch;

The scalar context semantics are also slightly different.  In a scalar
context, the autogenerated function will *always* move one step to the
right.

The list context semantics are identical to get().  If you want to
dereference all members of a multivalued tag, you have to do so manually:

  @papers = $author->Paper;
  foreach (@papers) { 
    my $paper = $_->fetch;
    print  $paper->asString;
  }

You can provide an optional positional index to rapidly navigate
through the tree or to obtain tag[2] behavior.  In the following
examples, the first two return the object's Fax number, and the third
returns all data two hops to the right of Address.

Ace/Object.pm  view on Meta::CPAN

If you provide a -fill=>$tag argument, then the object fetch will
automatically fill the specified subtree, greatly improving
performance.  For example:

      $lab_address = $object->Laboratory(-filled=>'Address');

** NOTE: In a scalar context, if the node to the right of the tag is
** an object, the method will perform an implicit dereference of the
** object.  For example, in the case of:

    $lab = $author->Laboratory;

**NOTE: The object returned is the dereferenced Laboratory object, not
a node in the Author object.  You can control this by giving the
autogenerated method a numeric offset, such as Laboratory(0) or
Laboratory(1).  For backwards compatibility, Laboratory('@') is
equivalent to Laboratory(1).

The semantics of the autogenerated methods have changed subtly between
version 1.57 (the last stable release) and version 1.62.  In earlier
versions, calling an autogenerated method in a scalar context returned

Ace/Object.pm  view on Meta::CPAN


=head2 col() method

     @column = $object->col;
     @column = $object->col($position);


B<col()> flattens a portion of the tree by returning the column one
hop to the right of the current subtree. You can provide an additional
positional index to navigate through the tree using "tag[2]" behavior.
This example returns the author's mailing address:

  @mailing_address = $object->at('Address.Mail')->col();

This example returns the author's entire address including mail,
e-mail and phone:

  @address = $object->at('Address')->col(2);

It is equivalent to any of these calls:

  $object->at('Address[2]');
  $object->get('Address',2);
  $object->Address(2);

Ace/Object.pm  view on Meta::CPAN

commit(), at which time a result code indicates whether the database
update was successful.

You may create objects that reference other objects this way:

    $lab = new Ace::Object('Laboratory','LM',$db);
    $lab->add_row('Full_name','The Laboratory of Medicine');
    $lab->add_row('City','Cincinatti');
    $lab->add_row('Country','USA');

    $author = new Ace::Object('Author','Smith J',$db);
    $author->add_row('Full_name','Joseph M. Smith');
    $author->add_row('Laboratory',$lab);

    $lab->commit();
    $author->commit();

The result code indicates whether the addition was syntactically
correct.  add_row() will fail if you attempt to add a duplicate entry
(that is, one with exactly the same tag and value).  In this case, use
replace() instead.  Currently there is no checking for an attempt to
add multiple values to a single-valued (UNIQUE) tag.  The error will
be detected and reported at commit() time however.

The add() method is an alias for add_row().

Ace/SocketServer.pm  view on Meta::CPAN

  $self->{status} = STATUS_PENDING;
  return 1;
}
sub _handshake {
  my $self = shift;
  my ($user,$pass) = @_;
  $self->_send_msg(ACESERV_CLIENT_HELLO);
  my ($msg,$nonce) = $self->_recv_msg('strip');
  return unless $msg eq ACESERV_MSGOK;
  # hash username and password
  my $authdigest = md5_hex(md5_hex($user . $pass).$nonce);
  $self->_send_msg("$user $authdigest");
  my $body;
  ($msg,$body) = $self->_recv_msg('strip');
  return _error("server: $body") unless $body eq ACESERV_SERVER_HELLO;
  return 1;
}

sub _send_msg {
  my ($self,$msg,$parse) = @_;
  return unless my $sock = $self->{socket};
  local $SIG{'PIPE'} = 'IGNORE';

MANIFEST  view on Meta::CPAN

acebrowser/htdocs/stylesheets/elegans.css
acebrowser/htdocs/stylesheets/moviedb.css
docs/ACEDB.HOWTO
docs/ACE_SERVER_TRAPS.HOWTO
docs/ACE_SERVER_TRAPS.HOWTO.html
docs/GFF_Spec.html
docs/NEW_DB.HOWTO
docs/README
examples/README
examples/ace.pl
examples/authors.pl
examples/authors2.pl
examples/coauthors.pl
examples/draw_seqmap.pl
examples/dump_cdna.pl
examples/exons.pl
examples/exons.txt
examples/gif.pl
examples/sequence.pl
examples/upstream.pl
examples/upstream2.pl
install.PLS
make_docs.PLS

META.yml  view on Meta::CPAN

--- #YAML:1.0
name:                AcePerl
version:             1.92
abstract:            ~
license:             ~
author:              ~
generated_by:        ExtUtils::MakeMaker version 6.44
distribution_type:   module
requires:     
    Cache::Cache:                  1.03
    Digest::MD5:                   2
meta-spec:
    url:     http://module-build.sourceforge.net/META-spec-v1.3.html
    version: 1.3

README.ACEBROWSER  view on Meta::CPAN

explanatory name for the search script, and a pointer to its URL.

More information on writing search scripts can be found in the
documentation for Ace::Browser::SearchSubs.  From the command line, run:

  perldoc Ace::Browser::SearchSubs

FOR HELP

Please write to the Acedb newsgroup, acedb@sanger.ac.uk for help or to
report possible bugs.  If you get really stuck, write to the author,
lstein@cshl.org.

Lincoln D. Stein
September 24, 2001

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


	     geneapplet    => {'url'   =>"$ROOT/gene/geneapplet", 
			     'label' => 'Interactive Map'},

	     hunter        => {'url'   =>"$ROOT/hunter/hunter.cgi", 
			     'label' => 'Genome Hunter'},

	     sequence => { 'url'   => "$ROOT/seq/sequence",  
			   'label' => 'Sequence Report'},
	     
	     author => { 'url'      => "$ROOT/misc/author",
			 'label'    => 'Author Info'},
	     
	     biblio => {'url'      => "$ROOT/misc/biblio",
			'label'    => 'Bibliography'},

	     clone => {'url'   => "$ROOT/seq/clone",
		       'label' => 'Clone Report'},

	     paper => {'url'   => "$ROOT/misc/paper",
		       'label' => 'Citation'},

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

# ========= %CLASSES =========
# displays to show
%CLASSES = (	
	     # There are three representations of Locus, in addition to the basic ones
	     Locus     => [ qw/gene mappingdata nearby_genes hunter biblio geneapplet/ ],
     
	     # there are two representations of sequence, in addition to the basic ones
	     Sequence  => [ qw/sequence nearby_genes hunter/ ],
	     
	     # two representations of Author
	     Author => [ qw/author biblio/ ],

	     # one representation of Clone, Paper, Laboratory, and Expr_pattern
	     Clone     => [ 'clone' ],
	     
	     Paper     => [ 'paper' ],

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

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

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

    my $qs = "name=$n";
    my $qsc = "name=$n&class=$c";

    return (laboratory => $qs)             if $class eq 'Laboratory';
    return (paper => $qs)                  if $class eq 'Paper';
    return (biblio => "$qs&class=Keyword") if $class eq 'Keyword';
    return (clone => $qs )                if $class eq 'Clone';
    return (gene => $qs )                 if $class eq 'Locus';
    return (sequence => $qs )             if $class eq 'Sequence';
    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;

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


# ========= $FOOTER =========
# Footer HTML
# This will appear at the bottom of each page
$FOOTER = '';

# configuration for the "basic" seqarch script
@BASIC_OBJECTS = 
  ('Any'       =>   '<i>Anything</i>',
   'Movie'     =>   'Movie Title',
   'Person'    =>   'Person (author/actor/director)',
   'Director'  =>   'Director',
   'Author'    =>   'Author',
   'Actor'     =>   'Actor',
   'Book'      =>   'Book');
1;

acelib/aceclientlib.c  view on Meta::CPAN

  ace_data question ;
  ace_handle *handle;
  CLIENT *clnt;

/* open rpc connection */
/* lao: */
  clnt = clnt_create (host, RPC_ACE, RPC_ACE_VERS, "tcp");

  if (!clnt) return((ace_handle *)NULL);

/* authenticate */
  question.clientId = 0;
  question.magic = 0;
  question.reponse.reponse_len = 0;
  question.reponse.reponse_val = "";
  question.question = "";
  question.aceError = 0;
  question.kBytes = 0;
  question.encore = 0;

#ifdef JUNK

acelib/aceclientlib.c  view on Meta::CPAN

    n = clientId + 1 ; /* so we fail */
  if (reponse->ace_reponse_u.res_data.aceError) {
    xdr_free((xdrproc_t )xdr_ace_reponse, (char *)reponse);
    memset (reponse,0, sizeof(ace_reponse)) ;
    clnt_destroy(clnt);
    return 0;
  }
  xdr_free((xdrproc_t )xdr_ace_reponse, (char *)reponse);
  memset (reponse,0, sizeof(ace_reponse)) ;
  if (n != clientId) {
  /* authentication failed */
    clnt_destroy(clnt);
    return 0 ;
  }
/* create mem for handle */
  if ((handle = (ace_handle *)malloc(sizeof(ace_handle))) == NULL) {
     question.clientId = clientId ;
     question.magic = magic3 ;
     question.reponse.reponse_len = 0;
     question.reponse.reponse_val = "";
     question.question = "Quit";

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

#define UT_COPYRIGHT()                                                               \
"@(#) Copyright (c):  J Thierry-Mieg and R Durbin, 1998 \n"                          \
"@(#) \n"                                                                            \
"@(#) This file contains the above Sanger Informatics Group library, \n"             \
"@(#) written by   Richard Durbin (Sanger Centre, UK) rd@sanger.ac.uk \n"            \
"@(#)              Jean Thierry-Mieg (CRBM du CNRS, France) mieg@kaa.crbm.cnrs-mop.fr \n" \
"@(#)              Ed Griffiths (Sanger Centre, UK) edgrif@sanger.ac.uk \n"          \
"@(#)              Fred Wobus (Sanger Centre, UK) fw@sanger.ac.uk \n"                \
"@(#) You may redistribute this software subject to the conditions in the \n"        \
"@(#) accompanying copyright file. Anyone interested in obtaining an up to date \n"  \
"@(#) version should contact one of the authors at the above email addresses. \n"


#define UT_COPYRIGHT_STRING(TITLE, VERSION, RELEASE, UPDATE, DESCRIPTION_STRING)     \
static const char *ut_copyright_string =                                             \
"@(#) \n"                                                                            \
"@(#) --------------------------------------------------------------------------\n"  \
"@(#) Title/Version:  "UT_MAKE_VERSION_STRING(TITLE, VERSION, RELEASE, UPDATE)"\n"   \
"@(#)      Compiled:  "__DATE__" "__TIME__"\n"                                       \
"@(#)   Description:  " DESCRIPTION_STRING"\n"                                       \
UT_COPYRIGHT()                                                                       \

docs/GFF_Spec.html  view on Meta::CPAN

	<LI><A HREF="#GFF_use">Ways to use GFF</A>
	<UL>
	   <LI><A HREF="#examples">Complex Examples</A>
	   <UL>
              <LI><A HREF="#homology_feature">Similarities to Other Sequences</A>
           </UL>
	   <LI><A HREF="#cum_score_array">Cumulative Score Arrays</A>
	</UL>
	<LI><A HREF="#mailing_list"> Mailing list</A>
	<LI><A HREF="#edit_history">Edit History</A>
	<LI><A HREF="#authors">Authors</A>
</UL>
<!-- 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

docs/GFF_Spec.html  view on Meta::CPAN

990317 rbsk:
<UL>
   <LI>End of line comments following Version 2 [group] field tag-value structures must be 
       tab '\t' or hash '#' delimited.
</UL>       
<P>
<P>
Back to <A HREF="#TOC">Table of Contents</A>
<P>
<HR>
<A NAME="authors"><h2>Authors</h2></A>
<P>
GFF Protocol Specification initially proposed by: 
<A HREF="mailto:rd@sanger.ac.uk">Richard Durbin</a> and 
<A HREF="mailto:haussler@cse.ucsc.edu">David Haussler</a>
<P>with amendments proposed by: 
<A HREF="mailto:lstein@cshl.org">Lincoln Stein</a>, Anders Krogh and others.
<P>The GFF specification now maintained at the Sanger Centre by 
<A HREF="mailto:rbsk@sanger.ac.uk">Richard Bruskiewich</a>
<P>
Back to <A HREF="#TOC">Table of Contents</A>

docs/NEW_DB.HOWTO  view on Meta::CPAN


	**** Program tace,  compiled on: Jul  6 1999 10:58:24 ****
	**** Using  ACEDB Version 4_7i,  compiled on: Jul  6 1999 10:58:14 ****

	Code by: Jean Thierry-Mieg (CNRS, France) mieg@crbm.cnrs-mop.fr
         Richard Durbin (Sanger Centre, UK) rd@sanger.ac.uk
         Simon Kelley (Sanger Centre, UK) srk@sanger.ac.uk

	You may redistribute this program and database subject to the
	conditions in the accompanying copyright file.  Anyone interested in
	maintaining an up-to-date version should contact one of the authors
	at the above email addresses.

	// Type ? for a list of options

	acedb> <parse /usr/local/acedb/my_db/raw/my_content.ace>
	// Parsing file  /usr/local/acedb/raw/my_content.ace
	// 123 objects read with 0 errors
	// 123 Active Objects
	acedb> <save>
	// 123 Active Objects

examples/authors.pl  view on Meta::CPAN

#!/usr/local/bin/perl

# This example will pull some information on various authors
# from the C. Elegans ACEDB.

use lib '../blib/lib','../blib/arch';
use Ace;
use strict vars;

use constant HOST => $ENV{ACEDB_HOST} || 'stein.cshl.org';
use constant PORT => $ENV{ACEDB_PORT} || 200005;

$|=1;

print "Opening the database....";
my $db = Ace->connect(-host=>HOST,-port=>PORT) || die "Connection failure: ",Ace->error;
print "done.\n";

my @authors = $db->list('Author','S*');
print "There are ",scalar(@authors)," Author objects starting with the letter \"S\".\n";
print "The first one's name is ",$authors[0],"\n";
print "His mailing address is ",join(',',$authors[0]->Mail),"\n";
my @papers = $authors[0]->Paper;
print "He has published ",scalar(@papers)," papers.\n";
my $paper = $papers[$#papers]->pick;
print "The title of his most recent paper is ",$paper->Title,"\n";
print "The coauthors were ",join(", ",$paper->Author->col),"\n";
print "Here is all the information on the first coauthor:\n";
print (($paper->Author)[0]->fetch->asString);

examples/authors2.pl  view on Meta::CPAN

#!/usr/local/bin/perl

# This example will pull some information on various authors
# from the C. Elegans ACEDB.

use lib '../blib/lib','../blib/arch';
use Ace;
use strict vars;

use constant HOST => $ENV{ACEDB_HOST} || 'stein.cshl.org';
use constant PORT => $ENV{ACEDB_PORT} || 200005;

$|=1;

print "Opening the database....";
my $db = Ace->connect(-host=>HOST,-port=>PORT) || die "Connection failure: ",Ace->error;
print "done.\n";

my @authors = $db->list('Author','S*');
print "There are ",scalar(@authors)," Author objects starting with the letter \"S\".\n";
print "The first one's name is ",$authors[0],"\n";
print "Address: ",join "\n\t",$authors[0]->Address(2),"\n";

examples/coauthors.pl  view on Meta::CPAN

use constant HOST => $ENV{ACEDB_HOST} || 'stein.cshl.org';
use constant PORT => $ENV{ACEDB_PORT} || 200005;
my $AUTHOR = "Meyer BJ";

$|=1;

print "Trying to establish connection...";
my $db = Ace->connect(-port=>PORT,-host=>HOST);
print "done\n";

print "Searching for ${AUTHOR}'s coauthors:\n";
my $iterator = $db->find_many(-query=>qq{find Author IS "$AUTHOR"; >Paper; >Author});
while (my $author = $iterator->next) {
  print $author,"\n";
}

t/object.t  view on Meta::CPAN

push @args,(-cache=>{}
	   ) if TEST_CACHE || $ENV{TEST_CACHE};
Ace->debug(0);
test(2,$db = Ace->connect(@args),"connection failure");
die "Couldn't establish connection to database.  Aborting tests.\n" unless $db;
test(3,$obj = $db->fetch('Author','Sulston JE'),"fetch failure");
print STDERR "\n  ...Failed to get test object. Wrong database?\n     Expect more failures... " 
  unless $obj;
test(4,defined($obj) && $obj eq 'Sulston JE',"string overload failure");
test(5,@obj = $db->fetch('Author','Sulston*'),"wildcard failure");
test(6,@obj==2,"failed to recover two authors from Sulston*");
test(7,defined($obj) && $obj->right eq 'Also_known_as',"auto fill failure");
test(8,defined($obj) && $obj->Also_known_as eq 'John Sulston',"automatic method generation failure");
test(9,defined($obj) && $obj->Also_known_as->pick eq 'John Sulston',"pick failure");
test(10,defined($obj) && (@obj = $obj->Address(2)) == 9,"col failure");
test(11,defined($obj) && ($lab = $obj->Laboratory),"fetch failure");
test(12,defined($lab) && join(' ',sort($lab->tags)) =~ /^Address CGC Staff$/,"tags failure");
test(13,defined($lab) && $lab->at('CGC.Allele_designation')->at eq 'e',"compound path failure");
test(14,defined($obj) && $obj->Address(0)->asString eq $DATA,"asString() method");
test(15,$db->ping,"can't ping");
test(16,$db->classes,"can't count classes");



( run in 3.997 seconds using v1.01-cache-2.11-cpan-5c0b1e786e0 )