Open laceysanderson opened 5 years ago
To provide good integration with this module, you would likely want to add this field in the tripal_jbrowse_page sub-module. This allows you to use a similar approach to that used on the main listing page.
Specifically, here is the code that pulls the list of jbrowse instances, removed private instances and builds the URL. I would put this in the field class for the new field.
Then this code in the page template formats that into links using the Drupal API.
For your case, you'll want to filter the instances by either organism or analysis id to determine which to show on a given page. Here is an example of how to filter by organism_id.
You'll likely want some extra methods in the field class to determine the organism_id or analysis_id based on the given page. Personally, I would do this by looking at the base chado table associated with the Tripal content type the field is attached to. Then you can set up rules based on that table and use the Chado Schema Documentation to determine what information is available to you.
It would be nice to have a field that creates a jbrowse link on specific organism and genome assembly (project-based or analysis-based). It would need to point to a different JBrowse for each page.
Perhaps we can collaborate with Staton Lab on https://github.com/statonlab/tripal_jbrowse_instance which can be used to add a JBrowse Link on a Tripal3 page?