statgen / pheweb

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

one line fix for add_rsids.py #173

Closed jielab closed 1 year ago

jielab commented 3 years ago

Dear Peter and guys:

Previously I mentioend that it is a pity (not necessarily a bug) that Pheweb could not find rsIDs for SNPs simply because their A1/A2 alleles are not the same as the REF/ALT allele. I said that this idea of a single REF/ALT allele in the "reference genome" will be abandoned, because now there are more and more genomes in the reference.

I just took a look at your add_rsids.py code. Even though I had no experience in python programming, I believe that only one line will fix this issue. As shown in the following screenshot, I think we simply need to add or (cpra['ref'] == rsid['alt'] and are_match(cpra['alt'], rsid['ref'])) to the end of line 140.

image

I feel that updating this line is really important. Also, it would be good to be case insensitive, so that a/c is equal to A/C.

Best regards, Jie

pjvandehaar commented 1 year ago

It sounds like this change will work for you, but I don't want it in pheweb, sorry. I like ref/alt.