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

Display annotation track from a BED file #310

Closed
LuisGFdez opened this issue Aug 9, 2022 · 8 comments
Closed

Display annotation track from a BED file #310

LuisGFdez opened this issue Aug 9, 2022 · 8 comments

Comments

@LuisGFdez
Copy link

Hi Eric,

I'm trying to display an annotation track on GCRh38 human assembly

This is my R code, and the problem is that when I run it, it is not displaying the annotations from my bedfile.

app <- Dash$new()

app$layout(
htmlDiv(
list(
htmlLabel("Click a chromosome for a closer look; double-click to return to the overview:"),

                  "GCH38",
  dashbioIdeogram(
    id='my-dashbio-ideogram',
    orientation = "vertical",
    annotationsPath="Documentos/Identical repeats project/Inverted_repeats/after_collapsing_bedfiles/WG_InvertedRepeats_hg38_all_collapsed.bed",
    annotationsLayout = "histogram",
    assembly = "GRCh38",
    chrHeight=250
  )
  
),
style = list("text-align" = "center")

)
)
app$run_server()

@eweitz
Copy link
Owner

eweitz commented Aug 10, 2022

Greetings, Luis! Thanks for using Ideogram.

Are any error messages displayed? I imagine you're running this in a browser, and you'd see such errors in Chrome DevTools Console. (You can open DevTools by clicking the Chrome menu bar, "More Tools", "Developer Tools".)

Also, could you give me a copy of your BED file? It'd be ideal if you could attach a copy of your BED file in a comment here. Less ideally, you can email it to me using the address in my GitHub profile.

@LuisGFdez
Copy link
Author

for sure, here it is my bed file
WG_InvertedRepeats_hg38_all.zip

@LuisGFdez
Copy link
Author

LuisGFdez commented Aug 11, 2022

It looks like this is the problem. I'm using firefox as my main browser

Captura de pantalla de 2022-08-10 23-06-43

And this is the message that i get in the R console

request: 127.0.0.1 - ID_127.0.0.1 [10/ago/2022:23:19:32 -0500] "GET /_reload-hash HTTP/1.1" 200 217 "http://127.0.0.1:8050/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:90.0) Gecko/20100101 Firefox/90.0"

Captura de pantalla de 2022-08-10 23-32-42

@LuisGFdez
Copy link
Author

LuisGFdez commented Aug 19, 2022

Hi Eric,

I just realized that there was a similar problem as mine here #170.

Could you tell me what it is the solution that you gave them?

Captura de pantalla de 2022-08-19 16-30-09

How should I debug

@eweitz
Copy link
Owner

eweitz commented Aug 19, 2022

Hi Luis, your screenshot of the Console panel in Chrome DevTools is helpful! It indicates an error related to cross-origin resource sharing (CORS).

It seems your problematic URL is:
https://github.com/LuisGFdez/inverted_repeats/blob/22ae06451ca902fe823998c14086834ee77a0113/chr3.bed

The problem is caused by your file's URL using at a different origin (https://github.com) than the web page you're trying to load it into / share it with (https://eweitz.github.io). The file lacks special HTTP response headers that allow such CORS content.

Try this URL:
https://raw.githubusercontent.com/LuisGFdez/inverted_repeats/22ae06451ca902fe823998c14086834ee77a0113/chr3.bed

Files served from https://raw.githubusercontent.com have those special CORS headers, so they can be fetched by web pages on different origins.

You can see it live here:
https://eweitz.github.io/ideogram/annotations-file-url?asm=GRCh38&annotsUrl=https://raw.githubusercontent.com/LuisGFdez/inverted_repeats/22ae06451ca902fe823998c14086834ee77a0113/chr3.bed

There, you'll see the BED file display successfully (albeit extremely densely) along chromosome 3.

Let me know if more would help!

@eweitz eweitz changed the title Diplay annotation track from a bed file Display annotation track from a BED file Aug 19, 2022
@LuisGFdez
Copy link
Author

LuisGFdez commented Aug 22, 2022

Thank u so much. One more question, is it possible to display a bed file stored with Git LFS as this one:
https://github.com/LuisGFdez/inverted_repeats/blob/main/WG_InvertedRepeats_hg38_all_collapsed.bed

And is it already the T2T ideogram available?

@eweitz
Copy link
Owner

eweitz commented Aug 24, 2022

is it possible to display a bed file stored with Git LFS

Not directly like non-LFS files, it seems.

Instead of returning file content, https://raw.githubusercontent.com/LuisGFdez/inverted_repeats/3ea36ee81fb892bc1b6c274f0062fcb0bcf02091/WG_InvertedRepeats_hg38_all_collapsed.bed returns:

version https://git-lfs.github.com/spec/v1
oid sha256:247e20d9c183fb4ffad15c1c8cce8aa418f38949ad58a16df8de575e37c860a3
size 93870154

That said, it might be nice to add support for gzip-compressed BED files. This might let you decrease file size enough to not trigger "large file storage" limits, letting you host genomic data via GitHub in a CORS-friendly way.

If that sounds useful to you, please open a new issue like "Support gzipped BED files".

And is it already the T2T ideogram available?

Not yet, but that seems straightforward in theory. Please open an issue like "Support T2T human genome" if you'd like it!

@eweitz
Copy link
Owner

eweitz commented Oct 1, 2022

Thanks for opening those separate issues! For convenient reference, these are #314 and #315.

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