Plots the cTWAS result for a single locus

make_locusplot(
  finemap_res,
  region_id,
  weights,
  ens_db,
  R_snp_gene = NULL,
  R_gene = NULL,
  locus_range = NULL,
  focal_gene = NULL,
  filter_genetrack_biotype = "protein_coding",
  highlight_pval = NULL,
  highlight_pip = 0.8,
  highlight_pos = NULL,
  label_QTLs = TRUE,
  point.sizes = c(1.5, 3.5),
  point.alpha = c(0.4, 0.7),
  point.shapes = c(16, 15),
  label.text.size = 2.5,
  legend.text.size = 10,
  legend.position = "top",
  panel.heights = c(4, 4, 1, 4)
)

Arguments

finemap_res

a data frame of cTWAS finemapping result

region_id

region ID to be plotted

weights

a list of weights

ens_db

Ensembl database

R_snp_gene

SNP-gene correlation matrix of the region. If both R_snp_gene and R_gene are available, color data points with correlations with the focal gene.

R_gene

gene-gene correlation matrix of the region

locus_range

a vector of start and end positions to define the region boundary to be plotted. If NULL, the entire region will be plotted (with 100 bp flanks on both sides).

focal_gene

the focal gene name. If NULL, choose the gene with the highest PIP.

filter_genetrack_biotype

biotype to be displayed in gene tracks. By default, limits to protein coding genes. If NULL, display all possible ones.

highlight_pval

pvalue to highlight with a horizontal line

highlight_pip

PIP to highlight with a horizontal line

highlight_pos

genomic positions to highlight with vertical lines

label_QTLs

If TRUE, label SNP IDs in the QTL panel.

point.sizes

size values for SNP and gene data points in the scatter plots

point.alpha

alpha values for SNP and gene data points in the scatter plots

point.shapes

shapes values for data points of different types in the scatter plots

label.text.size

Font size for gene and SNP label text

legend.text.size

Font size for legend text

legend.position

position to put legends. If "none", no legends will be shown.

panel.heights

Relative heights of the panels.