statgen / pheweb

A tool to build a website to browse hundreds or thousands of GWAS.
MIT License
154 stars 65 forks source link

404 not found error of phewas plot page (Pheweb with structural variants) #212

Closed sylee20 closed 5 months ago

sylee20 commented 9 months ago

Hi, I made a pheweb site using structural variants. However, upon clicking a variant name, I receive a '404 not found' error and am unable to view the Phewas plot. I attempted to resolve this by adding VEP annotation (Following the instructions in this site and 'run.sh' script), but unfortunately, the issue persists.

I can view the Phewas plot as expected when I build Pheweb using SNPs. I wonder if I should use only SNPs to make Pheweb. Or is there a way to add phewas pages to a pheweb site with structural variation?

Thank you.

pjvandehaar commented 9 months ago

What do you see on the STDOUT of “pheweb serve” (or however you’re running it)?

On Fri, Sep 15, 2023 at 7:43 PM sylee20 @.***> wrote:

I made a pheweb site using structural variants. However, Upon clicking a variant name, I receive a '404 not found' error and am unable to view the Phewas plot. I attempted to resolve this by adding VEP annotation (Following the instructions in this site and 'run.sh' script), but unfortunately, the issue persists.

I can view the Phewas plot as expected when I build Pheweb using SNPs. I wonder if I should use only SNPs to make Pheweb. Or is there a way to add phewas pages to a pheweb site with structural variation?

Thank you.

— Reply to this email directly, view it on GitHub https://github.com/statgen/pheweb/issues/212, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGSPCJOS26ESSUREAQAXNTX2T73PANCNFSM6AAAAAA42Q64W4 . You are receiving this because you are subscribed to this thread.Message ID: @.***>

sylee20 commented 9 months ago

This is what I see in the STDOUT:

sudo pheweb serve --port 33098
[2023-09-17 20:13:55 +0900] [32421] [INFO] Starting gunicorn 20.0.4
[2023-09-17 20:13:55 +0900] [32421] [INFO] Listening at: http://0.0.0.0:33098 (32421)
[2023-09-17 20:13:55 +0900] [32421] [INFO] Using worker: gevent
[2023-09-17 20:13:55 +0900] [32425] [INFO] Booting worker with pid: 32425
[2023-09-17 20:13:55 +0900] [32426] [INFO] Booting worker with pid: 32426
[2023-09-17 20:13:55 +0900] [32427] [INFO] Booting worker with pid: 32427
[2023-09-17 20:13:55 +0900] [32428] [INFO] Booting worker with pid: 32428
[2023-09-17 20:13:55 +0900] [32429] [INFO] Booting worker with pid: 32429
[2023-09-17 20:13:55 +0900] [32430] [INFO] Booting worker with pid: 32430
[2023-09-17 20:13:55 +0900] [32431] [INFO] Booting worker with pid: 32431
[2023-09-17 20:13:55 +0900] [32432] [INFO] Booting worker with pid: 32432

When I click a variant name:

Exception:
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/pheweb/serve/server.py", line 120, in variant_page
    variant = get_variant(query)
  File "/usr/local/lib/python3.6/dist-packages/pheweb/serve/server_utils.py", line 70, in get_variant
    assert None not in [chrom, pos, ref, alt]
AssertionError
Oh no, something went wrong
[17/Sep/2023:20:45:50 +0900] | 404 | 0.020327s | GET /variant/4-10211261-C-<DEL> | resp_len:3825 | referrer:"http://210.114.91.250:33098/phenotypes" | ip:183.100.201.22 | agent:Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36
[17/Sep/2023:20:45:50 +0900] | 200 | 0.002083s | GET /static/common.css | resp_len:397 | referrer:"http://210.114.91.250:33098/variant/4-10211261-C-%3CDEL%3E" | ip:183.100.201.22 | agent:Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36
[17/Sep/2023:20:45:50 +0900] | 200 | 0.001662s | GET /static/common.js | resp_len:1092 | referrer:"http://210.114.91.250:33098/variant/4-10211261-C-%3CDEL%3E" | ip:183.100.201.22 | agent:Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36
sylee20 commented 9 months ago

Hi, I modified one line in class "_ParseVariant" and now I can see the phewas plot.

#chrom_pos_ref_alt_regex = re.compile(chrom_pos_regex.pattern + r'[-_:/ ]([-AaTtCcGg\.]+)[-_:/ ]([-AaTtCcGg\.]+)')
chrom_pos_ref_alt_regex = re.compile(chrom_pos_regex.pattern + r'[-_:/ ]([-AaTtCcGg\.]+)[-_:/ ]([A-Za-z\-<>\.]+)')

My URL was /variant/4-10211261-C-<DEL>, so I changed the code to allow any alphabet and <> as the alternate allele.

Thank you.

pjvandehaar commented 9 months ago

Great, that seems like the right fix.

On Tue, Sep 19, 2023 at 2:04 AM sylee20 @.***> wrote:

Hi, I modified one line in class "_ParseVariant" and now I can see the phewas plot.

chrom_pos_ref_alt_regex = re.compile(chrom_posregex.pattern + r'[-:/ ]([-AaTtCcGg.]+)-_:/ ')

chrom_pos_ref_alt_regex = re.compile(chrom_posregex.pattern + r'[-:/ ]([-AaTtCcGg.]+)-_:/ ')

My URL was /variant/4-10211261-C-, so I changed the code to allow any alphabet and <> as the alternate allele.

Thank you.

— Reply to this email directly, view it on GitHub https://github.com/statgen/pheweb/issues/212#issuecomment-1725020168, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGSPCOJNHYISJ25IR2ETHDX3FGY5ANCNFSM6AAAAAA42Q64W4 . You are receiving this because you commented.Message ID: @.***>