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

problem with use {chr: 'all'} in straw API #281

Closed
lidaof opened this issue Oct 22, 2018 · 8 comments
Closed

problem with use {chr: 'all'} in straw API #281

lidaof opened this issue Oct 22, 2018 · 8 comments

Comments

@lidaof
Copy link

lidaof commented Oct 22, 2018

After pulling the latest code after #236 , I ran grunt to build the latest juicebox.min.js file and put it to my project.
I then tried use the straw API:
this.straw.getContactRecords('NONE', queryLocus1, {chr: 'all'}, 'BP', binSize)

I am getting errors:

Uncaught (in promise) Error: One or both chromosomes not in this dataset
    at juicebox.js:23582
(anonymous) @ juicebox.js:23582
Promise.then (async)
step @ bundle.js:197036
(anonymous) @ bundle.js:197036
(anonymous) @ bundle.js:197036
componentDidMount @ CircletView.js:15
commitLifeCycles @ react-dom.development.js:9768
commitAllLifeCycles @ react-dom.development.js:11439
callCallback @ react-dom.development.js:104
invokeGuardedCallbackDev @ react-dom.development.js:142
invokeGuardedCallback @ react-dom.development.js:191
commitRoot @ react-dom.development.js:11578
completeRoot @ react-dom.development.js:12475
performWorkOnRoot @ react-dom.development.js:12425
performWork @ react-dom.development.js:12343
performSyncWork @ react-dom.development.js:12320
interactiveUpdates @ react-dom.development.js:12570
interactiveUpdates @ react-dom.development.js:1962
dispatchInteractiveEvent @ react-dom.development.js:4256
index.js:2429 Fetch finished loading: GET "http://localhost:3000/js/juicebox.min.js".
_callee$ @ index.js:2429
tryCatch @ index.js:2616
invoke @ index.js:2850
prototype.(anonymous function) @ index.js:2668
step @ index.js:2493
(anonymous) @ index.js:2493
(anonymous) @ index.js:2493
(anonymous) @ index.js:2452
_callee2$ @ index.js:2421
tryCatch @ index.js:2616
invoke @ index.js:2850
prototype.(anonymous function) @ index.js:2668
step @ index.js:2493
(anonymous) @ index.js:2493
(anonymous) @ index.js:2493
map @ index.js:2489
getStackFrames @ index.js:2270
crashWithFrames @ index.js:1927
(anonymous) @ index.js:1945
rejectionHandler @ index.js:2041
index.js:885 Fetch finished loading: GET "http://localhost:3000/js/juicebox.min.js.map".
_callee$ @ index.js:885
tryCatch @ index.js:2616
invoke @ index.js:2850
prototype.(anonymous function) @ index.js:2668
step @ index.js:906
(anonymous) @ index.js:906
Promise.then (async)
step @ index.js:906
(anonymous) @ index.js:906
(anonymous) @ index.js:906
getSourceMap @ index.js:902
_callee$ @ index.js:2436
tryCatch @ index.js:2616
invoke @ index.js:2850
prototype.(anonymous function) @ index.js:2668
step @ index.js:2493
(anonymous) @ index.js:2493
Promise.then (async)
step @ index.js:2493
(anonymous) @ index.js:2493
(anonymous) @ index.js:2493
(anonymous) @ index.js:2452
_callee2$ @ index.js:2421
tryCatch @ index.js:2616
invoke @ index.js:2850
prototype.(anonymous function) @ index.js:2668
step @ index.js:2493
(anonymous) @ index.js:2493
(anonymous) @ index.js:2493
map @ index.js:2489
getStackFrames @ index.js:2270
crashWithFrames @ index.js:1927
(anonymous) @ index.js:1945
rejectionHandler @ index.js:2041
index.js:1938 Could not get the stack frames of error: TypeError: Cannot read property 'length' of null
    at getLinesAround (index.js:1709)
    at index.js:2477
    at Array.map (<anonymous>)
    at _callee2$ (index.js:2457)
    at tryCatch (index.js:2616)
    at Generator.invoke [as _invoke] (index.js:2850)
    at Generator.prototype.(anonymous function) [as next] (http://localhost:3000/static/js/bundle.js:142361:21)
    at step (index.js:2493)
    at index.js:2493

Did I do something wrong? Thanks.

@jrobinso
Copy link
Contributor

Its impossible to say with the information you provided. What is the value of queryLocus1 and binSize?

@lidaof
Copy link
Author

lidaof commented Oct 22, 2018

binSize is undefined

queryLocus1 is an object with chr=chr6, start=50596520 and end=50627592

I just tried with
this.straw.getContactRecords('NONE', {chr: "all"}, {chr: "all"}, 'BP', undefined)
still get same error?
How can I tell I am using the latest juicebox.min.js?

Thanks for reply.

@jrobinso
Copy link
Contributor

You can't query chr6 vs all, only all vs all. As I explained previously, "all" is not a real chromosome (obviously), the data is just a course representation whose sole purpose is to render a whole genome view. The second query should have worked. If you pulled from master and built you have the latest.

Look at the unit test "testStraw.js". You run it by opening "runTests.html" in a browser. It has a test for "All".

We can leave this open as a bug report but I won't be able to look at it right away. Also, I will probably need access to the .hic file you are using, or another reproducible test case, if the unit test is working.

@jrobinso
Copy link
Contributor

@lidaof What do you need this query for?

@lidaof
Copy link
Author

lidaof commented Oct 22, 2018

@jrobinso I am trying to get all contacts information against one region. Currently I am doing a for loop looping all chromsomes, works but slow. So I am wondering if this all option will help :)

@lidaof
Copy link
Author

lidaof commented Oct 22, 2018

the local test seems passed

image

@jrobinso
Copy link
Contributor

@lidaof Actually they failed, but that is not surprising as you opened runTests.html with a file URL. That will not work. In any event "all" is not going to work for what you are trying to do, looping through the chromosomes is the correct way to do that. As I've tried to explain a few times, "all" is a very coarse bin size for painting the WG view, not for doing any analysis. Some smaller chromosomes will have only 1 or 2 bins total at this resolution.

@lidaof
Copy link
Author

lidaof commented Oct 22, 2018

@jrobinso , I see. thanks for information :)

@lidaof lidaof closed this as completed Oct 22, 2018
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

No branches or pull requests

2 participants