scores {GenomicScores}R Documentation

Accessing genomic scores

Description

Functions to access genomic scores through GScores objects.

Usage

availableGScores()
getGScores(x)
## S4 method for signature 'GScores,GenomicRanges'
scores(object, ranges, ...)

Arguments

x

A character vector of length 1 specifiying the genomic scores resource to fetch. The function availableGScores() shows the available genomic scores resources.

object

A GScores object.

ranges

A GenomicRanges object with positions from where to retrieve genomic scores.

...

In the call to the scores() method one can additionally set the following arguments:

  • scores.onlyFlag set to FALSE (default) when scores are return in a metadata column called scores from the input GenomicRanges object. When set to TRUE, the only the numeric vector of scores is returned.

  • summaryFunFunction to summarize genomic scores when more than one position is retrieved. By default, this is set to the arithmetic mean, i.e., the mean() function.

  • quantizedFlag setting whether the genomic scores should be returned quantized (TRUE) or dequantized (FALSE, default).

  • refVector of reference alleles in the form of either a character vector, a DNAStringSet object or a DNAStringSetList object. This argument is used only when there are multiple scores per position.

  • altVector of alternative alleles in the form of either a character vector, a DNAStringSet object or a DNAStringSetList object. This argument is used only when there are multiple scores per position.

  • cachingFlag setting whether genomic scores per chromosome should be kept cached in memory (TRUE, default) or not (FALSE). The latter option minimizes the memory footprint but slows down the performance when the scores() method is called multiple times.

Details

The method scores() takes as first argument a GScores-class object that can be loaded from an annotation package or from an AnnotationHub resource. These two possibilities are illustrated in the examples below.

Value

The function availableGScores() returns a character vector with the names of the AnnotationHub resources corresponding to different available sets of genomic scores. The function getGScores() return a GScores object. The method scores() returns a numeric vector.

Author(s)

R. Castelo

See Also

phastCons100way.UCSC.hg19 phastCons100way.UCSC.hg38

Examples

## accessing genomic scores from an annotation package
if (require(phastCons100way.UCSC.hg19)) {
  library(GenomicRanges)

  gsco <- phastCons100way.UCSC.hg19
  gsco
  scores(gsco, GRanges(seqnames="chr7", IRanges(start=117232380, width=5)))
}

## accessing genomic scores from AnnotationHub resources
## Not run: 
availableGScores()
gsco <- getGScores("phastCons100way.UCSC.hg19")
scores(gsco, GRanges(seqnames="chr7", IRanges(start=117232380, width=5)))

## End(Not run)

[Package GenomicScores version 1.2.2 Index]