ShujiaHuang / qmplot

A Python package for creating high-quality manhattan and Q-Q plots from GWAS results.
GNU General Public License v3.0
37 stars 11 forks source link

Manhattanplot option to annotate highlighted SNVs #13

Open igumnov-daniel opened 11 months ago

igumnov-daniel commented 11 months ago

Hi! Here I've added an option to also annotate SNVs provided with "highlight_other_SNPs_indcs" argument.

So if one wants to compare to GWAS results via Manhattanplot or just they just have genes of interest they want to highlight then there is an example below:

# let's consider that processing and creation of a list with SNVs indices is above
# so we have 2 different GWAS experiments and a set of target SNVs

fig, axs = plt.subplots(2, 1, figsize=(10, 8))

manhattanplot(
    data = GWAS_1,
    chrom = 'CHROM',
    pos = 'GENPOS',
    pv = 'pval',
    snp = 'Gene',
    suggestiveline=1e-6,
    genomewideline=1e-8,
    highlight_other_SNPs_indcs=SNVs_to_annotate,
    highlight_other_SNPs_color='magenta',
    ax=axs[0],
    annotate_highlighted_SNPs=True # NEW ARGUMENT
)

manhattanplot(
    data = GWAS_2,
    chrom = 'CHROM',
    pos = 'GENPOS',
    pv = 'pval',
    snp = 'Gene',
    suggestiveline=1e-6,
    genomewideline=1e-8,
    highlight_other_SNPs_indcs=SNVs_to_annotate,
    highlight_other_SNPs_color='magenta',
    annotate_highlighted_SNPs=True, # NEW ARGUMENT
    ax=axs[1]
)

plt.show()

Resultant picture:

изображение

YuandanZhang commented 3 months ago

just check if the additional annotation options has updated in the current release of qmp.lot?