-qmplot.manhattanplot(data=pandas.DataFrame(series),
- suggestiveline=2e-10, # Turn off suggestiveline
- genomewideline=2e-11, # Turn off genomewidel
- sign_line_cols=["#D62728", "#2CA02C"],
- marker=".",
- alpha = 0.6,
- hline_kws={"linestyle": "--", "lw": 1.3},
- title="Tile Variant Manhattan Plot",
- # xtick_label_set=xtick,
- xlabel="Chromosome",
- ylabel=r"$-log_{10}{(P)}$",
- xticklabel_kws={"rotation": "vertical"})
-matplotlib.pyplot.savefig(output_path, bbox_inches="tight")
+chroms = {}
+for chrom in series["#CHROM"]:
+ chroms[chrom] = True
+chroms[None] = True
+
+print(f'generating plots', file=sys.stderr)
+for chrom in chroms.keys():
+ output_file = output_path
+ xlabel = "Chromosome"
+ if chrom:
+ output_file = f'.{chrom}.'.join(output_file.rsplit('.', 1))
+ xlabel = f'position on {chrom}'
+ qmplot.manhattanplot(data=pandas.DataFrame(series),
+ CHR=chrom,
+ #suggestiveline=2e-10, # Turn off suggestiveline
+ #genomewideline=2e-11, # Turn off genomewidel
+ sign_line_cols=["#D62728", "#2CA02C"],
+ marker=".",
+ alpha = 0.6,
+ hline_kws={"linestyle": "--", "lw": 1.3},
+ title="Tile Variant Manhattan Plot",
+ xlabel=xlabel,
+ ylabel=r"$-log_{10}{(P)}$",
+ xticklabel_kws={"rotation": "vertical"})
+ matplotlib.pyplot.savefig(output_file, bbox_inches="tight")
+ matplotlib.pyplot.close()