Skip to content

Commit

Permalink
Fixed headers on dev guide
Browse files Browse the repository at this point in the history
  • Loading branch information
spficklin committed Aug 28, 2018
1 parent 83ef87c commit 851a747
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 23 deletions.
19 changes: 9 additions & 10 deletions docs/dev_guide/best_practices.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,41 +5,41 @@ Module Development Best Practice
If you create custom Tripal Modules, here are some best practices and suggestions.

The Drupal Devel Module
=======================
-----------------------


Before staring your development work, it is suggested that you download and install the `Drupal devel module <https://drupal.org/project/devel>`_. This module helps greatly with debugging your custom theme or module. A very useful function of this module is the dpm function. You can use the dpm function to print to the web page an interactive view of the contents of any variable. This can be extremely helpful when accessing Chado data in objects and arrays returned by Tripal.

Add your module to Tripal.info
==============================
------------------------------

Do your best to list and upate your modules at http://tripal.info/extensions.


Coding Best Practices
=======================
---------------------

Host your code on GitHub
-------------------------
^^^^^^^^^^^^^^^^^^^^^^^^

We recommend making your code open source and hosting it on GitHub. It’s free, it let’s people easily find, use, and contribute to your source code.

Associate the GitHub repository with Tripal
---------------------------------------------
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Once your module is on GitHub, consider joining the Tripal organization. Your lab group can exist as a team and maintain control over your code, but your projects will be listed in the main Tripal group.

If you’d rather not, you can still tag your project as Tripal by clicking on the Manage Topics Link at the top of your repository.

DOIs
--------
^^^^

When your module is release ready, why not create a Digital Object Identifier (DOI) for it with `Zenodo <https://zenodo.org/>`_? It’s free! Sync your github account and create a new release (Zenodo won’t find old releases). You can then display your DOI badge on your module’s page.

Additionally, there is a `Tripal Community group <https://zenodo.org/communities/tripal/>`_ on Zenodo. You can edit your record to associate your DOI with the Tripal community.

Testing and Continuous Integration
-----------------------------------
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

`Tripal Test Suite <https://github.com/statonlab/TripalTestSuite>`_ is a full-featured testing module that makes writing tests much easier. which will automatically set up a PHPUnit and Travis testing environment for you.

Expand All @@ -48,7 +48,7 @@ Testing and Continuous Integration


Documentation
--------------
^^^^^^^^^^^^^

Every repository can include a README file that will be displayed on the repository page. A README file should at a minimum include:

Expand All @@ -58,7 +58,6 @@ Every repository can include a README file that will be displayed on the reposit
Consider documenting your Code itself. Tripal documents in the `Doxygen style <http://www.stack.nl/~dimitri/doxygen/>`_ which allows documentation webpages to be automatically generated. Even if you don’t build HTML documentation, the in-line code documentation will be very helpful to contributors.

Coding Standards
-----------------
^^^^^^^^^^^^^^^^

Drupal has defined `coding standards <https://www.drupal.org/docs/develop/standards/coding-standards>`_ that Tripal modules should meet.

24 changes: 11 additions & 13 deletions docs/dev_guide/data_structures.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ This page explains the relationships between Entity types, Bundles (content type
* Entity Type: despite the confusing name, an entity type is simply a group of bundles that are somehow related. Drupal provides a "Node" Entity type that includes the Page and Article bundles. All of the Tripal bundles (content types) belong to the TripalEntity Entity type.


The following figure describes the heirarchical relationship between Drupal Entity types (e.g. Node) in comparison with TripalEntity entity types (e.g. Chromosome, Germplasm, etc.).
The following figure describes the heirarchical relationship between Drupal Entity types (e.g. Node) in comparison with TripalEntity entity types (e.g. Chromosome, Germplasm, etc.).


.. figure:: /_images/dev_guide/data_structures/Terminology-Diagram.png
Expand All @@ -24,36 +24,34 @@ Furthermore, fields are "attached" to a Bundle and hold unique values for each E
.. figure:: /_images/dev_guide/data_structures/Tripal-Semantic-web.png
:scale: 50 %
:alt: Semantic web



Bundles (Content Types)
=======================
-----------------------

Bundles are types of content in a Drupal site. By default, Drupal provides the Basic Page and Article content types, and Drupal allows a site developer to create new content types on-the-fly using the administrative interface--no programming required. Tripal also provides several Content Type by default. During installation of Tripal the Organism, Gene, Project, Analysis and other content types are created automatically. The site developer can then create new content types for different biological data--again, without any programming required.

In order to to assist with data exchange and use of common data formats, Tripal Bundles are defined using a controlled vocabulary term (cvterm). For example, a "Gene" Bundle is defined using the Sequence Ontology term for gene whose term accession is: SO:0000704. This mapping allows Tripal to compare content across Tripal sites, and expose data to computational tools that understand these vocabularies. You can create as many Tripal Content Types as you would like through Administration > Structure > Tripal Content Types provided you can define it using a controlled vocabulary term.
In order to to assist with data exchange and use of common data formats, Tripal Bundles are defined using a controlled vocabulary term (cvterm). For example, a "Gene" Bundle is defined using the Sequence Ontology term for gene whose term accession is: SO:0000704. This mapping allows Tripal to compare content across Tripal sites, and expose data to computational tools that understand these vocabularies. You can create as many Tripal Content Types as you would like through Administration > Structure > Tripal Content Types provided you can define it using a controlled vocabulary term.

By default, Tripal uses Chado as its primary data storage back-end. When a bundle is created, the Tripal Chado module allows you to map a Bundle to a table in Chado. Thus, any content type desired can be define as well as how it is stored in Chado--all using the administrative interface.
By default, Tripal uses Chado as its primary data storage back-end. When a bundle is created, the Tripal Chado module allows you to map a Bundle to a table in Chado. Thus, any content type desired can be define as well as how it is stored in Chado--all using the administrative interface.

Entity
======
------

An entity is a discrete data record. Entities are most commonly seen as "pages" on a Drupal web site and are instances of a Bundle (i.e content type). When data is published on a Tripal site such as organisms, genes, germplasm, maps, etc., each record is represented by a single entity with an entity ID as its only attribute. All other information that the entity provides is made available via Fields.
An entity is a discrete data record. Entities are most commonly seen as "pages" on a Drupal web site and are instances of a Bundle (i.e content type). When data is published on a Tripal site such as organisms, genes, germplasm, maps, etc., each record is represented by a single entity with an entity ID as its only attribute. All other information that the entity provides is made available via Fields.

Fields
=======
------

A field is a reusable "data container" that is attached to a Bundle. Programmatically, each field provides one or more primitive data types, with validators and widgets for editing and formatters for display. Each field independently manages the data to which it assigned. Just like with Bundles, Fields are also described using controlled vocabulary terms. For example, a gene Bundle has a field attached that provides the name of the gene. This field only provides the name and nothing more. Tripal uses the `schema:name <http://schema.org/name>`_ vocabulary term to describe the field.
A field is a reusable "data container" that is attached to a Bundle. Programmatically, each field provides one or more primitive data types, with validators and widgets for editing and formatters for display. Each field independently manages the data to which it assigned. Just like with Bundles, Fields are also described using controlled vocabulary terms. For example, a gene Bundle has a field attached that provides the name of the gene. This field only provides the name and nothing more. Tripal uses the `schema:name <http://schema.org/name>`_ vocabulary term to describe the field.

Field Instances
================
---------------

Fields describe "atomic" units of data that are associated with an entity. For example, a "name" is an atomic unit of data about a Gene or Organism entity. Fields can be reused for multiple Bundles. For example, gene, mRNA, genetic markers and variants all have name data. Despite that all of these Bundles provides a "name", we only need one field to describe that this data is a "name". However, we may want to customize a field specific to each bundle. Therefore, an Instance of a field is attached to a bundle, and field instances can then be customized differently. The most important customization is the one that defines the Chado table from which the data for a field is retrieved. Despite that field instances are attached to bundles, they become visible with Entities. When an entity is loaded for display, Drupal examines all of the fields that are attached to the entity's bundle, and then populates the fields instances with data specific to the entity being loaded.

Entity Types
=============
------------

An entity type is simply a group of Bundles that have some similarity. For examples Drupal provides a Node entity type. The Node entity type contains the Basic Page and Article Bundles. Tripal v2 expanded the Node entity type when creating new content. Tripal v3, however, uses an a new entity type named TripalEntity that provides the Organism, Gene, Analysis, etc. content types. Using these new entity types provides a a more responsive solution then the Node entity type, is more flexible, and supports the new ontology-driven approach of Tripal v3.


0 comments on commit 851a747

Please sign in to comment.