Skip to contents

Plot influential genes for a given trait and cell type after running find_inf_genes().

Usage

plot_inf_genes(
  inf_df,
  num_labels = 10,
  consider_neg_zstat = F,
  repel = T,
  gene_col = "gene",
  spec_col = "specificity",
  trait_col = "zstat",
  df_betas_col = "dfbetas",
  indicator_col = "is_influential"
)

Arguments

inf_df

A data.frame or data.table of influential gene scores output by seismic. Must contain columns that correspond to genes, seismic specificity scores, MAGMA trait z-scores, dfbeta values, and a Boolean column indicating influential genes.

num_labels

Number of top influential genes to label (can also specify "all") with name in provided 'gene_col'. When given specific numbers, the top influential genes (by dfbetas) will be labeled. Only genes that have is_influential==T will be labeled.

consider_neg_zstat

A Boolean value indicating whether genes with negative z-scores should be considered (aka for coloring and gene labels). Defaults to FALSE.

repel

A Boolean value indicating whether or not to use the ggrepel package for clearer labeling. Defaults to TRUE.

gene_col

A character string containing the name of the gene identifier column. Defaults to 'gene' the column output by find_inf_genes().

spec_col

A character string containing the name of the specificity column. Defaults to 'specificity' the column output by find_inf_genes().

trait_col

A character string containing the name of the MAGMA z-score column. Defaults to 'zstat' the column output by find_inf_genes().

df_betas_col

A character string containing the name of the dfbetas column. Defaults to 'dfbetas' the column output by find_inf_genes().

indicator_col

A character string containing the name of the influential gene indicator column. Defaults to 'is_influential' the column output by find_inf_genes().

Value

A ggplot object of geom_point.