wgscores | R Documentation |
Functions to discover which genomic scores are present in given genomic ranges through GScores
objects.
## S4 method for signature 'GScores,GenomicRanges'
wgscores(x, ranges, ...)
x |
A |
ranges |
A |
... |
In the call to the
|
The method wgscores()
takes as first argument a GScores
object, previouly loaded from either an annotation package or an
AnnotationHub
resource; see getGScores()
and a
GenomicRanges
object as a second argument. It will search for
which genomic scores fall within the provided genomic ranges and return
them in an ordered GenomicRanges
object with the scores in the
metadata columns.
The method wgscores()
returns a GRanges
object with the
genomic scores in metadata columns named after the corresponding score
population name.
R. Castelo
Puigdevall, P. and Castelo, R. GenomicScores: seamless access to genomewide position-specific scores from R and Bioconductor. Bioinformatics, 18:3208-3210, 2018.
MafDb.1Kgenomes.phase1.hs37d5
if (require(MafDb.1Kgenomes.phase1.hs37d5)) {
mafdb <- MafDb.1Kgenomes.phase1.hs37d5
mafdb
populations(mafdb)
## lookup allele frequencies for SNP rs1129038, located at 15:28356859 in
## GRCh37, a SNP associated to blue and brown eye colors as reported by
## Eiberg et al. (Human Genetics, 2008; http://www.ncbi.nlm.nih.gov/pubmed/18172690).
## Blue eye color in humans may be caused by a perfectly associated founder
## mutation in a regulatory element located within the HERC2 gene inhibiting
## OCA2 expression.
##
## for the sake of illustrating this functionality let's create a
## GenomicRanges object with the SNP rs1129038 and enlarge its range
## by 200nt at each flank.
snp <- GRanges("15:28356859")
rngsnp <- flank(snp, width=100, both=TRUE)
width(rngsnp)
## now use this genomic range to search for the rs1129038 SNP
wgscores(mafdb, rngsnp)
## let's illustrate this same functionality for INDELs, starting
## from the specific INDEL rs113993960 that leads to the loss of
## phenylalanine at amino acid position 508 of the CFTR protein,
## commonly referred to as F508del in the CFTR gene, which is
## concretely a deletion of four nucleotides at position
## 7:117199644 in GRCh37 and enlarge its range by 20nt on each flank.
indel <- GRanges(seqnames="chr7",
ranges=IRanges(start=117199644, width=4))
rngindel <- flank(indel, width=20, both=TRUE)
width(rngindel)
## now use this genomic range to search for the rs113993960 INDEL
wgscores(mafdb, rngindel, type="nonsnrs")
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.