Rprimer-classes: S4 classes for representation of different Rprimer objects

Rprimer-classesR Documentation

S4 classes for representation of different Rprimer objects

Description

The rprimer package contains five different S4 classes. Each class is used as input or output for the different functions within the oligo and assay design workflow:

  • RprimerProfile: output from consensusProfile(), input for oligos().

  • RprimerOligo: output from oligos(), input for assays() and checkMatch().

  • RprimerAssay: output from assays(), input for checkMatch().

  • RprimerMatchOligo: output from checkMatch().

  • RprimerMatchAssay: output from checkMatch().

These classes extends the DFrame class from S4vectors (Pages et al., 2020), without any additional slots, but with some additional checks for validity.

Usage

RprimerProfile(...)

RprimerOligo(...)

RprimerAssay(...)

RprimerMatchOligo(...)

RprimerMatchAssay(...)

Arguments

...

A data frame or list to be converted into an Rprimer-object.

Value

An Rprimer-object if validation succeeds, an error message otherwise.

Coercion

Each class can be converted to a traditional data frame, by using either as() or as.data.frame().

Moreover, as() can also be used for converting oligo sequences within an RprimerOligo or RprimerAssay object into a Biostrings::DNAStringSet object (Pages et al., 2020). Note that all oligo sequences will be written in the same direction as the input alignment that was used to generate the oligos.

References

Pages, H., Lawrence, M., and Aboyoun, R. (2020). S4Vectors: Foundation of vector-like and list-like containers in Bioconductor. R package version 0.28.0.

Pages, H., Aboyoun, P., Gentleman R., and DebRoy S. (2020). Biostrings: Efficient manipulation of biological strings. R package version 2.57.2.

See Also

consensusProfile, oligos, assays, checkMatch

Examples

## Constructors

data("exampleRprimerProfile")
x <- as.data.frame(exampleRprimerProfile)
RprimerProfile(x)

data("exampleRprimerOligo")
x <- as.data.frame(exampleRprimerOligo)
RprimerOligo(x)

data("exampleRprimerAssay")
x <- as.data.frame(exampleRprimerAssay)
RprimerAssay(x)

data("exampleRprimerMatchOligo")
x <- as.data.frame(exampleRprimerMatchOligo)
RprimerMatchOligo(x)

data("exampleRprimerMatchAssay")
x <- as.data.frame(exampleRprimerMatchAssay)
RprimerMatchAssay(x)

## Coercion methods for RprimerOligo and RprimerAssay objects

## Convert an RprimerOligo object to a DNAStringSet
data("exampleRprimerOligo")

## Pick rows to convert
x <- exampleRprimerOligo[1:2, ]
as(x, "DNAStringSet")

## Convert an RprimerAssay object to a DNAStringSet
data("exampleRprimerAssay")

## Pick rows to convert
x <- exampleRprimerAssay[1:2, ]
as(x, "DNAStringSet")

sofpn/rprimer documentation built on Aug. 19, 2024, 4:19 p.m.