gg_scatter | R Documentation |
Produces a scatter plot from a 'locus' class object (without gene tracks).
gg_scatter(
loc,
index_snp = loc$index_snp,
pcutoff = 5e-08,
scheme = c("grey", "dodgerblue", "red"),
size = 2,
cex.axis = 1,
cex.lab = 1,
xlab = NULL,
ylab = NULL,
yzero = (loc$yvar == "logP"),
xticks = TRUE,
border = FALSE,
showLD = TRUE,
LD_scheme = c("grey", "royalblue", "cyan2", "green3", "orange", "red", "purple"),
recomb_col = "blue",
legend_pos = "topleft",
labels = NULL,
eqtl_gene = NULL,
beta = NULL,
shape = NULL,
shape_values = c(21, 24, 25),
...
)
loc |
Object of class 'locus' to use for plot. See locus. |
index_snp |
Specifies index SNP to be shown in a different colour and
symbol. Defaults to the SNP with the lowest p-value. Set to |
pcutoff |
Cut-off for p value significance. Defaults to p = 5e-08. Set
to |
scheme |
Vector of 3 colours if LD is not shown: 1st = normal points, 2nd = colour for significant points, 3rd = index SNP. |
size |
Specifies size for points. |
cex.axis |
Specifies font size for axis numbering. |
cex.lab |
Specifies font size for axis titles. |
xlab |
x axis title. |
ylab |
y axis title. |
yzero |
Logical whether to force y axis limit to include y=0. |
xticks |
Logical whether x axis numbers and axis title are plotted. |
border |
Logical whether a bounding box is plotted around the plot. |
showLD |
Logical whether to show LD with colours |
LD_scheme |
Vector of colours for plotting LD. The first colour is for SNPs which lack LD information. The next 5 colours are for r2 or D' LD results ranging from 0 to 1 in intervals of 0.2. The final colour is for the index SNP. |
recomb_col |
Colour for recombination rate line if recombination rate
data is present. Set to NA to hide the line. See |
legend_pos |
Position of legend. Set to |
labels |
Character vector of SNP or genomic feature IDs to label. The
value "index" selects the highest point or index SNP as defined when
|
eqtl_gene |
Optional column name in |
beta |
Optional column name for beta coefficient to display upward triangles for positive beta and downward triangles for negative beta (significant SNPs only). |
shape |
Optional column name in |
shape_values |
Vector of shape values which match levels of the column
specified by |
... |
Optional arguments passed to |
If recombination rate data is included in the locus object following a call
to link_recomb()
, this is plotted as an additional line with a secondary y
axis. In the base graphics version the line is placed under the scatter
points, but this is not possible with ggplot2 as the secondary y axis data
must be plotted on top of the primary scatter point data.
Returns a ggplot2 plot.
locus()
gg_addgenes()
if(require(EnsDb.Hsapiens.v75)) {
data(SLE_gwas_sub)
loc <- locus(SLE_gwas_sub, gene = 'IRF5', flank = c(7e4, 2e5), LD = "r2",
ens_db = "EnsDb.Hsapiens.v75")
gg_scatter(loc)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.