Cloufield / gwaslab

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

plot_mqq() snpid problem #67

Open poemon opened 10 months ago

poemon commented 10 months ago

I imported my own data and encountered an error when generating the image. May I ask why this happened?

import gwaslab as gl
mysumstats = gl.Sumstats("example.txt", fmt="auto")
>>> mysumstats.plot_mqq()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/xin/.local/lib/python3.10/site-packages/gwaslab/Sumstats.py", line 477, in plot_mqq
    snpid=snpid, 
UnboundLocalError: local variable 'snpid' referenced before assignment
Cloufield commented 10 months ago

Hi, Sorry for the error. I am wondering which gwaslab version you are using now, and would you please show some sample rows of your data by mysumstats.data? I guess one of the reasons might be that rsID or SNPID column was not loaded into your mysumstats Object in auto mode. You can specify the snpid column when loading sumstats using mysumstats = gl.Sumstats("example.txt", fmt="auto",snpid="my_snp_id_column_header", sep="\t").