Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integration with JBrowse2 by providing a config.json via URL #78

Merged
merged 4 commits into from
Apr 19, 2024

Conversation

carolyncaron
Copy link
Contributor

Issue #63 & #67

The previous milestone on 4.x embedded a JBrowse2 instance by providing the configuration files (assemblies and tracks, separately) locally at a specific filepath, but there was not a way to provide these needed files when creating the instance through the interface. This PR sets out to do that, but with the common single configuration file (ex: config.json) that is normally associated with JBrowse2 instances.

Specific tasks implemented:

  1. The previous "JBrowse URL" field that prompted for a JBrowse instance's full URL was converted to a URL field for its configuration file instead. Commit f9822e5
  2. The "JBrowse version" field has been removed, since this field implied that JBrowse 1 is currently supported. Since the JBrowse1 is no longer being actively maintained, we aren't putting in the effort at this time to test and ensure it is supported. Commit e309dd2
  3. A new field has been provided for setting the default start location for the embedded JBrowse2. The default behaviour is that the user will be prompted to select a chromosome before seeing the linear genome view. Commit e309dd2
  4. The 2 fields mentioned in 1) and 3) are now being provided to the application by being added as variables in drupalSettings and then accessing them using AJAX. Commit bdb4f91 and e309dd2

Example

The embedded JBrowse2 page: Screenshot 2024-04-18 at 6 19 17 PM

The form:
Screenshot 2024-04-18 at 6 20 53 PM

NOTES:

  • A thorough tutorial on how to utilize this functionality is in progress and will be in a separate PR.
  • This functionality is currently limited to displaying a linear genome view for one assembly at a time

Testing

  1. Clone this repository and switch to the branch tv4-renderJBrowseFromURL
  2. Build the docker using the following commands:
docker build . --tag=tripal_jbrowse:latest
docker run -dit --name=tripaljbrowse --publish=80:80 --volume=`pwd`:/var/www/drupal/web/modules/contrib/tripal_jbrowse tripal_jbrowse:latest
docker exec tripaljbrowse service postgresql restart
  1. Go to http://localhost and log in using the credentials in the Tripal Docker docs
  2. Go to Administration > Tripal > Content > +Add Tripal Content to manually create an Organism and Genome Assembly
  3. Go back to the Tripal content page and click on +Add jbrowse instance under the tab JBrowse Instances.
  4. Fill out the JBrowse Configuration URL field by:
    • Providing a valid URL to a configuration file in JSON format.
    • If you do not have a configuration file hosted anywhere, you can borrow one from the test_data/ folder in the JBrowse2 repo. Copy it into your clone of this repository (For ex: cp config.json tripal_jbrowse/). Now check the file exists at the following URL, assuming your docker is on port 80: http://localhost/modules/contrib/tripal_jbrowse/config.json
    • Note that your config.json will need to pull data for reference sequence and tracks from valid URLs, otherwise the files need to also be hosted within your cloned repo.
  5. Set a default location using the format [chr][start pos]..[end pos] or a the name of a feature in a feature track of your config.json.
  6. Select the Organism and Genome Assembly you created in step 4 from their respective dropdowns in the form
  7. Also test by leaving the 2 new fields blank. Expected behaviour:
  • The JBrowse Configuration URL field should complain about not being left empty, and should not let you save the form.
  • The Default Start Location field can be left empty, and your JBrowse instance should look similar to this:
Screenshot 2024-04-18 at 6 18 16 PM

Copy link
Member

@laceysanderson laceysanderson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked the honeybee, human and tomato demo json from the jbrowse repository --all worked as expected 🎉 Note: I did get a note for the honeybee that the chromosome sizes file was missing, once I popped that in my localhost it still says that this file cannot be provided via URL so that's something to keep in mind/document.

Also, I confirmed that the location can be blank but the url cannot be:
Screenshot 2024-04-19 at 9 52 25 AM

The field will allow you to enter a url for config that doesn't exist or that is the wrong format. This is what you see in both those cases:
Firefox_Screenshot_2024-04-19T15-54-21 934Z

Honeybee

honeybeeEmbedded

Tomato

tomatoEmbedded

Human

humanEmbedded

templates/jbrowse-instance.html.twig Outdated Show resolved Hide resolved
Revert height to 100%

Co-authored-by: Lacey-Anne Sanderson <laceyannesanderson@gmail.com>
@carolyncaron
Copy link
Contributor Author

Thanks Lacey! The form is definitely missing some validation for the new fields (I was thinking the start location field could check that an appropriate format is given as well), so I'll create a new issue for that!

@carolyncaron carolyncaron merged commit 772f6f7 into 4.x Apr 19, 2024
@carolyncaron carolyncaron deleted the tv4-renderJBrowseFromURL branch April 19, 2024 19:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants