GMOD / Apollo

Genome annotation editor with a Java Server backend and a Javascript client that runs in a web browser as a JBrowse plugin.
http://genomearchitect.readthedocs.io/
Other
128 stars 85 forks source link

clicking on a jbrowse URL link when logged-in causes error that hinders placement #1331

Closed nathandunn closed 7 years ago

nathandunn commented 8 years ago
IFrame.js:2 dojox.form.uploader.plugins.IFrame has been removed. You can
use Uploader directly and it will contain all necessary
functionality.(anonymous function) @ IFrame.js:2
main.js:79 loaded WebApollo plugin
main.js:40 plugin HideTracksButton constructor
xhr.js:176 Synchronous XMLHttpRequest on the main thread is deprecated
because of its detrimental effects to the end user's experience. For more
help, check https://xhr.spec.whatwg.org/.xhr @ xhr.js:176
AnnotTrack.js:315 Registering embedded system with ApolloGwt-2.0.
AnnotTrack.js:383 connection established
spring-websocket.js:1213 WebSocket connection to
'wss://myserver/apollo-2.0.5-SNAPSHOT/stomp/418/77nhu4ov/web
socket' failed: Error during WebSocket handshake: Unexpected response
code: 400SockJS.websocket @ spring-websocket.js:1213
RemoteBinaryFile.js:242 Refused to get unsafe header
"Content-Range"(anonymous function) @ RemoteBinaryFile.js:242
GlobalStatsEstimationMixin.js:64 Store statistics: store-2 Object
nathandunn commented 8 years ago

Based on our conversation, here are the URLs at each part of two workflows, one where the user is not logged into Apollo (WORKFLOW A), and another where the user is logged into Apollo (WORKFLOW B)

WORKFLOW A

  1. Link on the BLAST results page: https://myserver/apollo-2.0.5-SNAPSHOT/Anoplophora%20glabrip ennis/jbrowse/?loc=Scaffold66:1079496..1080321&addStores={%22url%22:{%22typ e%22:%22JBrowse/Store/SeqFeature/GFF3%22,%22urlTemplate%22:%22https://gmod- dev.nal.usda.gov/webapp/media/blast/task/018561a18e4349e5a0009e9a04b262bc/A gla_Btl03082013.genome_new_ids.fa.gff%22}}&addTracks=[{%22label%22:%22BLAST +%20Results%22,%22category%22:%220.%20Reference%20Assembly%22,%22type%22:%2 2WebApollo/View/Track/DraggableBLASTFeatures%22,%22store%22:%22url%22,%22st yle%22:{%22renderClassName%22:%22gray-center-10pct%22,%22subfeatureClasses% 22:{%22match_part%22:%22blast-match_part%22}}}]&tracks=BLAST+%20Results
  2. After clicking the link (NOT LOGGED IN)(feature is visible) https://myserver/apollo-2.0.5-SNAPSHOT/Anoplophora%20glabrip ennis/jbrowse/?loc=Scaffold66%3A1079496..1080321&addStores=%7B%22url%22%3A% 7B%22type%22%3A%22JBrowse%2FStore%2FSeqFeature%2FGFF3%22%2C%22urlTemplate%2 2%3A%22https%3A%2F%2Fgmod-dev.nal.usda.gov%2Fwebapp%2Fmedia%2Fblast%2Ftask% 2F018561a18e4349e5a0009e9a04b262bc%2FAgla_Btl03082013.genome_new_ids.fa.gff %22%7D%7D&addTracks=%5B%7B%22label%22%3A%22BLAST%2B%20Results%22%2C%22categ ory%22%3A%220.%20Reference%20Assembly%22%2C%22type%22%3A%22WebApollo%2FView %2FTrack%2FDraggableBLASTFeatures%22%2C%22store%22%3A%22url%22%2C%22style%2 2%3A%7B%22renderClassName%22%3A%22gray-center-10pct%22%2C%22subfeatureClass es%22%3A%7B%22match_part%22%3A%22blast-match_part%22%7D%7D%7D%5D&tracks=DNA %2CAnnotations%2CBLAST%2B%20Results&highlight=
  3. After logging in (clicking the login button, CSS starts to look funny)(after logging in, styles look ok, but the features in the BLAST track are gone) https://myserver/apollo-2.0.5-SNAPSHOT/433529338871716767182 1668669/jbrowse/index.html?loc=Scaffold66%3A1079496..1080321&highlight=&add Tracks=%5B%7B%22label%22%3A%22BLAST%2B%20Results%22%2C%22category%22%3A%220 .%20Reference%20Assembly%22%2C%22type%22%3A%22WebApollo%2FView%2FTrack%2FDr aggableBLASTFeatures%22%2C%22store%22%3A%22url%22%2C%22style%22%3A%7B%22ren derClassName%22%3A%22gray-center-10pct%22%2C%22subfeatureClasses%22%3A%7B%2 2match_part%22%3A%22blast-match_part%22%7D%7D%7D%5D&addStores%3D%7B%22url%2 2%3A%7B%22type%22%3A%22JBrowse%2FStore%2FSeqFeature%2FGFF3%22%2C%22urlTempl ate%22%3A%22https%3A%2F%2Fgmod-dev.nal.usda.gov%2Fwebapp%2Fmedia%2Fblast%2F task%2F018561a18e4349e5a0009e9a04b262bc%2FAgla_Btl03082013.genome_new_ids.f a.gff%22%7D%7D=&tracks=DNA%2CAnnotations%2CBLAST%2B%20Results
  4. Clicking on Show Annotator Panel:(after clicking, everything appears again! https://myserver/apollo-2.0.5-SNAPSHOT/annotator/index?clien tToken=446399913834611410895&highlight=&addTracks=[{%22label%22:%22BLAST+%2 0Results%22,%22category%22:%220.%20Reference%20Assembly%22,%22type%22:%22We bApollo/View/Track/DraggableBLASTFeatures%22,%22store%22:%22url%22,%22style %22:{%22renderClassName%22:%22gray-center-10pct%22,%22subfeatureClasses%22: {%22match_part%22:%22blast-match_part%22}}}]&addStores={%22url%22:{%22type% 22:%22JBrowse/Store/SeqFeature/GFF3%22,%22urlTemplate%22:%22https://gmod-de v.nal.usda.gov/webapp/media/blast/task/018561a18e4349e5a0009e9a04b262bc/Agl a_Btl03082013.genome_new_ids.fa.gff%22}}&tracks=DNA,Annotations,BLAST+%20Re sults https://myserver/apollo-2.0.5-SNAPSHOT/annotator/index?clie ntToken=446399913834611410895&highlight=&addTracks=%5B%7B%22label%22:%22BLA ST+%20Results%22,%22category%22:%220.%20Reference%20Assembly%22,%22type%22: %22WebApollo/View/Track/DraggableBLASTFeatures%22,%22store%22:%22url%22,%22 style%22:%7B%22renderClassName%22:%22gray-center-10pct%22,%22subfeatureClas ses%22:%7B%22match_part%22:%22blast-match_part%22%7D%7D%7D%5D&addStores=%7B %22url%22:%7B%22type%22:%22JBrowse/Store/SeqFeature/GFF3%22,%22urlTemplate% 22:%22https://gmod-dev.nal.usda.gov/webapp/media/blast/task/018561a18e4349e 5a0009e9a04b262bc/Agla_Btl03082013.genome_new_ids.fa.gff%22%7D%7D&tracks=DN A,Annotations,BLAST+%20Results
  5. Clicking back on the full-screen button:(when back in full screen mode, everything is visible!) https://myserver/apollo-2.0.5-SNAPSHOT/446399913834611410895 /jbrowse/index.html?loc=Scaffold66%3A1079496..1080321&clientToken=446399913 834611410895&highlight=&addTracks=%5B%7B%22label%22%3A%22BLAST%20%20Results %22%2C%22category%22%3A%220.%20Reference%20Assembly%22%2C%22type%22%3A%22We bApollo%2FView%2FTrack%2FDraggableBLASTFeatures%22%2C%22store%22%3A%22url%2 2%2C%22style%22%3A%7B%22renderClassName%22%3A%22gray-center-10pct%22%2C%22s ubfeatureClasses%22%3A%7B%22match_part%22%3A%22blast-match_part%22%7D%7D%7D %5D&addStores=%7B%22url%22%3A%7B%22type%22%3A%22JBrowse%2FStore%2FSeqFeatur e%2FGFF3%22%2C%22urlTemplate%22%3A%22https%3A%2F%2Fgmod-dev.nal.usda.gov%2F webapp%2Fmedia%2Fblast%2Ftask%2F018561a18e4349e5a0009e9a04b262bc%2FAgla_Btl 03082013.genome_new_ids.fa.gff%22%7D%7D&tracks=DNA%2CAnnotations%2CBLAST%20 %20Results&tracklist=1&nav=1&overview=1

It looks like step three has two main differences to my eye. (1) the addition of the clientToken, and (2) the URL seems to be doubled again

  1. Clicking on show annotator panel again (feature is still there):

    https://myserver/apollo-2.0.5-SNAPSHOT/annotator/index?clien tToken=446399913834611410895&highlight=&overview=1&tracklist=0&nav=1&addTra cks=[{%22label%22:%22BLAST%20%20Results%22,%22category%22:%220.%20Reference %20Assembly%22,%22type%22:%22WebApollo/View/Track/DraggableBLASTFeatures%22 ,%22store%22:%22url%22,%22style%22:{%22renderClassName%22:%22gray-center-10 pct%22,%22subfeatureClasses%22:{%22match_part%22:%22blast-match_part%22}}}] &addStores={%22url%22:{%22type%22:%22JBrowse/Store/SeqFeature/GFF3%22,%22ur lTemplate%22:%22https://gmod-dev.nal.usda.gov/webapp/media/blast/task/01856 1a18e4349e5a0009e9a04b262bc/Agla_Btl03082013.genome_new_ids.fa.gff%22}}&tra cks=DNA,Annotations,BLAST%20%20Results https://myserver/apollo-2.0.5-SNAPSHOT/annotator/index?clie ntToken=446399913834611410895&highlight=&overview=1&tracklist=0&nav=1&addTr acks=%5B%7B%22label%22:%22BLAST%20%20Results%22,%22category%22:%220.%20Refe rence%20Assembly%22,%22type%22:%22WebApollo/View/Track/DraggableBLASTFeatur es%22,%22store%22:%22url%22,%22style%22:%7B%22renderClassName%22:%22gray-ce nter-10pct%22,%22subfeatureClasses%22:%7B%22match_part%22:%22blast-match_pa rt%22%7D%7D%7D%5D&addStores=%7B%22url%22:%7B%22type%22:%22JBrowse/Store/Seq Feature/GFF3%22,%22urlTemplate%22:%22https://gmod-dev.nal.usda.gov/webapp/m edia/blast/task/018561a18e4349e5a0009e9a04b262bc/Agla_Btl03082013.genome_ne w_ids.fa.gff%22%7D%7D&tracks=DNA,Annotations,BLAST%20%20Results

WORKFLOW B (*on a different scaffold)

  1. Link on the BLAST results page: https://myserver/apollo-2.0.5-SNAPSHOT/Athalia%20rosae/jbrow se/?loc=Scaffold88:231438..232074&addStores={%22url%22:{%22type%22:%22JBrow se/Store/SeqFeature/GFF3%22,%22urlTemplate%22:%22https://gmod-dev.nal.usda. gov/webapp/media/blast/task/018561a18e4349e5a0009e9a04b262bc/Aros01112013-g enome_new_ids.fa.gff%22}}&addTracks=[{%22label%22:%22BLAST+%20Results%22,%2 2category%22:%220.%20Reference%20Assembly%22,%22type%22:%22WebApollo/View/T rack/DraggableBLASTFeatures%22,%22store%22:%22url%22,%22style%22:{%22render ClassName%22:%22gray-center-10pct%22,%22subfeatureClasses%22:{%22match_part %22:%22blast-match_part%22}}}]&tracks=BLAST+%20Results
  2. After clicking the link (LOGGED IN)(feature is NOT visible) https://myserver/apollo-2.0.5-SNAPSHOT/206398785956804369168 2882569/jbrowse/index.html?loc=Scaffold88%3A231438..232074&addTracks=%5B%7B %22label%22%3A%22BLAST%20%20Results%22%2C%22category%22%3A%220.%20Reference %20Assembly%22%2C%22type%22%3A%22WebApollo%2FView%2FTrack%2FDraggableBLASTF eatures%22%2C%22store%22%3A%22url%22%2C%22style%22%3A%7B%22renderClassName% 22%3A%22gray-center-10pct%22%2C%22subfeatureClasses%22%3A%7B%22match_part%2 2%3A%22blast-match_part%22%7D%7D%7D%5D&addStores%3D%7B%22url%22%3A%7B%22typ e%22%3A%22JBrowse%2FStore%2FSeqFeature%2FGFF3%22%2C%22urlTemplate%22%3A%22h ttps%3A%2F%2Fgmod-dev.nal.usda.gov%2Fwebapp%2Fmedia%2Fblast%2Ftask%2F018561 a18e4349e5a0009e9a04b262bc%2FAros01112013-genome_new_ids.fa.gff%22%7D%7D=&t racks=DNA%2CAnnotations%2CBLAST%20%20Results&highlight=
  3. Clicking on Show Annotator Panel:(after clicking, everything appears again! https://myserver/apollo-2.0.5-SNAPSHOT/annotator/index?clien tToken=446399913834611410895&highlight=&addTracks=[{%22label%22:%22BLAST%20 %20Results%22,%22category%22:%220.%20Reference%20Assembly%22,%22type%22:%22 WebApollo/View/Track/DraggableBLASTFeatures%22,%22store%22:%22url%22,%22sty le%22:{%22renderClassName%22:%22gray-center-10pct%22,%22subfeatureClasses%2 2:{%22match_part%22:%22blast-match_part%22}}}]&addStores={%22url%22:{%22typ e%22:%22JBrowse/Store/SeqFeature/GFF3%22,%22urlTemplate%22:%22https://gmod- dev.nal.usda.gov/webapp/media/blast/task/018561a18e4349e5a0009e9a04b262bc/A ros01112013-genome_new_ids.fa.gff%22}}&tracks=DNA,Annotations,BLAST%20%20Re sults https://myserver/apollo-2.0.5-SNAPSHOT/annotator/index?clie ntToken=446399913834611410895&highlight=&addTracks=%5B%7B%22label%22:%22BLA ST%20%20Results%22,%22category%22:%220.%20Reference%20Assembly%22,%22type%2 2:%22WebApollo/View/Track/DraggableBLASTFeatures%22,%22store%22:%22url%22,% 22style%22:%7B%22renderClassName%22:%22gray-center-10pct%22,%22subfeatureCl asses%22:%7B%22match_part%22:%22blast-match_part%22%7D%7D%7D%5D&addStores=% 7B%22url%22:%7B%22type%22:%22JBrowse/Store/SeqFeature/GFF3%22,%22urlTemplat e%22:%22https://gmod-dev.nal.usda.gov/webapp/media/blast/task/018561a18e434 9e5a0009e9a04b262bc/Aros01112013-genome_new_ids.fa.gff%22%7D%7D&tracks=DNA, Annotations,BLAST%20%20Results
  4. Clicking back on the full-screen button:(when back in full screen mode, everything is visible!) https://myserver/apollo-2.0.5-SNAPSHOT/446399913834611410895 /jbrowse/index.html?loc=Scaffold88%3A231438..232074&clientToken=44639991383 4611410895&highlight=&addTracks=%5B%7B%22label%22%3A%22BLAST%20%20Results%2 2%2C%22category%22%3A%220.%20Reference%20Assembly%22%2C%22type%22%3A%22WebA pollo%2FView%2FTrack%2FDraggableBLASTFeatures%22%2C%22store%22%3A%22url%22% 2C%22style%22%3A%7B%22renderClassName%22%3A%22gray-center-10pct%22%2C%22sub featureClasses%22%3A%7B%22match_part%22%3A%22blast-match_part%22%7D%7D%7D%5 D&addStores=%7B%22url%22%3A%7B%22type%22%3A%22JBrowse%2FStore%2FSeqFeature% 2FGFF3%22%2C%22urlTemplate%22%3A%22https%3A%2F%2Fgmod-dev.nal.usda.gov%2Fwe bapp%2Fmedia%2Fblast%2Ftask%2F018561a18e4349e5a0009e9a04b262bc%2FAros011120 13-genome_new_ids.fa.gff%22%7D%7D&tracks=DNA%2CAnnotations%2CBLAST%20%20Res ults&tracklist=1&nav=1&overview=1
monicacecilia commented 8 years ago

I tried recreating this problem (given the explanation in this issue), but I am not seeing any problems after clicking on JBrowse URLs, logged in or logged out. Unless we have more details about how this is 'breaking', we may not be able to dedicate resources to address it.

childers commented 7 years ago

The Jbrowse URL works, the issue is that the addTracks and/or addStores features disappear after successfully logging in. Once clicking on the Show Annotator Panel button the features appear, and subsequently clicking on the Full-screen View button again still shows the features.

@monicacecilia I had walked through this with @nathandunn, and this is the default behavior with Apollo 2.0.X when we used addStores and addFeatures.

If you were able to go through that workflow and not get an issue, I'd love to know what methods you're using to so I can adjust our workflows/URLs.

Unfortunately this is a show stopping issue for us at this point.

nathandunn commented 7 years ago

@childers I had discussed this with @monicacecilia . I'm going to run through it quickly this week and see if I can either (A) fix it, or (B) suggest a workflow.

childers commented 7 years ago

@nathandunn, thanks!

nathandunn commented 7 years ago

Testing with:

http://localhost:8080/apollo/Loxrec/jbrowse/?loc=Scaffold66:1079496..1080321&addStores={%22url%22:{%22type%22:%22JBrowse/Store/SeqFeature/GFF3%22,%22urlTemplate%22:%22https://gmod-dev.nal.usda.gov/webapp/media/blast/task/018561a18e4349e5a0009e9a04b262bc/Agla_Btl03082013.genome_new_ids.fa.gff%22}}&addTracks=[{%22label%22:%22BLAST+%20Results%22,%22category%22:%220.%20Reference%20Assembly%22,%22type%22:%22WebApollo/View/Track/DraggableBLASTFeatures%22,%22store%22:%22url%22,%22style%22:{%22renderClassName%22:%22gray-center-10pct%22,%22subfeatureClasses%22:{%22match_part%22:%22blast-match_part%22}}}]&tracks=BLAST+%20Results

It looks like the problem is that things are being un-necessarily encoded when you click on login. Clicking on the Annotator Panel provides the proper level of encoding.

nathandunn commented 7 years ago

Actually, I think the problem is that calling the "/Login" function, which removes all of the parameters when it does the redirect on the LoginController (because they aren't passed in). Solutions:

1 - pass all of the parameters into the "Login" function from AnnotTrack.js 2 -Login should just become "Show Annotator Panel" which would trigger the same functionality with no loss of function and we remove "Full-screen" mode as well.

nathandunn commented 7 years ago

@childers @mpoelchau I opted for option 2. You can see this in #1349 (with numerous other fixes). It ends up just being a cleaner solution.

That being said, you can customize what shows up here:

https://github.com/GMOD/Apollo/pull/1349/files#diff-56bde3069d994f1cb5051ff8164b8518R4324

You can turn the tracklist on and hide the annotator panel, though I would recommend against and just train your users to go the track panel area and select it manually and then go about their business.

childers commented 7 years ago

@nathandunn Thanks for working this out, it seems like it was buried pretty deep in how the login function works.

Does this still support our initial redirect not requiring any login?

Just so I'm sure I have this down here is the workflow:

  1. Random user does BLAST search, clicks to view results in the browser (not logged in)
  2. The redirect goes to not logged in Apollo
  3. The user wants to edit, and clicks the login button, which invokes the show annotator function now.
  4. Browser redirects straight to Apollo2 view with the Annotator panels enabled

Is this right?

The transition to Apollo2 view with the right-hand annotator panel will be a pretty big shift for folks, but it may be best to accept that it is the way the system works now. I'd prefer to customize the core code as little as possible.

nathandunn commented 7 years ago

This is exactly right. I'd really love to move the hierarchical onto the RHS #1335 , but we don't have time right now. If you have a programmer with spare cycles, though, it should be pretty easy to do, however.

childers commented 7 years ago

Yes, I'll be sad that the hierarchies we developed to organize the tracks will get lost for now.

nathandunn commented 7 years ago

They're still there, they just have to click on "use native JBrowse Tracks" in the track panel and then they can hide it or whatever they want to do. Not ideal, but still very workable.

monicacecilia commented 7 years ago

@childers it's all good! :bowtie:

You are correct, it is how Apollo has been working for a little under year now.

But I don't agree that the annotator panel will be that significant of a shift for curators, when it comes to actually conducting the annotations. Rather, curators who have already experienced the change received it as a welcomed enhancement to how they are able to navigate the genome - among other functionality.

Think of the annotator panel as an added space that allows curators to handle each annotation with more versatility. It is not a replacement of the environment curators have been using in 1.0.4. The User-created annotations area is exactly the same, and the right-click menus have but a few additions.

The panel addresses requests from frequent-use curators. It allows curators to handle annotations at a base per base level of detail, for example when a curator wishes to change the boundaries of a genomic element one base at a time without dragging the boundaries on the User-created annotations area. Other than the panel, Apollo 2 continues to use the same visualization and annotation window as Apollo 1. The advantage is that you don't have to leave the annotation window in order to move from scaffold (reference sequence) to scaffold, browse through all available annotations, or switch organisms, etc.

As far as the organization of the tracks, please know that you are not going to lose them. You can still configure them. As Nathan says, your users just have to press one button to 'use native JBrowse tracks'.

@nathandunn let's add a 'Ready' label here when this is pushed to staging. Thanks!

nathandunn commented 7 years ago

Will do on the "Ready" tag . . . was going to have @deepakunni3 test these when he is back later this week.

nathandunn commented 7 years ago

I'll have to show you my new waffle board ;)

monicacecilia commented 7 years ago

Confirmed that addTracks and/or addStores features are kept after login. 👍