Cloufield / gwaslab

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

miami image really huge #59

Closed swvanderlaan closed 8 months ago

swvanderlaan commented 9 months ago

When I create two regular Manhattans, with these options (on v3.4.28):

# manhattan and qq plot
gwas_men_sumstats_eur_qc.plot_mqq(
    skip=2,
    cut=10,
    sig_line=True,
    sig_level=5e-8,
    anno="GENENAME",
    anno_style="right",
    windowsizekb=500,
    arm_offset=2,
    repel_force=0.02,  # default 0.01
    use_rank=True,
    build="19",
    # mode="m",
    stratified=True,
    drop_chr_start=True,
    # figargs={"figsize": (25, 15), "dpi": 300},
    title="Men-only, EUR",
    save=os.path.join(PLOTS_loc, "manhattan.500kb.300dpi.MEN.EUR.pdf"),
    saveargs={"dpi": 300},
    verbose=True,
)

The file is not that big, maybe 200Kb.

However, when I create a Miami using the same options, the file becomes really big, about 1.68Gb.

sumstats_miami = gl.plot_miami(
    path1=gwas_women_sumstats_eur_qc,
    path2=gwas_men_sumstats_eur_qc,
    cols1=["CHR", "POS", "P"],
    cols2=["CHR", "POS", "P"],
    titles=["Women, EUR", "Men, EUR"],
    titles_pad=[0.15, 0.0],
    anno="GENENAME",
    region_grid=True,
    # highlight1=[(20, 374763)],  # TRIB3
    # pinpoint2=[(2,653874)],
    save=os.path.join(PLOTS_loc, "manhattan.500kb.300dpi.WOMEN_vs_MEN.EUR.pdf"),
    saveargs={"dpi": 300},
    verbose=True,
)

What am I missing here?

Cloufield commented 9 months ago

Hi, For manhattan plot, I set scatter_kwargs={"rasterized":True} as default for pdf, which is vector-based. I just updated v3.4.29, which should fix this inconsistency. The miami plot will also be rasterized. Please try v3.4.29. Thanks!

swvanderlaan commented 9 months ago

Thanks. I will let you know how it goes.

swvanderlaan commented 8 months ago

This worked!