Plot the output of cTWAS at a single locus
ctwas_locus_plot(
ctwas_res,
region_tag,
outputdir,
outname,
focus = NULL,
xlim = NULL,
ymax_twas = NULL,
twas_sig_thresh = NULL,
alt_names = NULL,
label_panel = c("both", "cTWAS", "TWAS"),
label_genes = NULL,
label_pos = NULL,
plot_eqtl = NULL,
legend_panel = c("cTWAS", "TWAS"),
legend_side = c("right", "left"),
rerun_ctwas = F,
rerun_load_only = F,
return_table = F,
show_correlations = T,
z_snp = NULL,
z_gene = NULL,
empty_gene_track = F
)
the main output of ctwas_rss
as a data frame, with z-scores included
a character with format "regiontag1_regiontag2" indicating the reigon to plot; e.g. "16_1"
a string, the directory where ctwas output is stored
a string, the output name
the focal gene; points are colored by correlations with this gene. The lead TWAS gene by default
a vector with the start and end positions to plot, in megabases
the ymax parameter of the TWAS panel
the significance threshold for TWAS as a p-value
the name of the column that contains alternative gene names in ctwas_res
; null by default
the panel(s) to plot gene gene names; both cTWAS and TWAS panels by default
the gene names to label; all by default
a vector of the same length as label_genes
indicating the position of the gene labels; 1=below, 2=left, 3=above, 4=right. Above by default.
the genes to plot eQTL tracks for; the gene specified by focus
by default
the panel to plot the legend in
the side to plot the legend on
if TRUE, cTWAS will be re-run at this locus with thin=1
to ensure all variants are plotted
if TRUE, the function will look for results generated by rerun_ctwas=T
without running cTWAS again
if TRUE, return the table that underlies the plot
if TRUE, genes and variants are colored by their correlations with focus
the z_snp
argument supplied to ctwas_rss
; required if rerun_ctwas=T
the z_gene
argument supplied to ctwas_rss
; required if rerun_ctwas=T
if TRUE, leave space below the plot for the gene track generated by the ctwas_locus_plot_genetrack
function