| Literature DB >> 30295719 |
Bradford Condon1, Abdullah Almsaeed1, Ming Chen1,2, Joe West1, Margaret Staton1.
Abstract
Tripal community database construction toolkit utilizing the content management system Drupal. Tripal is used to make biological, genetic and genomic data more discoverable, shareable, searchable and standardized. As funding for community-level genomics databases declines, Tripal's open-source codebase provides a means for sites to be built and maintained with a minimal investment in staff and new development. Tripal is ultimately as strong as the community of sites and developers that use it. We present a set of developer tools that will make building and maintaining Tripal 3 sites easier for new and returning users. These tools break down barriers to entry such as setting up developer and testing environments, acquiring and loading test datasets, working with controlled vocabulary terms and writing new Drupal classes.Entities:
Mesh:
Year: 2018 PMID: 30295719 PMCID: PMC6147213 DOI: 10.1093/database/bay099
Source DB: PubMed Journal: Database (Oxford) ISSN: 1758-0463 Impact factor: 3.451
Key Drupal vocabulary and concepts
|
|
|
|
|
|---|---|---|---|
| Entity types (Tripal entity type) | A generic container that defines a type of content. All Tripal content is of the TripalEntity type. | TripalEntity type, Page | Node |
| Bundle (Tripal content type) | An implementation of an entity type to which fields can be attached. | Organism | Node content type |
| Field | A piece of content that can be used in multiple bundles. | Common name, Genus, Species | |
| Entity | A particular instance of a Tripal Content Type. | A specific entry, such as the organism | Node |
An entity type is essentially a generic container that defines a type of content, while a bundle is a more specific subtype that includes fields. For example, Drupal has a page entity type, with bundles for more specific types of pages, for example, a blog post or an article. These bundles include fields that define a smaller unit of content associated with a bundle. In the case of the blog post, fields would include a title, the author, the date it was posted and the body of the article. An entity is a piece of specific content, such as a specific blog post. In Tripal, examples of bundles would include units of content such as gene or organism. Fields would include gene name or genus and species. A single species, such as Fraxinus excelsior, would be an entity
Tools presented in this paper
|
|
|
|
|
|---|---|---|---|
| Tripal Alchemist |
| DOI: | Convert Tripal Chado entities from one bundle to another. |
| TripalDock |
| DOI: | Build, deploy and manage Tripal docker sites. |
| Tripal DevSeed |
| DOI: | Lightweight dataset for module and site testing. |
| Docker images |
| DOI: | Rapidly deploy single container pre-built Tripal sites. |
| TFG |
| DOI: | Easily write custom fields with CVterms. |
| Tripal Test suite |
| DOI: | Add PHPUnit and CI testing with a single command |
Commands provided by Tripaldock
|
|
|
|---|---|
| new | Create a new container. |
| up | Start the Tripaldock container. |
| down | Stop the Tripaldock container. |
| rm | Remove and destroy the Tripaldock container. |
| ssh | Interactive shell access to the container. |
| logs | Access the logs of various services running inside the container. |
| install | Equivalent to drush pm-enable tripal_module. Allows users to install modules from outside the container. (Drush is a command line shell for Drupal) |
| drush | Run drush commands from outside the container. |
Developer dataset contents
|
|
|
|
|
|---|---|---|---|
| sequences | Core | FASTA | 200 CDS sequences and their corresponding polypeptide sequences. |
| gff | Core | GFF | GFF3 describing gene, mRNA, exon, CDS and five/three prime UTR regions for landmarks containing the above 200 CDS sequences. |
| blast | tripal_analysis_blast | XML | BLAST annotations for CDS sequences against Swiss-Prot and TrEMBL database. |
| interproscan | tripal_analysis_interpro | XML | Interproscan annotations of polypeptide sequences. |
| kegg | tripal_analysis_kegg | TSV | KEGG annotations generated by the KEGG KOALA tool. |
| biosamples | tripal_analysis_expression | ncbi xml | Randomly generated NCBI XML formatted biosamples. |
| expression | tripal_analysis_expression | TSV | Randomly generated expression data for the above biosamples. |
| database_backups | NA | SQL | PostgreSQL database dump of all loaded biomaterials, facilitating one-step loading of a database. |
| tree | Core | Newick | Newick format tree generated from MAFFT-aligned CDS |
Tripal Test suite Features
|
| ||
|---|---|---|
| Shell command | Description | |
| init | Generates folders and files for PHPUnit testing and Travis CI. The PHPUnit environment bootstraps your Drupal site, tests and provides access to the TripalTestCase class. The .travis.yml file bootstraps a Tripal site in the Travis environment, enables the module and runs tests. | |
| make:test | Creates a new namespaced Tripal Test in /tests/ | |
| make:seeder | Creates a new database seeder class. Seeders allow a new site to be quickly populated with a consistent dataset. | |
| Db:seed [seeder] | Seeds the database with example data defined by seeder classes. If no seeder argument is specified, all seeds will run. | |
|
| ||
| Feature | Usage (PHP) | Description |
| Transactions | use DBTransaction; | A PHP trait that wraps each test in the class in a transaction, undoing all changes to the database. This ensures that each test has a ‘known’ database state and that the developer’s site is not modified when testing. |
| Factories | $features = factory('chado.feature', 100)->create(); $this->publish('feature'); | Creates Chado records. Arguments can be passed to specify the values of specific columns, or how many records to create. Combined with transactions, developers can easily define transient Chado data for their tests. The publish method generates entities for the specified records. |
| HTTP Requests | $response = $this->get('/'); | Tripal Test Suite’s HTTP methods allow you to call site URLs and confirm that the response and page content is as expected. Supported methods are GET, POST, PUT, PATCH and DELETE. |
| Silencing console | $output = silent(function() { | Tripal commands often output status messages to the console. When running large suites of tests, it is desirable to silence these messages so that test failures are not lost in status messages from passing tests. The silence method allows developers to prevent console messages, while providing methods to verify the messages are output. |
Figure 1The Tripal Alchemist administrator tool. The Tripal Alchemist administrator interface. To convert entities, the administrator must first select a transformation method (top). In this example, choosing the manual method allows conversion of selected entities from a source type to a destination type (middle). The available source entities are then presented in a table (bottom), which the user can select from and submit.
Figure 2Input and output for TFG. The command line program prompts the user to provide a series of inputs (A) and checks the database to determine if the specified controlled vocabulary term exists. If it does, the software produces a set of files in the correct directory structure to generate the field (B). An example is given using the ‘Geographic location’ term from the Gazetteer vocabulary for a mock module named Tripal_Biosample (C). This demonstrates how the user’s inputs are structured into the file names. These inputs are also used to build all the necessary code variables and functions in each file, leaving only the essential custom coding for the function bodies for the developer to finish.