UofS-Pulse-Binfo / analyzedphenotypes

Tripal/Drupal support for analyzed phenotypic data including data loaders, exporters, trait pages and summaries on germplasm pages.
GNU General Public License v2.0
0 stars 1 forks source link

How to add trait in tripal content types #133

Open cornellyujy opened 2 years ago

cornellyujy commented 2 years ago

Hi @laceysanderson , in our tripal, we have no trait in tripal content types section. I have to add trait in tripal content types. Here are my steps, and I am not if make sense.

step1. select cvterm as the trait table

image

step2. select All records that belong to a single controlled vocabulary

image

step3. select a controlled vocabulary

image

step4. create content types

image

For the step3, I am not sure which controlled vocabulary should be selected. You know last time you told me that the 3 CVs (traits, methods, and Units) should have one db, but I have created two types: 1 DB for the 3 CVs, and 3 DBs for 3 CVs. Now, if we cancel the 3 to 3, which db should be added. Thanks~

laceysanderson commented 2 years ago

Hello, those steps are right. As mentioned in the previous issue, I made a slight mistake and the 1DB for the 3 CVs is the correct approach. For the trait content type you will want to choose the CV you select for the traits to go in. The example used in the docs is “Phenotypic Traits: Tripalus” and your screenshot looks correct.

To double-check, go to the set-up ontologies page and check that the "Trait" CV selected (the top dropdown in that column; circled green in the following screenshot) matches the cv you selected for the Trait content type. setup 1 traitontologies

cornellyujy commented 2 years ago

Thanks Lacey. Yes. I created the trait content type in 'Tripal Contents Types' following above steps. When running the 'sudo drush trp-run-jobs' command, I got this error: image So, is there anything wrong when creating the 3 CVs in Admin > Tripal > Data Loaders > Chado Vocabularies > Manage Chado CVs?

I checked the steps for creating 3CVs, and the below figs are the panels for creating CVs image There is no information input. After creation, they have default information for the 3CVs: image image image And I noticed that the accessions were inputted into chado.dbxref table. I am not sure why it have default information: image Should I update the CVs first? Here is the trait CV. image How to fix the 'term name' and 'accession'. Thanks~

laceysanderson commented 2 years ago

Hi @cornellyujy,

Based on the screenshots above

The error you see when creating the content type:

Solution:

  1. On the command-line within your Tripal site run the following command to add any missing default terms: drush php-eval "ap_load_defaultontology();"
  2. Now navigate to the "Manage Fields" page for you Trait content type by clicking on "Structure" and then "Tripal Content Types" in your admin toolbar at the top of the page, then on the "manage fields" link beside the Trait Content Type.
  3. Finally click "Check for new fields" at the top of the page.

That should ensure you have all the fields added to your Trait Content Type and they will now have all the terms they need.

To play with Trait pages further you will want to "Publish" them so you can see the example content :-)

cornellyujy commented 2 years ago

Hi @laceysanderson , Thanks for your response. Now I have loaded the phenotypic data into chado table. You mean I should 'Publish' the trait pages. How to publish? I tried to publish, but failed. image Here is the drush command: image Thanks~

laceysanderson commented 2 years ago

I have never seen that before nor can I duplicate it on a fresh Tripal site. I am so confused as that error is implying that the vocabulary attached to that content type no longer exists... but your screenshots show it does.

Can you double-check that the vocabulary shown in the Tripal Content edit page for "Trait" is still available in your Chado database? Also, look in your pgAdmin at the chado_bundle table. There should be an entry in there where the bundle_id = that of your tripal content type (i.e. biodata[this is the bundle_id] ). The type_value of that content type should be the same as the cv_id for your "Phenotypic Traits: Cucurbita" CV.

cornellyujy commented 2 years ago

Thanks Lacey. I got it. I deleted the 'Phenotypic Traits: Cucurbita' after creating Trait content type. And recreated the Phenotypic Traits: Cucurbita, so the Trait can not get the new cv_id. I wondered that 'Phenotypic Traits: Cucurbita' was the only one phenotypic traits of Cucurbita and CuCurbita is one genus. So if I add new genus, should I create a new trait content type for the newly added genus? I am not sure if I am saying this clearly. I want to know if we can create a trait content type for all genus, not only for one genus. image For this example, it depend on the cv of only one genus. so this trait is a little hard to imply other genus. Or is there anything wrong when creating the trait. Thanks~

laceysanderson commented 2 years ago

I deleted the 'Phenotypic Traits: Cucurbita' after creating Trait content type. And recreated the Phenotypic Traits: Cucurbita, so the Trait can not get the new cv_id.

Exactly. Everything in Tripal and my modules use the keys so creating new will always break the connection.

I wondered that 'Phenotypic Traits: Cucurbita' was the only one phenotypic traits of Cucurbita and CuCurbita is one genus. So if I add new genus, should I create a new trait content type for the newly added genus?

Yes, there will be one "Trait" Content Type per genus. For example, in KnowPulse we have a "Lentil Traits" for Lens genus (with multiple species) and a "Common Bean Traits" for Phaseolus genus (again with multiple species).