Cloufield / gwaslab

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

Annotate suggestive SNPs #20

Closed XaviFar closed 1 year ago

XaviFar commented 1 year ago

Hello,

I am currently using the 3.4.12 version, and for a given set of sumstats I wanted to create a plot annotating the genes relaxing a bit the classical GWAS threshold but it skips the annotation part, is there a way to force the annotation to annotate SNPs surpassing the significance level you have established?

mysumstats.plot_mqq(
                  mode="qqm",
                  anno = 'GENENAME',
                  anno_style="expand",
                  build='19',
                  marker_size=(5,10),
                  sig_level=1e-6,
                  figargs={"figsize":(15,5),"dpi":300},
                  save=f"../3-GWAS/plots/{trait}_1e6.png")

Thank you for this useful tool!

Cloufield commented 1 year ago

Hi, Thanks for your question. I just checked and there seems to be a small error that causes the skipping. I will revise this in the next version.

But for the current version, you can try using sig_level=1e-6, sig_level_lead=1e-6 to set the threshold for extracting lead variants, and then use suggestive_sig_line=True, suggestive_sig_level=5e-8, to add the genome-wide significance line.

mysumstats.plot_mqq(region=(1,0,100000000),skip=3, build="19",
                    sig_level=1e-6,  sig_level_lead=1e-6,  sig_line=True, sig_line_color="grey",
                    suggestive_sig_level=1e-8, suggestive_sig_line=True,  suggestive_sig_line_color="red",
                    , anno = 'GENENAME',anno_style="expand")

image

Cloufield commented 1 year ago

sig_level_lead was originally designed as the threhold for extracting lead variants for annotation. In v3.4.12, the lower one of sig_level_lead and sig_level was mistakenly set as the threhold for extracting lead variants. In v3.4.13, this will be fixed.

Cloufield commented 1 year ago

Fixed in v3.4.14. Using only sig_level_lead to set the threshold for extracting lead variants to annotate.