-
Notifications
You must be signed in to change notification settings - Fork 63
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
Allow local files on the users computer to be opened as tracks in jbrowse-web #1975
Conversation
What happens when people refresh the page when viewing a local file?
…On Fri, May 14, 2021 at 1:00 AM Colin Diesh ***@***.***> wrote:
This is an early result but I had an interest in allowing the ability to
upload local files as blob files in jbrowse web. This is a longstanding
issue #88 <#88>
The basic methodology is this
1. realize that you can't store a file blob in a mobx-state-tree
state, and our other file handles are mobx-state-tree's so then go to step 1
2. create a mapping of a blobId (something I made up) to the actual
file blob
3. make the BlobLocation mst object store this blobId
4. making openLocation read the map to access the file blob given the
BlobLocation's blobId
In order to make this work on the webworker, we have to send the map of
blobId to the blob over the rpc. This PR sends the entire map instead of
trying to select a single blob off the map for example for smaller payload.
Fixes #88 <#88>
------------------------------
You can view, comment on, or merge this pull request online at:
#1975
Commit Summary
- File selector ability to open local file
- Working main thread local file opening
- Allow webworker rendering of blob file
File Changes
- *M* packages/core/pluggableElementTypes/RpcMethodType.ts
<https://github.com/GMOD/jbrowse-components/pull/1975/files#diff-9edc56a0e30ebf3f264e0498a8e1e703965428cd77092ea2ea676892a119a2a7>
(6)
- *M*
packages/core/pluggableElementTypes/renderers/ServerSideRendererType.tsx
<https://github.com/GMOD/jbrowse-components/pull/1975/files#diff-697ac89fc472a7df14d004de282d2870dfea5c19017cd0e0a6ca49f586ba134a>
(1)
- *M* packages/core/rpc/BaseRpcDriver.ts
<https://github.com/GMOD/jbrowse-components/pull/1975/files#diff-442ad1990dfdc3017b74d37cf5a7d001e5f118dc524ccfa57177527c9a69464d>
(6)
- *M* packages/core/ui/FileSelector.tsx
<https://github.com/GMOD/jbrowse-components/pull/1975/files#diff-258d5d78c953b6718af9fceea4976ae26a72c21297f3a1ab59245145c7a6c5f7>
(26)
- *M* packages/core/util/io/index.ts
<https://github.com/GMOD/jbrowse-components/pull/1975/files#diff-131026ecf5c433d2a0432eac1715f7fdb637b95351a3d517b480b5f093a21c01>
(6)
- *M* packages/core/util/tracks.ts
<https://github.com/GMOD/jbrowse-components/pull/1975/files#diff-2887cdb5bd75d3ee14567ffc2c20fedb974dad8c9a772952756e7fa59f09b402>
(52)
- *M* packages/core/util/types/mst.ts
<https://github.com/GMOD/jbrowse-components/pull/1975/files#diff-8d10230b3c37f727fa6095bda5a6885410270e7db28395d860c0e420c27d1045>
(11)
- *M*
plugins/data-management/src/AddTrackWidget/components/ConfirmTrack.tsx
<https://github.com/GMOD/jbrowse-components/pull/1975/files#diff-c79f801f2a5fee2eb1009ba2b69d6a51b33b91ee8e4d4f05c5a4009b53e7827b>
(203)
- *M* plugins/data-management/src/AddTrackWidget/model.ts
<https://github.com/GMOD/jbrowse-components/pull/1975/files#diff-8ea7cfae1a6fbc2fb8cba7e0015ae9e7f2b1e8477f354f07c87722a6fada5d3a>
(28)
Patch Links:
- https://github.com/GMOD/jbrowse-components/pull/1975.patch
- https://github.com/GMOD/jbrowse-components/pull/1975.diff
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#1975>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAASAFPSILYJU3HWASAYQU3TNTKCJANCNFSM4437CZ5A>
.
|
There is just a failure to open the track in that case, it just says the blobId was not found. We could likely make some more special logic though e.g. our concept to prompt user to reopen those files |
that's probably ok, as long as the error message is easy-ish to understand |
45224cc
to
f5d75e6
Compare
Codecov Report
@@ Coverage Diff @@
## main #1975 +/- ##
==========================================
+ Coverage 61.36% 61.37% +0.01%
==========================================
Files 470 470
Lines 22210 22243 +33
Branches 5099 5113 +14
==========================================
+ Hits 13629 13652 +23
- Misses 8306 8316 +10
Partials 275 275
Continue to review full report at Codecov.
|
@garrettjstevens do you think this method of adding blobMap at the super-base-level of RpcMethodType is ok? |
looks good to me, merge if you think so too @garrettjstevens |
works on both firefox and midori (basically safari on linux) for me |
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.
Looks good to me.
this screenshot* may have been taken before a988ffe |
This is an early result but I had an interest in allowing the ability to upload local files as blob files in jbrowse web. This is a longstanding issue #88
The basic methodology is this
In order to make this work on the webworker, we have to send the map of blobId to the blob over the rpc. This PR sends the entire map instead of trying to select a single blob off the map for example for smaller payload.
Fixes #88