Plots the cTWAS result for a single locus
make_locusplot(
finemap_res,
region_id,
ens_db,
weights = NULL,
R_snp_gene = NULL,
R_gene = NULL,
locus_range = NULL,
focal_id = NULL,
focal_gene = NULL,
filter_protein_coding_genes = TRUE,
filter_cs = TRUE,
color_pval_by = c("cs", "LD", "none"),
color_pip_by = c("cs", "LD", "none"),
LD.colors = c("grey", "blue", "purple", "salmon"),
cs.colors = c("firebrick", "dodgerblue", "forestgreen", "darkmagenta", "darkorange"),
focal.colors = c("grey", "salmon"),
label_QTLs = TRUE,
highlight_pval = NULL,
highlight_pip = 0.8,
highlight_pos = NULL,
highlight.color = "red",
highlight.pos.color = "cyan2",
point.sizes = c(1, 3),
point.alpha = c(0.4, 0.6),
point.shapes = c(16, 15, 18, 17, 10, 12, 14, 11),
label.text.size = 2.5,
max.overlaps = 10,
axis.text.size = 8,
axis.title.size = 10,
legend.text.size = 9,
legend.position = "top",
genelabel.cex.text = 0.7,
panel.heights = c(4, 4, 1, 4),
verbose = FALSE
)
a data frame of cTWAS finemapping result
region ID to be plotted
Ensembl database
a list of proprocessed weights, used to plot QTL track. If NULL, will not plot the QTL track.
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.
gene-gene correlation matrix of the region
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).
the focal ID.
the focal gene name. By default, use the gene with the highest PIP.
If TRUE, limits to protein coding genes only.
If TRUE, limits to credible sets.
Options to color the p-value track. "LD": colors the p-value track by the correlations to the focal gene. "cs": colors the p-value track by the credible sets. "none": uses the same color for non-focal genes.
Options to color the PIP track. "LD": colors the PIP track by the correlations to the focal gene. "cs": colors the PIP track by the credible sets. "none": uses the same color for non-focal genes.
Colors for correlation levels.
Colors for credible sets.
Colors for non-focal and focal gene.
If TRUE, label SNP IDs in the QTL panel.
p-value to highlight with a horizontal line
PIP to highlight with a horizontal line
genomic positions to highlight with vertical lines
color for horizontal lines highlighting p-values and PIPs.
color for vertical lines highlighting genomic positions.
size values for SNP and non-SNP data points in the scatter plots
alpha values for SNP and non-SNP data points in the scatter plots
shapes values for data points of different types in the scatter plots
Font size for gene and SNP label text
Setting for geom_text_repel() function to label texts. Exclude text labels when they overlap too many other things.
Font size for axis label text.
Font size for axis title text.
Font size for legend text.
position to put legends. If "none", no legends will be shown.
Size for gene label text.
Relative heights of the panels.
If TRUE, print detail messages.