The Ensembl codebase is highly complex, consisting of many hundreds of modules. The following notes should help you begin to find your way around!
Web code directoriesThe following directories contain web-related code:
The following directories are typically replicated inside plugins in order to override "core" functionality:
See plugins (below) for instructions on how to configure plugins in Ensembl.
Any other directories in your checkout will contain the Perl API, and after server startup you will see some additional autogenerated directories used to cache images and other files.
modules/EnsEMBL/WebMost of the web code generated by the Ensembl web team lives in the EnsEMBL::Web namespace. You will not normally want to edit this code, but you can extend it by replicating the namespace in your own plugin and adding or overriding methods as required. See Extending the Ensembl web code for more details.
Througout this documentation, EnsEMBL::Web is frequently abbreviated to E::W to save space and typing!
URL routingEnsembl now uses URL routing, that is, URLs do not necessarily correspond to physical directories but are parsed into their components and passed to a generic script that constructs an appropriate page.
The exception to this is the static content, i.e. simple HTML pages used to hold documentation about the site and project - like this page. As a general rule, if the URL is in lower case, it is static content; if the "directories" have initial capitals, the page is dynamically generated.
A typical dynamic URL is shown below:
http://www.ensembl.org/Homo_sapiens/Gene/Summary?g=BRCA2
The URL is split on '/' into the following parts:
The parameters after the ? are handled as per normal CGI parameters; in this case, we have the name of the gene we want to display information about.
The URL is parsed in E::W::Apache::SpeciesHandler - this module should be left well alone unless you know exactly what you are doing!
Allowed scriptsIn order to determine what type of response a URL requires (full pages, HTML fragments etc.), the Type part of the URL is assigned a script, as follows:
This script definition takes place in the $OBJECT_TO_SCRIPT hash in conf/SiteDefs.pm (which can be extended in your plugin if you want to add data Types to Ensembl):
## ALLOWABLE DATA OBJECTS $OBJECT_TO_CONTROLLER_MAP = { Gene => 'Page', Transcript => 'Page', Location => 'Page', Variation => 'Page', StructuralVariation => 'Page', Regulation => 'Page', Marker => 'Page', GeneTree => 'Page', Family => 'Page', LRG => 'Page', Phenotype => 'Page', Experiment => 'Page', Info => 'Page', Search => 'Page', UserConfig => 'Modal', UserData => 'Modal', Help => 'Modal', };
The value is then used in E::W::Apache::SpeciesHandler to decide which child of E::W::Controller will be used to process the request.
PluginsThe Ensembl webcode is designed to be extensible, so that you can customize your own installation without your changes being overwritten when you update to a new release.
By creating your own plugin, you can completely change the available species, alter the colour scheme or page template, or add your own views and static content.
Public pluginsA selection of plugins are included as part of the standard Ensembl checkout, enabling you to include optional features in your site.
Most public plugins have a README file giving more detailed and up-to-date information on how to use them.
Plugins are used to complement the normal system of inheritance in object-oriented Perl. Whereas a child object can inherit methods from multiple parents, a parent object normally cannot be overridden by multiple children. The plugin system "aggregates" the contents of several methods into one "master" method that can then be used by mod_perl when rendering the webpage.
The module conf/Plugins.pm
controls which plugins are used by an instance of Ensembl and their order of precedence. In a standard Ensembl mirror, the module will define a plugin array as follows:
$SiteDefs::ENSEMBL_PLUGINS = [ 'EnsEMBL::Mirror' => $SiteDefs::ENSEMBL_SERVERROOT.'/public-plugins/mirror', 'EnsEMBL::Genoverse' => $SiteDefs::ENSEMBL_SERVERROOT.'/public-plugins/genoverse', # 'EnsEMBL::Solr' => $SiteDefs::ENSEMBL_SERVERROOT.'/public-plugins/solr', # 'EnsEMBL::Users' => $SiteDefs::ENSEMBL_SERVERROOT.'/public-plugins/users', 'EnsEMBL::Ensembl' => $SiteDefs::ENSEMBL_SERVERROOT.'/public-plugins/ensembl' 'EnsEMBL::Docs' => $SiteDefs::ENSEMBL_SERVERROOT.'/public-plugins/docs', ];
The plugins are processed in reverse order, starting with the last one.
Important note: Regardless of any changes you may make to your Ensembl website, you must check out all the Ensembl Perl API code, as the web code has extensive dependencies on all the API modules.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4