cellink.pl.locus#
- cellink.pl.locus(locus_df, gene_df=None, pval_col='pval', position_col='pos', label_column=None, significance_threshold=None, highlight_color='#D62728', point_size=20, figsize=(10, 5), labelsize=10, titlesize=14, title=None, gene_color='#1f77b4', gene_style='box', show_genes=True, show=None, save=None, dpi=300, ax=None)#
Generate a locus plot with SNP p-values and optional gene annotations.
- Parameters:
locus_df (pandas.DataFrame) – DataFrame containing SNP positions and p-values.
gene_df (pandas.DataFrame, optional) – DataFrame of gene annotations with columns: “start”, “end”, “gene”, and optionally “strand”.
pval_col (str, default "pval") – Column name in
locus_dffor p-values.position_col (str, default "pos") – Column name in
locus_dffor genomic positions.label_column (str or None, optional) – Column in
locus_dfused to label significant SNPs.significance_threshold (float, optional) – Threshold below which SNPs are highlighted and optionally labeled.
highlight_color (str, default "#D62728") – Color used to highlight significant SNPs.
point_size (int, default 20) – Size of scatter plot points.
figsize (tuple, default (10, 5)) – Size of the figure (width, height) in inches.
labelsize (int, default 10) – Font size for axis and annotation labels.
titlesize (int, default 14) – Font size for the plot title.
title (str, optional) – Title for the plot.
gene_color (str, default "#1f77b4") – Color used for gene annotations.
gene_style ({'box', 'bracket'}, default "box") – Style used for gene annotations. “box” draws rectangles, “bracket” draws lines with caps.
show_genes (bool, default True) – Whether to include gene annotations beneath the plot.
show (bool or None, optional) – Whether to display the plot. If None, shows only when
axis not provided.save (str or bool or None, optional) – If a string, saves the plot to the specified file path. If True, saves as “locus_plot.png”.
dpi (int, default 300) – Resolution of the saved figure in dots per inch.
ax (matplotlib.axes.Axes or None, optional) – Optional Matplotlib Axes object to plot into.
- Return type:
- Returns:
matplotlib.figure.Figure The resulting locus plot figure.