locuszoom()
displays the association results for a smaller region within one chromosome.
Required parameter is at least one dataset (dataframe) containing the association data (with columns CHROM,POS,P
in upper or lowercase)
locuszoom(
df,
annotate = NULL,
ntop = 3,
xmin = 0,
size = 2,
shape = 19,
alpha = 1,
label_size = 4,
annotate_with = "ID",
color = NULL,
axis_text_size = 11,
axis_title_size = 12,
title_text_size = 13,
show_genes = NULL,
show_overview = FALSE,
show_exons = FALSE,
max_genes = 200,
sign_thresh = 5e-09,
sign_thresh_color = "red",
sign_thresh_label_size = 3.5,
xmax = NULL,
ymin = NULL,
ymax = NULL,
protein_coding_only = FALSE,
region_size = 1e+06,
gene_padding = 1e+05,
angle = 0,
legend_title_size = 12,
legend_text_size = 12,
nudge_x = 0.01,
nudge_y = 0.01,
rsids = NULL,
variant = NULL,
rsids_color = "gray40",
legend_name = "Data:",
legend_position = "right",
chr = NULL,
vline = NULL,
show_gene_names = NULL,
legend_labels = NULL,
gene = NULL,
title = NULL,
label_color = "gray40",
region = NULL,
scale = 1,
rsids_with_vline = NULL,
annotate_with_vline = NULL,
sign_thresh_size = 0.5,
unit_main = 7,
unit_gene = 2,
gene_color = NULL,
segment.size = 0.2,
segment.color = "black",
segment.linetype = "solid",
show_gene_legend = TRUE,
max.overlaps = 10,
extract_plots = FALSE,
label_fontface = "plain",
label_family = "",
gene_label_fontface = "plain",
gene_label_family = "",
build = 38,
verbose = NULL,
show_legend = TRUE,
label_alpha = 1
)
Dataframe or a list of dataframes (required columns are CHROM,POS,P
), in upper- or lowercase) of association results.
A number (p-value). Display annotation for variants with p-values below this threshold
An integer, number of datasets (GWASes) to show on the top plot
Integer, setting the chromosomal range to display on the x-axis
A number or a vector of numbers, setting the size of the plot points (default: size=1.2
)
A number of a vector of numbers setting the shape of the plotted points
A number or a vector of numbers setting the transparency of the plotted points
An number to set the size of the plot labels (default: label_size=3
)
A string. Annotate the variants with either Gene_Symbol or ID (default: "Gene_Symbol")
A string or a vector of strings, for setting the color of the datapoints on the plot
A number, size of the x and y axes tick labels (default: 12)
A number, size of the x and y title labels (default: 12)
A number, size of the plot title (default: 13)
A logical scalar, show genes instead of exons (default show_genes=FALSE)
A logical scalar, shows/hides the overview plot (default= TRUE)
Deprecated : A logical scalar, show exons instead of genees (default show_exons=FALSE)
An integer, only label the genes if they are fewer than max_genes (default values is 200).
A number or vector of numbers, setting the horizontal significance threshold (default: sign_thresh=5.1e-9
). Set to NULL to hide the significance threshold.
A string or vector of strings to set the color/s of the significance threshold/s
A number setting the text size of the label for the significance thresholds (default text size is 3.5)
Integer, min and max of the y-axis, (default values: ymin=0, ymax=max(-log10(df$P))
)
A logical scalar, if TRUE, only protein coding genes are used for annotation
An integer (default = 1000000) (or a string represented as 100kb or 1MB) indicating the window size for variant labeling. Increase this number for sparser annotation and decrease for denser annotation.
An integer representing size of the region around the gene, if the gene argument was used (default = 100000)
A number, the angle of the text label
A number, size of the legend title
A number, size of the legend text
A number to vertically adjust the starting position of each gene label (this is a ggrepel parameter)
A number to horizontally adjust the starting position of each gene label (this is a ggrepel parameter)
A string (rsid) or vector of strings to highlight on the plot, e.g. rsids=c("rs1234, rs45898")
A string representing the variant to zoom in on. Can be either an rsid, or a dataframe (with the columns CHROM,POS,P)
A string, the color of the variants in variants_id (default color is red)
A string, use to change the name of the legend (default: None)
A string, top,bottom,left or right
A string or integer, the chromosome to plot (i.e. chr15), only required if the input dataframe contains results from more than one chromosome
A number or vector of numbers to add a vertical line to the plot at a specific chromosomal position, e.g vline=204000066
. Multiple values can be provided in a vector, e.g vline=c(204000066,100500188)
A logical scalar, if set to TRUE, gene names are shown even though they exceed the max_genes count
A string or vector of strings representing legend labels for the input dataset's
A string representing the gene to zoom in on (e.g. gene=FTO)
A string to set the plot title
A string or a vector of strings. To change the color of the gene or variant labels
A string representing a genetic region, e.g. chr1:67038906-67359979
A number, to change the size of the title and axes labels and ticks at the same time (default = 1)
A string (rsid) or vector of strings to highlight on the plot with their rsids and vertical lines further highlighting their positions
A number (p-value). Display annotation and vertical lines for variants with p-values below this threshold
A number, sets the size of the horizontal significance threshold line (default = 1)
the height unit of the main plot (default = 7)
the height unit of the gene plot (default= 2 )
A string representing a color, can be used to change the color of the genes/exons on the geneplot
line segment color (ggrepel argument)
line segment thickness (ggrepel argument)
line segment solid, dashed, etc.(ggrepel argument)
A logical scalar, set to FALSE to hide the gene legend (default value is TRUE)
Exclude text labels that overlap too many things. Defaults to 10 (ggrepel argument)
Logical, FALSE by default. Set to TRUE to extract the three plots separately in a list
A string or a vector of strings. Label font “plain”, “bold”, “italic”, “bold.italic” (ggrepel argument)
A stirng or a vector of strings. Label font name (default ggrepel argument is "")
Gene label font “plain”, “bold”, “italic”, “bold.italic” (ggrepel argument)
Gene label font name (default ggrepel argument is "")
A number representing the genome build. Set to 37 to change to build (GRCh37). The default is build 38 (GRCh38).
Logical, set to FALSE to get suppress printed information
A logical scalar, set to FALSE to hide the legend (default value is TRUE)
An number or vector of numbers to set the transparency of the plot labels (default: label_alpha=1
)
plots using egg (https://cran.r-project.org/web/packages/egg/vignettes/Ecosystem.html)
if (FALSE) {
locuszoom(R2_CD_UKBB)
}