-
Notifications
You must be signed in to change notification settings - Fork 145
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
Anvi'o backend for 'genome view' #1712
base: master
Are you sure you want to change the base?
Conversation
Thanks @meren! While converting from test data to the new real data from external genomes, I realized it might be beneficial to not only store gene IDs for each gene cluster, but also have a data structure that maps individual gene IDs to gene clusters. For example:
This way we wouldn't have to apply a find operation to the |
Absolutely! I will add this ASAP. :) |
This is now done, @isaacfink21. Please note that the new data structure is slightly different. I hope this helps. |
As you can see from 530fe85 it took that much effort :) anvi'o has everything ready at all times! :p |
Thanks! This was much easier than I expected :) I will work on using this to fix gene cluster alignment. For future reference, I'm also attaching the screencaps from my meeting with @meren and @matthewlawrenceklein that illustrate some of the new features we plan to implement going forward. Some of these include:
|
@meren @isaacfink21 Not sure if this would be a major pain point on the backend or with what Isaac's already written, but would it be possible to change the There's also a very real chance I'm misunderstanding the data, so feel free to correct me : ) |
Hey @matthewlawrenceklein, do you think it is possible to 'arrayify' the data when it arrives? or is it a bad idea to do it that way? |
@meren totally doable on the front end. My only concern is that we'd want to make that change directly after the fetch req so that all front-end processes use the same array-ified Thinking a little further out - we would want (need?) to save these kind of front-end manipulations to state, correct? |
It is always great to think a little further out when it comes to these kinds of decisions! Thank you :) Just like the other interactive interfaces, I think we need to have a |
@matthewlawrenceklein Just reviewed the code and it shouldn't be a problem for the |
a5867c9
to
111e877
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't mean to force-push here, sorry about that--I restored the previous commit since there were some recent changes I accidentally removed
lots of activity here. I'm hoping to continue working on the backend next week. |
opting to disable all genome dragging and proportional scale functionality for v0. from this point forward, the `percentScale` flag should always be set to false
@matthewlawrenceklein, @mschecht, and I decided in our last meeting to disable genome dragging and proportional scale in v0 and keep this functionality under the feature flag To revisit this in the future, the genome ruler, background shades, and ADLs will need to be made selectable again, and the |
This reverts commit c044eb8.
Genome View: Genome Sliding and Gene Centering
IF THIS NOTE IS HERE, DO NOT MERGE THIS BRANCH. IT IS BROKEN AND WILL RUIN THE ACTIVE DEVELOPMENT BRANCH.
This PR introduces some preliminary backend functionality in anvi'o for 'genome view', a LOOOOONG-waited anvi'o functionality to interactively study large genomic contexts.
@isaacfink21 and @matthewlawrenceklein are already working on the frontend of genome view using some mock data, and the code in this branch will help them test things using real-world data, and figure out what would they like the backend to do for them when it comes to 'massaging' the data structures to their liking.
The most critical class here is
AggregateGenomes
inanvio/genomedescriptions.py
module. For a given set of external and/or internal genomes, the purpose of this class is to aggregate all sorts of information, which is then passed to the interactive world through bottle routes.When there is an anvi'o pan database that includes all genome names found in internal and/or external genomes files,
AggregateGenomes
also utilizes gene clusters found in that database to pass it to the interface so genes can be associated with one another.The class is simple in its design, and will have room for expansion based on our needs. I hope it makes sense so far.
Testing
The purpose of these examples is to make sure you can play with this code to connect its products with the frontend.
Cartoonishly Simple
Download this file and unpack, and run this command in the resulting directory:
FYI, This is how I created this file:
anvi-self-test --suite pangenomics -o PAN mkdir GENOME_VIEW_TEST_FILES cp PAN/pan_test/0*db PAN/pan_test/external-genomes.txt GENOME_VIEW_TEST_FILES/ cp PAN/pan_test/TEST/TEST-PAN.db GENOME_VIEW_TEST_FILES/PAN.db tar -zcvf GENOME_VIEW_TEST_FILES.tar.gz GENOME_VIEW_TEST_FILES/
Somewhat Realistic
Run these steps:
Now you can run this to get genome view data generated for 6 genomes that in the same 'species' WITHOUT the pangenome:
and WITH the pangenome:
Upon which this is what you should find in your JavaScript console:
Next steps
Fill in the following two files:
anvio/data/interactive/genomeview.html
anvio/data/interactive/js/genomeview.js
:)