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

empty track #148

Open
EnrichettaMileti opened this issue Mar 14, 2024 · 4 comments
Open

empty track #148

EnrichettaMileti opened this issue Mar 14, 2024 · 4 comments

Comments

@EnrichettaMileti
Copy link

EnrichettaMileti commented Mar 14, 2024

Hi! I'm running this simple script to visualise bigwig file:

import gosling as gos
data = gos.bigwig(
    url=https://s3.amazonaws.com/gosling-lang.org/data/ExcitatoryNeurons-insertions_bin100_RIPnorm.bw’,
    column=position’,
    value=peak’
)
track = gos.Track(data).mark_area().encode(
    x=gos.X(‘position:G’),
    y=gos.Y(“peak:Q”, axis=right”),
    color=gos.value(“royalblue”),
).properties(title=bigwig”,height=180,width=725)
vis = track.view(title=test’)
vis.save(‘test.html’)

if instead of your url I saved the file on my Amazon aws and run the same script using this url:
https://enrmil.s3.eu-north-1.amazonaws.com/ExcitatoryNeurons-insertions_bin100_RIPnorm.bw
I obtain an empty track. This is also happening if I use a localhost.

@manzt
Copy link
Member

manzt commented Mar 14, 2024

Hi there, this looks like a CORS configuration issue on your s3 bucket. You need to enable CORS to allow the web-browser to make requests to s3, and ensure the bucket is public.

@EnrichettaMileti
Copy link
Author

Thanks it works.
I have a similar issue if I try to use the localhost as in this example:
https://gosling-lang.github.io/gos/user_guide/local_data.html
If I download the data and I run the same script I get an empty track. Should I also do some configuration for the localhost? If so, how?
thanks again

@manzt
Copy link
Member

manzt commented Mar 26, 2024

Hi, the local data capabilities only work while there is a Python session running (i.e., in an active Jupyter notebook). You can't export to standalone HTML, because the web-server on localhost is no longer running. Perhaps we should make this note larger, but it's at the very bottom of the local data docs.

May I ask what your goal is with the generated HTML? Is it to view locally, or would you like to publish a website for others? You can certainly host your own data locally, but this requires setting up your own web server.

Alternatively, I have been considering a simple CLI to run a Python script and view the outputs in a web brwoser (without needing to start Jupyter, etc).

@xpf10
Copy link

xpf10 commented Oct 22, 2024

I want to publish a website for others, how can I create the web server? use the http.server to create data http links, and then use the streamlit_gosling to create the website?

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

3 participants