Implementation
The so__transcript
field is only ever attached to a gene. The entity that is passed into the field is the gene entity (feature_id belongs to the gene).
Dynamic Gene Pages
- Work on branch named
100-tv3-gene_pages
- Let's use the orange data that comes with the Tripal Tutorial
so__transcript.inc
file: (Stephen)
- Add the following in the
$default_instance_settings
- Implement the
instanceSettingsForm
function
- This function allows the site admin to specify which fields should be automaticaly attached to each transcript when it is viewed.
- Get list of fields that can be attached to an 'mRNA' content type
- List them all as a checkboxes.
- Add an update function to the
tripal_chado.install
file that will force Drupal to see the new $transcript_fields
setting for the so__transcript
field. (Stephen)
so__transcript_formatter.inc
view()
function:
- Iterate through each transcript (mRNA):
- Iterate through each field in the
$this->instance['settings']['transcript_fields']'
variable.
- use the
field_info_field
function to get field ID. Save all field IDs in an array
- Load an entity object for the mRNA using the
tripal_load_entity()
function. pass in the list of field IDs to include with the entity.
- Iterate through the each field again and render it using the following code
- These are field names that can be used for testing. To get the list of fields use this code:
- Display considerations
- Check the cardinatlity of a field.
- If it has a cardinality of 1 it should go into a table that will appear at the top of the fieldset
- If it has a cardinality > 1 then we let the field display as it wants to but we need to add some sort of header with a title and description.
- If the content type is setup to hide fields with no values then we need to honor that for fields with no values. <ksbuble note: if the field is required, then it is still shown with no value>
- for full details under each transcript add link to mRNA page.
- If time permits
- test this with the JBrowse module
Code Helps
Fieldsets
Here's some code to create a working fieldset outside of a Form. By default fieldsets don't open and close if they are not in a form.
Sequence Field (Stephen)
- Add an option to get FASTA formatted sequences.
- The sequence record field seems to not be working on the demo site
- The accessionedtime field is always the current time.
- Code issue with the GFFloader and PHP 7.0