Creating Content Types

Page Sections

Another great new feature of Tripal v3 is the ability to create custom Tripal Content Types through the Administrative user interface! In Tripal v3, all content types are defined by public ontology terms. This has a number of advantages:

  1. Facillitates sharing between Tripal sites,
  2. Provides a clear indication of what content is available in your site,
  3. Makes content creation more intuitive (add a "Gene" rather then a "feature")
  4. Allows complete customization of what data types your site provides
  5. Integrates tightly with web services allowing Tripal to adhere to RDF specifications

So, now that the sales pitch is over ;-), how do you go about creating your own Tripal Content Types?

Find an Ontology Term

This is likely the most difficult step as it seems ontologies are both plentiful and sparse at the same time. We highly recommend discussing your content with the community so that the same term can be used across Tripal sites for the same data. If your data is genomics based, you need look no further than the sequence ontology. The following table lists some terms that we recommend for common genomic data:

Term Name Accession Examples Comments
genome SO:0001026 specific genome assembly There are a couple of ways you might choose to store genome assemblies in Chado: 1) the analysis table and link to chromosomes using the analysisfeature table, 2) the feature table linking it to chromosomes via the feature_relationship table, 3) the project table and link to chromosomes using the project_feature table. There is still discussion in the community about which one of these three is the best method.
chromosome SO:0000340   Think carefully about whether it's useful to provide pages for chromosomes. The typical fields provided for content stored in the Chado feature table such as relationship and sequence listing can cause long page loads for not very useful information. Thus if you are going to provide pages you might want to include more summary fields based on materialized views to provide more useful content to users.
supercontig SO:0000148   This term is a synonym for scaffold and should be used for such
contig SO:0000149    
gene SO:0000704    
mRNA SO:0000234    
sequence_variant SO:0001060 SNP, MNP, Indel We recommend grouping all variants into a single content type in order to provide a common page layout across variant types and to make searching across variants (e.g. show me all variants in a given region) easier. This also makes it easier to support new variant types in the future.
genetic_marker SO:0001645 KASP, Exome Capture, GBS We recommend grouping all genetic markers for the same reasons we recommend grouping all sequence variants. You can then specify the type of variant or marker in the featureprop table.

For non-genomic data, this task becomes more difficult as both the number and maturity of the ontologies available is decreased. Please open up an issue on our GitHub project page to encourage discussion among the community for the ideal term. Not only will this provide you with help and input in your own search for an ontology term, it will also help others with similar data. We intend to add to this page once decisions are made for other data types to make this process easier and encourage sharing of data between Tripal sites.

Once you've choosen a term to describe your content type, you can either load the ontology containing it if you think other terms might be useful or add the single term. To load an external ontology see the Controlled Vocabularies section of the tutorial. For adding a single term, navigate to Tripal → Data Loaders → Chado Controlled Vocabularies then click the Add Vocabulary link to first add the vocabulary containing your term. Then navigate to Tripal → Data Loaders → Chado CV Terms then click the Add Term link to add the term.

Creating a Tripal Content Type

Start by navigating to Structure → Tripal Content Types and then click on the Add Tripal Content Type link at the top. This will take you to a form that leads you through the process of creating a custom Tripal Content Type. First, enter for the name of the term you would like to use to describe your content in the Content Type autocomplete textbox (e.g. genetic_marker). This term cannot be changed later so make sure you put a lot of thought into it in the previous step. Then click Lookup Term. This should bring up a list of matching terms from which you can select the specific term you would like to use.

It will also bring up a section to specify which Chado tables you want the data for this content type stored in. Since genetic markers are sequence features, we would like to store them in the chado feature table. One you select the Chado table, the form will update with a number of leading questions to determine how to tell which records in a chado table belong to a given content type. Specifically, the following options are supported if the appropriate fields/tables are available:

  1. All records in the table belong to the current content type (e.g. organism)
  2. Records in the table where the type_id matches the content type term belong to the content type (e.g. genetic_marker)
  3. Records in the primary table that have a specific property stored in an associated *prop table (e.g. Genotyping Projects)
  4. Records in the primary table that have a specific annotated term in an associated *_cvterm table

For genetic markers, we can simply use the type_id to differentiate which records in the feature table are genetic markers. Thus we

  • Select "No" not all records in the feature table are genetic markers
  • Type Column: type_id

Then click Create Content Type to create a custom genetic marker content type.

Once you create a custom content type, you can create pages of that type for your users either through the create tripal content user interface as we did for organisms or by loading your data into chado and then publishing it like we did for genes and mRNAs.