plot_locus | R Documentation |
Generate a locus-specific plot with multiple selectable tracks. Users can also generate multiple zoomed in views of the plot at multiple resolutions.
plot_locus(
dat,
locus_dir,
LD_matrix = NULL,
LD_reference = NULL,
facet_formula = "Method~.",
dataset_type = "GWAS",
color_r2 = TRUE,
finemap_methods = c("ABF", "FINEMAP", "SUSIE", "POLYFUN_SUSIE"),
track_order = NULL,
track_heights = NULL,
plot_full_window = TRUE,
dot_summary = FALSE,
qtl_suffixes = NULL,
mean.PP = TRUE,
credset_thresh = 0.95,
consensus_thresh = 2,
sig_cutoff = 5e-08,
gene_track = TRUE,
tx_biotypes = NULL,
point_size = 1,
point_alpha = 0.6,
density_adjust = 0.2,
snp_group_lines = c("Lead", "UCS", "Consensus"),
labels_subset = c("Lead", "CS", "Consensus"),
xtext = FALSE,
show_legend_genes = TRUE,
xgr_libnames = NULL,
xgr_n_top = 5,
roadmap = FALSE,
roadmap_query = NULL,
roadmap_n_top = 7,
zoom_exceptions_str = "*full window$|zoom_polygon",
nott_epigenome = FALSE,
nott_regulatory_rects = TRUE,
nott_show_placseq = TRUE,
nott_binwidth = 200,
nott_bigwig_dir = NULL,
save_plot = FALSE,
show_plot = TRUE,
genomic_units = "Mb",
strip.text.y.angle = 0,
max_transcripts = 1,
zoom = c("1x"),
dpi = 300,
height = 12,
width = 10,
plot_format = "png",
save_RDS = FALSE,
return_list = FALSE,
conda_env = "echoR_mini",
nThread = 1,
verbose = TRUE
)
dat |
Data to query transcripts with. |
locus_dir |
Storage directory to use. |
LD_matrix |
LD matrix. |
LD_reference |
LD reference to use:
|
facet_formula |
Formula to facet plots by. See facet_grid for details. |
dataset_type |
Dataset type (e.g. "GWAS" or "eQTL"). |
color_r2 |
Whether to color data points (SNPs) by how strongly they correlate with the lead SNP (i.g. LD measured in terms of r2). |
finemap_methods |
Fine-mapping methods to plot tracks for, where the y-axis show the Posterior Probabilities (PP) of each SNP being causal. |
track_order |
The order in which tracks should appear (from top to bottom). |
track_heights |
The height of each track (from top to bottom). |
plot_full_window |
Include a track with a Manhattan plot of the full GWAS/eQTL locus (not just the zoomed-in portion). |
dot_summary |
Include a dot-summary plot that highlights the Lead, Credible Set, and Consensus SNPs. |
qtl_suffixes |
If columns with QTL data is included in |
mean.PP |
Include a track showing mean Posterior Probabilities (PP) averaged across all fine-mapping methods. |
credset_thresh |
The minimum fine-mapped posterior probability
for a SNP to be considered part of a Credible Set.
For example, |
consensus_thresh |
The minimum number of fine-mapping tools in which a SNP is in the Credible Set in order to be included in the "Consensus_SNP" column. |
sig_cutoff |
Filters out SNPs to plot based on an (uncorrected) p-value significance cutoff. |
gene_track |
Include a track showing gene bodies. |
tx_biotypes |
Transcript biotypes to include in the gene model track.
By default ( |
point_size |
Size of each data point. |
point_alpha |
Opacity of each data point. |
density_adjust |
Passed to |
snp_group_lines |
Include vertical lines to help highlight SNPs belonging to one or more of the following groups: Lead, Credible Set, Consensus. |
labels_subset |
Include colored shapes and RSID labels to help highlight SNPs belonging to one or more of the following groups: Lead, Credible Set, Consensus. |
xtext |
Include x-axis title and text for each track (not just the lower-most one). |
show_legend_genes |
Show the legend for the |
xgr_libnames |
Passed to XGR_plot.
Which XGR annotations to check overlap with.
For full list of libraries see
here.
Passed to the
|
xgr_n_top |
Passed to XGR_plot. Number of top annotations to be plotted (passed to XGR_filter_sources and then XGR_filter_assays). |
roadmap |
Find and plot annotations from Roadmap. |
roadmap_query |
Only plot annotations from Roadmap whose
metadata contains a string or any items from a list of strings
(e.g. |
roadmap_n_top |
Passed to ROADMAP_plot. Number of top annotations to be plotted (passed to ROADMAP_query). |
zoom_exceptions_str |
Names of tracks to exclude when zooming. |
nott_epigenome |
Include tracks showing brain cell-type-specific epigenomic data from Nott et al. (2019). |
nott_regulatory_rects |
Include track generated by NOTT2019_epigenomic_histograms. |
nott_show_placseq |
Include track generated by NOTT2019_plac_seq_plot. |
nott_binwidth |
When including Nott et al. (2019) epigenomic data in the track plots, adjust the bin width of the histograms. |
nott_bigwig_dir |
Instead of pulling Nott et al. (2019) epigenomic data from the UCSC Genome Browser, use a set of local bigwig files. |
save_plot |
Save plot as RDS file. |
show_plot |
Print plot to screen. |
genomic_units |
Which genomic units to return window limits in. |
strip.text.y.angle |
Angle of the y-axis facet labels. |
max_transcripts |
Maximum number of transcripts per gene. |
zoom |
Zoom into the center of the locus when plotting (without editing the fine-mapping results file). You can provide either:
You can pass a list of window sizes (e.g. |
dpi |
dpi to use for raster graphics |
height |
height (defaults to the height of current plotting window) |
width |
width (defaults to the width of current plotting window) |
plot_format |
Format to save plot as when saving with ggsave. |
save_RDS |
Save the tracks as an RDS file (Warning: These plots take up a lot disk space). |
return_list |
Return a named list with each track as a separate plot
(default: |
conda_env |
Conda environments to search in.
If |
nThread |
Number of threads to parallelize over. |
verbose |
Print messages. |
dat1 <- echodata::BST1
LD_matrix <- echodata::BST1_LD_matrix
locus_dir <- file.path(tempdir(),echodata::locus_dir)
plt <- echoplot::plot_locus(dat = dat1,
locus_dir = locus_dir,
LD_matrix = LD_matrix,
show_plot = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.