Cloufield / gwaslab

A Python package for handling and visualizing GWAS summary statistics. https://cloufield.github.io/gwaslab/
GNU General Public License v3.0
157 stars 25 forks source link

Miami plot Two GWAS incorrect aligned #110

Open XiaoyangDai1 opened 3 weeks ago

XiaoyangDai1 commented 3 weeks ago

gl.plot_miami2(path1=gwas, path2=exwas, build="38", id1="SNPID", id2="SNPID", anno1="GENENAME", anno2="GENENAME", sig_level1=5e-8, sig_line_color1="purple", suggestive_sig_level1=1e-6, suggestive_sig_line_color1="grey", sig_level2=1.0438e-06, sig_line_color2="purple", verbose1=False, verbose2=False, save="miami.png", save_args={"dpi":400,"facecolor":"white"} )

截屏2024-10-19 02 10 50

Please let me know how to fix it, thank you!

XiaoyangDai1 commented 3 weeks ago

The core thing is the upper GWAS contain 1:23 and the bottom only contain 1:22, so if there is any method to align them correctly? Thank you!

Cloufield commented 3 weeks ago

Hi, Thanks for reporting the error. I just updated v3.4.49 to fix this. would you please update pip install gwaslab==3.4.49 and try again. Thanks!

XiaoyangDai1 commented 3 weeks ago

Hi Yunye,

Thanks for your response. I have two additional points to clarify:

  1. I attempted to upgrade to version 3.4.49, but I encountered an error stating that no such version exists. It seems the update might not yet be available, so I’ll try again later.

  2. I’m working on annotating rsIDs in the exWAS results. I used the assign.rsid function to retrieve the rsID column, and the results appear as expected, shown below:

exwas.data SNPID CHR POS EA NEA EAF BETA SE P N STATUS rsID 0 1:930314:C:T 1 930314 T C 0.035411 0.018758 0.021201 0.376272 30075 3869999 rs9988179 1 1:935835:C:G 1 935835 G C 0.043045 0.019199 0.019342 0.320889 30073 3869999 rs28419423 ...

However, when I try to generate a Miami plot using the following command:

a = gl.plot_miami2( path1=gwas.filter_value('CHR!="23"'), path2=exwas, build="38", id1="SNPID", id2="SNPID", anno1="GENENAME", anno2=True, sig_level1=5e-8, sig_line_color1="orange", suggestive_sig_line1=True, suggestive_sig_level1=1e-6, suggestive_sig_line_color1="grey", sig_level2=1.0438e-06, sig_line_color2="orange", verbose1=False, verbose2=False, save="miami.png", save_args={"dpi":300, "facecolor":"white"} )

I receive the following error message:

Traceback (most recent call last): File "", line 1, in File "/opt/anaconda3/envs/gwaslab_env/lib/python3.9/site-packages/gwaslab/viz_plot_miamiplot2.py", line 274, in plot_miami2 fig, log = mqqplot(merged_sumstats, File "/opt/anaconda3/envs/gwaslab_env/lib/python3.9/site-packages/gwaslab/viz_plot_mqqplot.py", line 411, in mqqplot usecols = _configure_cols_to_use(insumstats=insumstats, File "/opt/anaconda3/envs/gwaslab_env/lib/python3.9/site-packages/gwaslab/viz_plot_mqqplot.py", line 1177, in _configure_cols_to_use raise ValueError("Please make sure "+anno+" column is in input sumstats.") ValueError: Please make sure rsID column is in input sumstats.

It seems that the rsID column is not being recognized in the input summary statistics. Do you have any insight on how to resolve this issue?

Thanks again for your help!

Best regards,

Xiaoyang Dai

Message ID: @.***>

Cloufield commented 3 weeks ago

Hi Xiaoyang,

  1. It is already available and please try pip install gwaslab==3.4.49 again.
  2. I havent replicated this yet. Based on your code,rsID ` is not needed here. Could you please share the full log for this command. Thanks!
XiaoyangDai1 commented 3 weeks ago

Thank you, I dont know why I can not use pip access the latest version, but I use git clone and managed to do it. Besides, I used the anno_set and alias to finish the annotaion of the figure which works. So everything is done, thank you!