Contents

What is CaCOREperl?

CaCOREperl is a Perl application programming interface to caCORE hosted vocabulary, metadata, and biomedical data. It implements the caCORE object model with object-oriented methodology, and encapsulates webservice invocations and XML parsing so that programmers deal with caCORE objects directly. CaCOREperl is available in Windows, Solaris and other Perl supported operating systems
CaCOREperl requires Perl version 5.6.0 or above.
Current version of CaCOREperl is 3.2.

Main Features of CaCOREperl:

CaCOREperl contains the following sub-packages:

Architecture

The following picture describe the architecture of CaCOREperl and how it is related to the caCORE server.

This picture illustrates the following features of CaCOREperl:

Installing CaCOREperl

Perl comes installed on Unix and Linux platforms. For window based systems, you can download a Perl version from www.activestate.com. CaCOREperl is depened on two Perl modules, XML::DOM and LWP::UserAgent. You must install both XML::DOM and LWP::UserAgent in addition to CaCOREperl.

There are multiple ways to installing Perl modules, the following are three of them.

Using make

First unzip the CaCORE to a temporary folder. Then open a Command window, cd to the directory that contains this README file and type the following.

perl Makefile.PL
Alternatively, if you plan to install CaCORE somewhere other than your system's perl library directory. You can type something like this:
perl Makefile.PL PREFIX=/home/me/perl INSTALLDIRS=perl
Then to build you run make.
make
You can then test the module by typing:
make test
If you have write access to the perl library directories, you may then install by typing:
make install

Using Perl Package Manager (PPM)

Perl Package Manager (PPM) is a tool that comes with the ActiveState Perl installation. It can be used to manage your Perl packages. After installing ActiveState Perl, you can start PPM (depends on the version, this can be done through the Start->Programs->ActiveState Perl, or from a command prompt, cd to the \bin, and run ppm). This will bring up a command prompt PPM dialogue. From this dialogue, type in:
install XML-DOM
This will install the XML::DOM module on your PC.

Using CPAN

This will work on any platform, any Perl version. Run the command:

perl -MCPAN -e shell
Refer to the CPAN documentation for more details on how to use this command.

Manual installation

This is only recommended if all else failed. You can unzip this distribution, and copy the entire CaCORE folder under the lib folder to the lib/site folder in your Perl installation folder. For example, assume that you unzip this distribution to C:\temp, and your Perl installation is in C:\Perl, you can open a command prompt and type:

copy C:\temp\CaCORE\lib\CaCORE C:\Perl\lib\site

Getting Started

You can find sample scripts in the examples folder. It contains examples for using CaBIO, EVS, and CaDSR objects. The CaBIO test example (caBIOtest.pl) contains multiple examples that illustrate the multiple search mechanisms implemented in CaCOREperl. If you successfully install CaCOREperl, you can run these example programs directly as a starting point.

CaCORE Object descriptions

Domain objects, such as gene, are represented as objects in CaCOREperl. All objects in CaCOREperl follows a set of identical patterns:

Details of each domain object can be obtained in the object description. Here we describe the general pattern that applies to all domain objects. Refer to index.html for description of CaCORE objects.

Package Name

Each domain object has a fully qualified name in the format of CaCORE::{Package}::{Object}. For example, gene has a fully qualified name of CaCORE::CaBIO::Gene.

Object Creation

A new instance of the object is created via the new method. The following code creates a new gene instance.

my $gene = new CaCORE::CaBIO::Gene;

Object Attributes

Each object contains a set of attributes. For example, gene has the following attributes: To set or retrieve the value of each attribute, there is a setter and a getter method. Since CaCOREperl is mainly a query application, in most cases, setter methods are used to set search criteria. Getter methods are used to obtain the details of an object after searches.

Object Associations

Each domain object is related to certain objects. For example, gene is directly related to the following objects:

The relationship between two objects can be one-to-many or many-to-one. For example, one Gene is related to multiple Pathway objects (one-to-many), and many Genes can be related to one Taxon (many-to-one).

All objects that are associated with the current object can be access via the getX (for many-to-one associations) or getXCollection (for one-to-many associations) methods. Where "X" is the name of the associated object. Example: $gene->getTaxon retrieves the Taxon object associated with the Gene object, since one Taxon object is associated with many Gene objects, and $gene->getPathwayCollection retrieves all the Pathway objects associated, with the Gene object. Since one Gene object is associated with many Pathway objects.

The following table is a description of all objects associated with Gene, how they are related, and the methods of retrieving them.
Gene associations
Association Object NameRelationshipGetter
ChromosomeMany to onegetChromosome
DatabaseCrossReferenceOne to manygetDatabaseCrossReferenceCollection
ExpressionFeatureOne to manygetExpressionFeatureCollection
GeneAliasOne to manygetGeneAliasCollection
GeneOntologyOne to manygetGeneOntologyCollection
GeneRelativeLocationOne to manygetGeneRelativeLocationCollection
GenericReporterOne to manygetGenericReporterCollection
HistopathologyOne to manygetHistopathologyCollection
HomologousAssociationOne to manygetHomologousAssociationCollection
LibraryOne to manygetLibraryCollection
LocationOne to manygetLocationCollection
NucleicAcidSequenceOne to manygetNucleicAcidSequenceCollection
OrganOntologyOne to manygetOrganOntologyCollection
PathwayOne to manygetPathwayCollection
ProteinOne to manygetProteinCollection
TargetOne to manygetTargetCollection
TaxonMany to onegetTaxon

Differences between Attributes and Associations

The following applies to all domain object packages, except for EVS objects, which is discussed in the following section. Attributes are generally used for: Associations, on the other hand, are generally used for querying purposes. You can not call the setter methods. The getter methods are searching methods. Under the hood, the getter methods invoke the ApplicationService search methods, which will make remote webservice calls to the caCORE server.

Lazy Fetch. caCORE server supports (except for EVS) the so called "lazy fetch" kind of searches. This means that when you query for certain objects, only the attributes of the objects are retrieved and returned. None of the objects associated with the target object(s) are returned. For example, when you call $gene->getPathwayCollection, the caCORE server only retrieves and returns all the pathway objects associated with the $gene object. It will not return any objects that are associated with the pathway objects. To retrieve those objects, you must make subsequent calls.

EVS Object Associations

EVS objects are a little different than objects of other packages.

Limitations

Since CaCOREperl completely depends on caCORE server, all limitations on the caCORE server, most notably the webservice API, are imposed on CaCOREperl as well. The most notable ones being:

More info

See More Resources for additional sources of information.