Welcome to Tripal Country!
This is a short guide to demonstrate how to create new bundle types with Chado storage in Tripal 3. It was originally written as instructions for my Tripal Alchemist module. There is a similar guide on tripal.info which you can also review.
For the purposes of this demo, let us assume that we have a custom module for storing proteomic analyses. Our module had a custom node, analysis_proteome, and after migrating to Tripal 3, all those nodes were converted to one generic analysis type.
Before we begin, let's pick an appropriate CVterm for our bundle. The ideal term will be specific enough to not overlap with other content, but broad enough to work for other users who might download your module. For example, we wouldn't want to say "flatworm proteome analysis" when "proteome analysis" works just as well. I recommend using the EBI Ontology Lookup Service. In our case, I've found a reasonable term in the OBI ontology: protein expression profiling .
Next, make sure the term is in your database. If you've already loaded the entire CV or ontology you found your term in, you can skip this step. Otherwise, go to /admin/tripal/loaders/chadovocabs/chadocvterms in the admin menu and select + Add Term. Be sure to fill out the CV, DB, accession, and Term Name fields correctly: for a detailed guide on this topic, please see the guide available in the Tripal Fields Generator Tool.
After finding an appropriate CVterm, use the chado cvterm loader to insert it if not already present in your database.
A note: if you are stumped, or can't seem to find a good CVterm, you can use the local CV, but this is discouraged.
Now that we have a CVTerm for our bundle, let's add it to Tripal. You can add a new Tripal Content Type (Bundle) by navigating to Structure -> Tripal Content Types -> Add Tripal Content Type in the admin menu. To fill out this form, we need to know our CVterm, what Chado base table our bundle uses, and how the content type is differentiated if the table is shared. In the case of our demo Protein Expression Profiling bundle, we know that it is one of several content types using the Analysis Chado base table.
You can create new Tripal Content Types (bundles) via the admin panel by navigating to Structure -> Tripal Content Types.
First, assign your term to your bundle. You should have a term in the Matching Terms box after pressing Lookup Term.
There are three possible storage configurations for your bundle.
analysisprop, but it could also be
Tripal will automatically make suggestionsfor where to store the type based on your Chado schema.
In this example, we specify our bundle type in the analysisprop table. There is a property associated with our analysis via this table where the typeid matches the cvterm we specify (Analysis Type), and the corresponding value should be tripalprotein_expression.
For our Protein Expression Profiling bundle, we want to use the
analysisprop table. Tripal (and Tripal Alchemist!) will look for entries in the analysis table that have a property in the analysisprop table where typeid = the cvterm for the type (Analysis Type in this case). Tripal will know that the analysis is a Protein Expression Profiling if the
value column of that property is equal to the text we specified: `tripalprotein_expression`. For analyses created by modules, this is the convention: set the Analysis Type cvterm equal to the module name.
Now that our bundle exists, we can create new content directly by going to Content -> Tripal Content -> + Add Tripal Content.
If you've already got Tripal 2 nodes for your content, you can migrate them using the core migrator available at Tripal -> Data Storage -> Chado -> Migrate. Analyses will all migrate to the Analysis content type, so you can use Tripal Alchemist to migrate your content from Analysis to the new bundle type. For our demo, this would be Protein Expression Profiling.