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

Blank canvas plotting local BED file #135

Open
cademirch opened this issue May 12, 2023 · 4 comments
Open

Blank canvas plotting local BED file #135

cademirch opened this issue May 12, 2023 · 4 comments
Labels
bug Something isn't working

Comments

@cademirch
Copy link

cademirch commented May 12, 2023

Hi, I am trying to use gos to visualize a local bed file exactly like the OP in #120 and am also having trouble. I am working on a python notebook and the visualization is just a blank canvas.

My code:

import gosling as gos

data = gos.csv(
    url="./jw18_NC_002978.6_cov.bed",
    headerNames=['chrom', 'position', 'value'],
    chromosomeField="chrom",
    genomicFields=["position"],
    
    separator="\t",
)
gos.Track(data).mark_bar().encode(
    x=gos.X("position:G"),
    y=gos.Y("value:Q", axis="left"),
).view(
    assembly=[
        ("NC_002978.6", 1267782),
    ]
)

Head of the bed file:

NC_002978.6  0     0
NC_002978.6  3428  1
NC_002978.6  3439  2
NC_002978.6  3441  6
NC_002978.6  3446  8
NC_002978.6  3451  12
NC_002978.6  3454  16
NC_002978.6  3462  17
NC_002978.6  3463  21
NC_002978.6  3468  22

The bed file is only ~2 Mb (~100,000 lines) so I don't think file size is the issue here.

Screenshot for clarity on blank canvas:
Screenshot 2023-05-12 at 11 59 47 AM

Would appreciate any advice! Thank you.

@cademirch
Copy link
Author

Interestingly, the same code works on a Google Colab notebook, though it took a while to load the visualization (Chrome warned that the tab was unresponsive a couple times). So perhaps the issue is with Vscode, which is what I used above.

Screenshot 2023-05-12 at 1 08 15 PM

@manzt
Copy link
Member

manzt commented May 30, 2023

Apologies for the delay in my response. Thanks for the detailed issue. Gos should run inside VSCode, so this could be a bug (the file size also isn't too large).

Are you able to share the file? BED files are tab-delimited, and the sample text you posted is not.

@cademirch
Copy link
Author

@manzt thanks your response. Sorry the BED I pasted was not tab separated. The original file indeed is and I've attached it here.
jw18_NC_002978.6_cov.bed.gz

Thanks for you help!

@manzt
Copy link
Member

manzt commented Jun 2, 2023

This is really perplexing and definitely a bug. I'm able to reproduce locally. Thanks for sharing the data! Hoping to push out a fix soon @sehilyi

@manzt manzt added the bug Something isn't working label Jun 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants