GScores-class: GScores objects

Description Details Constructor Accessors Author(s) References See Also Examples

Description

The goal of the GenomicScores package is to provide support to store and retrieve genomic scores associated to physical nucleotide positions along a genome. This is achieved through the GScores class of objects, which is a container for genomic score values.

Details

The GScores class attempts to provide a compact storage and efficient retrieval of genomic score values that have been typically processed and stored using some form of lossy compression. This class is currently based on a former version of the SNPlocs class defined in the BSgenome package, with the following slots:

provider

(character), the data provider such as UCSC.

provider_version

(character), the version of the data as given by the data provider, typically a date in some compact format.

download_url

(character), the URL of the data provider from where the original data were downloaded.

download_date

(character), the date on which the data were downloaded.

reference_genome

(GenomeDescription), object with information about the reference genome whose physical positions have the genomic scores.

data_pkgname

(character), name given to the set of genomic scores associated to a particular genome. When the genomic scores are stored within an annotation package, then this corresponds to the name of that package.

data_dirpath

(character), absolute path to the local directory where the genomic scores are stored in one file per genome sequence.

data_serialized_objnames

(character), named vector of filenames pointing to files containing the genomic scores in one file per genome sequence. The names of this vector correspond to the genome sequence names.

data_group

(character), name denoting a category of genomic scores to which the scores stored in the object belong to. Typical values are "Conservation", "MAF", "Pathogenicity", etc.

data_tag

(character), name identifying the genomic scores stored in the object and which can be used, for instance, to assign a column name storing these scores.

data_pops

(character), vector of character strings storing score population names. The term "default" is reserved to denote a score set that is not associated to a particular population name and is used by default.

data_nonsnrs

(logical), flag indicating whether the object stores genomic scores associated with non-single nucleotide ranges.

data_nsites

(integer), number of sites in the genome associated with the genomic scores stored in the object.

.data_cache

(environment), data structure where objects storing genomic scores are cached into main memory.

The goal of the design behind the GScores class is to load into main memory only the objects associated with the queried sequences to minimize the memory footprint, which may be advantageous in workflows that parallelize the access to genomic scores by genome sequence.

GScores objects are created either from AnnotationHub resources or when loading specific annotation packages that store genomic score values. Two such annotation packages are:

phastCons100way.UCSC.hg19

Nucleotide-level phastCons conservation scores from the UCSC Genome Browser calculated from multiple genome alignments from the human genome version hg19 to 99 vertebrate species.

phastCons100way.UCSC.hg38

Nucleotide-level phastCons conservation scores from the UCSC Genome Browser calculated from multiple genome alignments from the human genome version hg38 to 99 vertebrate species.

Constructor

GScores(provider, provider_version, download_url, download_date, reference_genome, data_pkgname, data_dirpath, data_serialized_objnames, default_pop, data_tag): Creates a GScores object. In principle, the end-user needs not to call this function.

provider

character string, containing the data provider.

provider_version

character string, containing the version of the data as given by the data provider.

download_url

character string, containing the URL of the data provider from where the original data were downloaded.

reference_genome

GenomeDescription, storing the information about the associated reference genome.

data_pkgname

character string, name given to the set of genomic scores stored through this object.

data_dirpath

character string, absolute path to the local directory where the genomic scores are stored.

data_serialized_objname

character string vector, containing filenames where the genomic scores are stored.

default_pop

character string, containing the name of the default scores population.

data_group

character string, containing a name that indicates a category of genomic scores to which the scores in the object belong to. Typical names could be "Conservation", "MAF", etc.

data_tag

character string, containing a tag that succintly labels genomic scores from a particular source. This can be used to automatically give, for instance, a name to a column storing genomic scores in data frame object. Its default value takes the prefix of the package name.

Accessors

name(x): get the name of the set of genomic scores.

type(x): get the substring of the name of the set of genomic scores comprised between the first character until the first period. This should typically match the type of genomic scores such as, phastCons, phyloP, etc.

provider(x): get the data provider.

providerVersion(x): get the provider version.

organism(x): get the organism associated with the genomic scores.

seqlevelsStyle(x): get the genome sequence style.

seqinfo(x): get the genome sequence information.

seqnames(x): get the genome sequence names.

seqlengths(x): get the genome sequence lengths.

populations(x): get the identifiers of the available scores populations. If only one scores population is available, then it shows only the term default.

defaultPopulation(x): get or set the default population of scores.

gscoresCategory(x): get or set the genomic scores category label.

gscoresTag(x): get or set the genomic scores tag label.

gscoresNonSNRs(x): get whether there are genomic scores associated with non-single nucleotide ranges.

nsites(x): get the number of sites in the genome with genomic scores.

qfun(x): get the quantizer function.

dqfun(x): get the dequantizer function.

citation(x): get citation information for the genomic scores data in the form of a bibentry object.

Author(s)

R. Castelo

References

Puigdevall, P. and Castelo, R. GenomicScores: seamless access to genomewide position-specific scores from R and Bioconductor. Bioinformatics, 18:3208-3210, 2018.

See Also

gscores() score() phastCons100way.UCSC.hg19

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
## one genomic range of width 5
gr1 <- GRanges(seqnames="chr7", IRanges(start=117232380, width=5))
gr1

## five genomic ranges of width 1
gr2 <- GRanges(seqnames="chr7", IRanges(start=117232380:117232384, width=1))
gr2

## supporting annotation packages with genomic scores
if (require(phastCons100way.UCSC.hg19)) {
  library(GenomicRanges)

  gsco <- phastCons100way.UCSC.hg19
  gsco
  gscores(gsco, gr1)
  score(gsco, gr1)
  gscores(gsco, gr2)
  populations(gsco)
  gscores(gsco, gr2, pop="DP2")
}

## supporting AnnotationHub resources
## Not run: 
availableGScores()
gsco <- getGScores("phastCons100way.UCSC.hg19")
gsco
gscores(gsco, gr1)

## End(Not run)

## metadata from a GScores object
name(gsco)
type(gsco)
provider(gsco)
providerVersion(gsco)
organism(gsco)
seqlevelsStyle(gsco)
seqinfo(gsco)
head(seqnames(gsco))
head(seqlengths(gsco))
gscoresTag(gsco)
populations(gsco)
defaultPopulation(gsco)
qfun(gsco)
dqfun(gsco)
citation(gsco)

GenomicScores documentation built on Nov. 8, 2020, 5:21 p.m.