Cloufield / gwaslab

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

Unable to create effect size comparison plot without heterogeneity #112

Open Sandyyy123 opened 5 days ago

Sandyyy123 commented 5 days ago

I am unable to create effect size comparison plot without the need for conducting heteogeneity test and selective annotating/filtering.

Prepare kwargs for the comparison

kwargs = {
    "label": [label1, label2, "Both", "None"],
    "xylabel_prefix": "Per-allele effect size for ",
    "sig_level": 5e-8,
"anno": True,
    "is_q": False,
    "include_all": True,
    "drop": False,
    "is_q_mc": "fdr",  
    "save": os.path.join(base_path, plot_filename),
    "save_args": {"dpi": 300, "facecolor": "white"}
}

If I remove is_q_mc, I end up with error asking me to include it with bon or fdr option.

Also, I could not figure out how to include gene names instead of SNP ids. It seems the option is missing. It would rather require changing the SNPids directly to gene names.

Cloufield commented 5 days ago

Hi, Thanks for the feedback.

If I remove is_q_mc, I end up with error asking me to include it with bon or fdr option.

I am wondering which gwaslab version you are using? In recent versions, this has been fixed.

Also, I could not figure out how to include gene names instead of SNP ids. It seems the option is missing. It would rather require changing the SNPids directly to gene names.

For this, I haven't added this to the effect size comparison plot yet. I will implement this in the new version and let you know (probably by the start of next week).

Sandyyy123 commented 4 days ago

Hi Cloufield, Thanks for getting back. I updated to the latest package 3.4.49. I am still getting the error: raise ValueError("Please select either fdr or bon for is_q_mc.") ValueError: Please select either fdr or bon for is_q_mc. Below is my command:

kwargs = { "label": [label1, label2, "Both", "None"], "xylabel_prefix": "Per-allele effect size for ", "sig_level": 5e-8, "anno": True, "save": os.path.join(base_path, plot_filename), "save_args": {"dpi": 300, "facecolor": "white"} }

Cloufield commented 23 hours ago

Hi, sorry for my late reply. I update gwaslab to v3.5.0. It now support annotation with GENENAME. I tested with your setting and should work now.

kwargs = {
"label": ["label1", "label2", "Both", "None"],
"xylabel_prefix": "Per-allele effect size for ",
"sig_level": 5e-8,
"anno": "GENENAME",
"build":"19",
"save": True,
"save_args": {"dpi": 300, "facecolor": "white"}
}

image

Additionally, you can pass a SNPID:text dictionary for customized annotation like "anno": {"rs11642015":"Some customized annotation"},

image