lidaof / eg-react

WashU Epigenome Browser
https://epigenomegateway.wustl.edu
Other
66 stars 29 forks source link

Embedding error: loading bed file failed #336

Open Liuzekai666 opened 9 months ago

Liuzekai666 commented 9 months ago

Hello, I am trying to load bed file in the local test, but I meet an error 'Data fetch failed. Reload page or change view to retry' My code is as following: type: "bed", name: "test", url: "https://smart-db.cn/download/new_Epigenome_browser/mouse/GSE114822/2023-10-14_CallPeaks_by_CellType.bed.gz", options: { color: "blue" }, metadata: { Sample: "test" } Is my code written incorrectly or is the format of the file content incorrect? Thank you!!

lidaof commented 9 months ago

Hi @Liuzekai666 you need to enable the CORS on the nginx server on your Ubuntu system, seems it's not enabled:

curl -I https://smart-db.cn/download/new_Epigenome_browser/mouse/GSE114822/2023-10-14_CallPeaks_by_CellType.bed.gz                                                                                 
HTTP/1.1 200 OK
Server: nginx/1.18.0 (Ubuntu)
Date: Sat, 14 Oct 2023 16:58:10 GMT
Content-Type: application/octet-stream
Content-Length: 760305
Last-Modified: Sat, 14 Oct 2023 13:51:06 GMT
Connection: keep-alive
ETag: "652a9cca-b99f1"
Accept-Ranges: bytes

a quick google search gives me this: https://enable-cors.org/server_nginx.html and https://ubiq.co/tech-blog/enable-cors-nginx/, can you give it a try? thanks!

Liuzekai666 commented 9 months ago

Thank you for your kind. But I don't think it's a problem with CORS, is it because I didn't provide the. bed.gz.tbi file? Summary URL: https://smart-db.cn/download/new Epigenomebrowser/mouse/GSE1148222023-10-14_CallPeaks-by CelType.bed.gz.tbi Status: 404 Not Found Source: Network Request GET /download/new_Epigenome_browser/mouse/GSE114822/2023-10-14_CallPeaks_by_CellType.bed.gz.tbi HTTP/1.1 Accept:** Accept-Encoding: gzip, deflate, br Accept-Language: en-US,en;q=0.9 Connection: keep-alive cokie: Hm_pl 89deb8cob1ie4d472075135695679-16973874-m B9dbcbbie4d472075135695679-16956412 169584393 1697184390 sitoker-x.XDe.0XNdZufRUbvzaTiodtEUW04WU Host: smart-db.cn Sec-Fetch-Dest: empty Sec-Fetch-Mode: cors Sec-Fetch-Site: same-origin User-Agent: Mozila/5.0 (Macintosh; lntel Mac OS X 10_15_7) AppleWebkit/605.1.15 (KHTML, ike Gecko) Version/17.0 Safari/605.1.15 Response HTTP/1.1 404 Not Found Connection: keep-alive Content-Encoding: gzip Content-Type: text/html Date: Sun, 15 0ct 2023 03:00:35 GMT Server: nginx/1.18.0 (Ubuntu) Transfer-Encoding: ldentity

lidaof commented 9 months ago

oh yes, you need to provide the .gz.tbi file...