The epiRomicsS4 class has five slots. Every slot is exposed
through a public getter and setter method so users should never need
to reach into the object with obj@slot or
methods::slot(obj, "slot").
Details
| Slot | Getter | Setter |
annotations | annotations(x) | annotations(x) <- value |
meta | meta(x) | meta(x) <- value |
txdb | txdb(x) | txdb(x) <- value |
organism | organism(object) | organism(object) <- value |
genome | genome(x) | genome(x) <- value |
organism() extends the generic from BiocGenerics and
genome() extends the generic from GenomeInfoDb, so
epiRomicsS4 objects respond to those accessors the same way
other Bioconductor objects do. annotations(), meta(),
and txdb() are generics scoped to epiRomics.
Every setter validates the updated object via
validObject before returning it, so invalid
assignments (for example an empty-string genome) fail fast
with an informative error.
Examples
db <- make_example_database()
# Read every slot through its getter
annotations(db)
#> GRanges object with 24 ranges and 1 metadata column:
#> seqnames ranges strand | type
#> <Rle> <IRanges> <Rle> | <character>
#> [1] chr1 1000-2000 * | hg38_custom_h3k4me1
#> [2] chr1 5000-6000 * | hg38_custom_h3k4me1
#> [3] chr1 10000-11000 * | hg38_custom_h3k4me1
#> [4] chr1 20000-21000 * | hg38_custom_h3k4me1
#> [5] chr1 50000-51000 * | hg38_custom_h3k4me1
#> ... ... ... ... . ...
#> [20] chr1 1000-2000 * | hg38_custom_TF2
#> [21] chr1 20000-21000 * | hg38_custom_TF2
#> [22] chr1 50000-51000 * | hg38_custom_TF2
#> [23] chr1 1000-2000 * | hg38_custom_fantom
#> [24] chr1 50000-51000 * | hg38_custom_fantom
#> -------
#> seqinfo: 1 sequence from an unspecified genome; no seqlengths
meta(db)
#> name type
#> 1 h3k4me1 histone
#> 2 h3k27ac histone
#> 3 h3k27me3 histone
#> 4 h3k4me3 histone
#> 5 h3k36me3 histone
#> 6 TF1 chip
#> 7 TF2 chip
#> 8 fantom functional
txdb(db)
#> [1] "TxDb.Hsapiens.UCSC.hg38.knownGene::TxDb.Hsapiens.UCSC.hg38.knownGene"
organism(db)
#> [1] "org.Hs.eg.db"
genome(db)
#> [1] "hg38"
# Setters return an updated object
db2 <- db
genome(db2) <- "mm10"
organism(db2) <- "org.Mm.eg.db"
genome(db2)
#> [1] "mm10"
organism(db2)
#> [1] "org.Mm.eg.db"