Learn R Programming

OutbreakTools (version 0.1-13)

obkSequences-class: Formal class "obkSequences"

Description

The class obkSequences is a formal (S4) class for storing a DNA sequences obtained from a sample during a disease outbreak. Sequences from different loci can be stored, alonside meta-information on the sequences.

An obkSequences object can be constructed from a list of matrices containing each a set of sequences of a given gene/locus. Sequences may be stored as character strings or as DNAbin objects. Information on individuals and collection dates, as well as other meta data for the sequences, can be provided.

Usage

get.nlocus(x, ...)
get.locus(x, ...)

get.nsequences(x, ...) get.sequences(x, ...)

get.dna(x, ...)

## S3 method for class 'obkSequences': get.nsequences(x, what=c("total","bylocus"), ...)

## S3 method for class 'obkSequences': get.sequences(x, \dots)

## S3 method for class 'obkSequences': get.dna(x, locus=NULL, id=NULL, \dots)

## S3 method for class 'obkSequences': show(object)

Arguments

x,object
an obkSequences object.
what
a character string indicating whether numbers of sequences should be provided in total, or per locus.
locus
an indication of the locus, either by its name, or using integers or logicals matching get.locus.
id
an indication of the sequences, either by their names, or using integers or logicals matching get.sequences.
...
arguments passed to other methods.

Details

obkSequences are meant to store DNA sequences for which patient/individual IDs and collection dates are known. This information can be provided using the arguments individualID and date, or through the labels of the sequences. In that case, the expected format is: [sequenceID][sep][individualID][sep][date] By default, the separator is "_", so a valid name would look like: "seq123_John Doe_2013/06/23"

Examples

Run this code
## construct an obkSequences object ##

data(ToyOutbreakRaw)
attach(ToyOutbreakRaw)
x <- new("obkSequences", dna, individualID=dna.info$individualID,
    date=dna.info$date)
x
detach(ToyOutbreakRaw)

## Load ToyOutbreak, a simulated outbreak stored in a obkData object  ##
data(ToyOutbreak)
x <- ToyOutbreak

## show obkObject
##summary(x) # generates an error

## access raw content
get.dna(x)

## access data by locus
get.nlocus(x)
get.locus(x)
get.dna(x, locus=1)
get.dna(x, locus="gene2")
get.dna(x, locus=1:2)
get.nsequences(x)
get.nsequences(x, "bylocus")

get.sequences(x)

## access data by sequence ID
get.dna(x, id=c("10"))
get.dna(x, id=c("100","354"))
get.dna(x, id=c(100:105))

Run the code above in your browser using DataLab