Before installation of Tripal, you must first have a working Drupal installation. Please see the previous section of this tutorial for step-by-step examples for server setup and Drupal installation instructions. After installation of Tripal, you may install any Tripal extension modules you may want. Please see the Extension Modules section for further details.
Tripal v2.x requires the Drupal Views module which in turn requires the CTools module. Modules can be installed using the graphical Drupal website by clicking on the Modules link in the top adminstrative menu bar. Instructions for instaling Modules via the web-interface can be found here: https://www.drupal.org/documentation/install/modules-themes/modules-7. However, Drush can be quicker for module installation. The following instructions will show how to install a module using the Drush command-line tool.
First, install the CTools module. We will download the current version using the drush command. On the command-line, execute the following:
cd /var/www/html/sites/all/modules drush pm-download ctools
Typically for all module installation we should check the README for additional installation instructions. Next, enable the module using a drush command:
drush pm-enable ctools
Next, download and install the Views module in the same way:
drush pm-download views drush pm-enable views views_ui
The easiest way to download Tripal is to use the Drush command-line interface for Drupal. If you do not have Drush please see the Drush installation section of this tutorial. To download using drush follow these steps:
- Chage directories to your Drupal installation
- Execute the following drush command
drush pm-download tripal
Alternatively, you can download Tripal using the Drupal web interface as per the instructions provided on the Installing modules documentation at Drupal.org. The Tripal project page at Drupal.org can be found here: https://www.drupal.org/project/tripal.
There is a bug in the Drupal Views 3.0 code that prevents Tripal's administrative and search data views from functioning. The patch is provided within the tripal_veiws module. To apply the patch execute the following:
cd /var/www/html/sites/all/modules/views patch -p1 < ../tripal/tripal_views/views-sql-compliant-three-tier-naming-1971160-22.patch
a bug exists in Drupal related to the bytea data type in PostgreSQL. please execute the following commands to patch Drupal and apply the fix. The command below first downloads the patch from the Drupal website and then applies it:
cd /var/www/html wget --no-check-certificate https://drupal.org/files/drupal.pgsql-bytea.27.patch patch -p1 < drupal.pgsql-bytea.27.patch
The process for enabling the Tripal modules is the same as for the ctools and views modules that were enabled previously. To install the core Tripal package, enter the following command:
drush pm-enable tripal_core
Now that the core module is enabled, A new 'Tripal' menu item appears at the top.
Next, we must next install Chado. In the web browser, navigate to Tripal → Setup Tripal → Install Chado Schema. Because this is a fresh install, select the option to install Chado v1.2 and click the button Install/ugrapde Chado
After the button is clicked a message will appear stating "Job 'Install Chado v1.2' submitted. Check the jobs page for status". Click the jobs page link to see the job that was submitted:
The job is waiting in the queue until the Tripal jobs system wakes and tries to run the job. The jobs management subsystem allows modules to submit long-running jobs, on behalf of site administrators or site visitors. Often, long running jobs can time out on the web server and fail to complete. The jobs system runs separately in the background. In the example above we now see a job for installing Chado. The job view page provides details such as the name of the job, dates that the job was submitted and job status.
Jobs in the queue can be executed in two ways:
- Manually through a command-line call
- Using the UNIX cron to automatically launch the command-line
When we installed Drupal we installed a Cron job to allow the software to run housekeeping tasks on a regular bases. Tripal needs a cron entry as well to allow for regular execution of jobs in the queue. We will need to add a second cron entry:
sudo crontab -e
Add this line to the crontab
0,15,30,45 * * * * (cd /var/www/html; drush trp-run-jobs --user=administrator ) > /dev/null
This entry will run the Tripal cron every 15 minutes as the administrator user. For this tutorial we do not want to wait 15 minutes at the most to execute our jobs. So, we will run the jobs manually. Tripal supports Drush and therefore has it's own commands. We can use drush to manually launch the job:
cd /var/www/html drush trp-run-jobs --user=administrator
As the installation of Chado proceeds, we should see the following text in the terminal window. The final message indicates that the installation of Chado was successful:
Tripal Job Launcher Running as user 'administrator' ------------------- Calling: tripal_core_install_chado(Install Chado v1.2, 1) Creating 'chado' schema Loading sites/all/modules/tripal/tripal_core/chado_schema/default_schema-1.2.sql... Install of Chado v1.2 (Step 1 of 2) Successful! Loading sites/all/modules/tripal/tripal_core/chado_schema/initialize-1.2.sql... Install of Chado v1.2 (Step 2 of 2) Successful. Installation Complete
Also, we see that the job has completed when refreshing the jobs management page:
Now that Chado is installed, we can continue with installation of the remaining Tripal modules. These modules should be installed in the following order one at a time. If you install them all at once you may encounter errors later. Install the modules in the following way (and order):
drush pm-enable tripal_views drush pm-enable tripal_db drush pm-enable tripal_cv drush pm-enable tripal_organism drush pm-enable tripal_analysis drush pm-enable tripal_feature
There are more Tripal modules that can be enabled (e.g. tripal_project, tripal_stock, etc.).
The Tripal modules create directories in the /var/www/html/sites/default/files directory. By default, Drupal expects the 'sites/default/files' directory to be writeable by the web server. Because we installed the Tripal modules using Drush we need to reset the permissions for the web user. Execute the following command to give the web user group permission to write to that directory
sudo chgrp -R [group] /var/www/html/sites/default/files sudo chmod -R g+rw /var/www/html/sites/default/files
Where [group] is the group used by the web seriver. This will be 'www-data' by default for Ubuntu installations and 'apache' for CentOS installations.
Controlled Vocabularies: Installing CVs
Before we can proceed with populating our Chado table with genomic data we must first load some controlled vocabularies (i.e. ontologies). To do this, navigate to Tripal → Chado Data Loaders → OBO File Loader. Selecting an ontology from the Ontology OBO File Reference drop down (such as the 'Sequence Ontology'. You'll see the following page:
The Ontology loader will allow you to select a pre-defined ontology from the drop down list or provide your own to be loaded. If you provide your own, you give the remote URL of the OBO file or provide the full path on the local web server where the OBO file is located. In the case of a remote URL, Tripal first downloads and then parses the OBO file for loading. If you do provide your own OBO file it will appear in the saved drop down list for loading of future updates to the ontology.
For this tutorial, we need to install these ontologies:
- Chado feature properties
- Sequence ontology
- Gene ontology.
Do so by selecting an ontology from the drop-down and clicking the Load Vocabulary button. Repeat this process for each of the four ontologies. You'll notice each time that a job is added to the jobs subsystem. Now manually launch these jobs
cd /var/www/html drush trp-run-jobs --user=administrator
Note: Loading the Gene Ontology will take several hours. Also, recently the Gene Ontology has introduced cycles into their vocabulary tree. This causes a loading error which Tripal developers are working on. Loading of the Gene Ontology works well enough to continue with the tutorial and to have the terms loaded. However the ability to find all children of any term will not work. This is needed by some tools.
Because we are logged on to the site as the administrator user we are able to see all content. However, Drupal provides user management and permissions tools that allows the site admin to set which types of users can view the content on the site. By default there are two types of users anonymous and authenticated users. For this tutorial we want to set permissions so that anonymous visitors to the site can see the genomic content. To do this, navigate to People → Permissions. Here you will see permissions for all types of content.
Permissions for content added by Tripal can be found in two places. First, you can find permissions for creating, editing or deleting content of type 'feature', 'analysis', etc. under the Node section. You can assign these permissions for users to edit their own content or the content added by others. Second, each Tripal module has a set of permissions specific to the module. Each module has it's own set of permissions to customize, for example, there are a Tripal Analysis, Tripal Feature, Tripal Organism, etc sections. Here you can provide permissions to allow users to view content or administer the content. For this tutorial, be sure to set the following permissions under the Tripal module sections to allow anonymous and authenticated users (providing a password) users to view the content created in this site.
- View Analyses
- View Features
- View Organisms
Each time you install a new module you should always check the Permissions page and set any new permissions that may have been added by the new module.