locus {locuszoomr} | R Documentation |
Create locus object for plotting
Description
Creates object of class 'locus' for genomic locus plot similar to
locuszoom
.
Usage
locus(
gene = NULL,
data = NULL,
xrange = NULL,
seqname = NULL,
flank = NULL,
fix_window = NULL,
ens_db,
chrom = NULL,
pos = NULL,
p = NULL,
yvar = NULL,
labs = NULL,
index_snp = NULL,
LD = NULL
)
Arguments
gene |
Optional character value specifying which gene to view. Either
|
data |
Dataset (data.frame or data.table) to use for plot. If
unspecified or |
xrange |
Optional vector of genomic position range for the x axis. |
seqname |
Optional, specifies which chromosome to plot. |
flank |
Single value or vector with 2 values for how much flanking region left and right of the gene to show. Defaults to 100kb. |
fix_window |
Optional alternative to |
ens_db |
Either a character string which specifies which Ensembl
database package (version 86 and earlier for Homo sapiens) to query for
gene and exon positions (see |
chrom |
Determines which column in |
pos |
Determines which column in |
p |
Determines which column in |
yvar |
Specifies column in |
labs |
Determines which column in |
index_snp |
Specifies the index SNP. If not specified, the SNP with the
lowest P value is selected. Can be used to specify locus region instead of
specifying |
LD |
Optional character value to specify which column in |
Details
This is an R version of locuszoom
(http://locuszoom.org) for generating
publication ready Manhattan plots of gene loci. It references Ensembl
databases using the ensembldb
Bioconductor package framework for annotating
genes and exons in the locus.
Value
Returns an object of class 'locus' ready for plotting, containing:
seqname |
chromosome value |
xrange |
vector of genomic position range |
gene |
gene name |
ens_db |
Ensembl or AnnotationHub database version |
chrom |
column name in |
pos |
column name in |
p |
column name in |
yvar |
column name in |
labs |
column name in |
index_snp |
id of the most significant SNP |
data |
the subset of GWAS data to be plotted |
TX |
dataframe of transcript annotations |
EX |
|
If data
is NULL
when locus()
is called then gene track information
alone is returned.
See Also
locus_plot()
locus_ggplot()
locus_plotly()
Examples
## Bioconductor package EnsDb.Hsapiens.v75 is needed for these examples
if(require(EnsDb.Hsapiens.v75)) {
data(SLE_gwas_sub)
loc <- locus(SLE_gwas_sub, gene = 'UBE2L3', flank = 1e5,
ens_db = "EnsDb.Hsapiens.v75")
summary(loc)
locus_plot(loc)
loc2 <- locus(SLE_gwas_sub, gene = 'STAT4', flank = 1e5,
ens_db = "EnsDb.Hsapiens.v75")
locus_plot(loc2)
}