These classes provide important utility functions in the ShortRead package, but may occasionally be seen by the user and are documented here for that reason.
.SRUtil-class a virtual base class from which all
utility classes are derived. SRError-class created when errors occur in
ShortRead package code. SRWarn-class created when warnings occur in
ShortRead package code SRList-class representing a list (heterogeneous
collection) of objects. The S4Vectors::SimpleList class is a
better choice for a list-like container. SRVector-class representing a vector (homogeneous
collection, i.e., all elements of the same class) of objects. SRError(type, fmt, ...), SRWarn(type, fmt, ...):
character(1) vector describing the type of the
error. type must come from a pre-defined list of types.sprintf-style format string for the
message to be reported with the error.fmt.SRList(...)
SRList. If the length of ... is 1 and the
argument is a list, then the list itself is placed into
SRList.SRVector(..., vclass)
is relationship
with vclass, to be placed in SRVector....
belong. If vclass is missing and length(list(...))
is greater than zero, then vclass is taken to be the class
of the first argument of ....SRVector errors:
... satisfy an is relationship with
vclass.SRError and SRWarn have the following slots defined:
.type:"character" containing
the type of error or warning. .type must come from a
pre-defined list of types, see, e.g.,
ShortRead:::.SRError_types..message:"character"
containing a detailed message describing the error or warning.SRList has the following slot defined:
.srlist:"list" containing the
elements in the list.SRVector extends SRList, with the following additional
slot:
vclass:"character" naming the
type of object all elements of SRVector must be.vclass to access the vclass slot of
SRVector. Internal slots (those starting with . also
have accessors, but these are not exported e.g.,
ShortRead:::.type. SRList has the following methods: signature(x = "SRList"): return the
(integer(1)) length of the SRList.signature(x = "SRList"): return a character
vector of list element names. The length of the returned vector is
the same as the length of x.signature(x = "SRList", value = "character"):
assign value as names for members of x.signature(x = "SRList", i = "ANY", j = "missing"):
subset the list using standard R list subset paradigms.signature(x = "SRList", i = "ANY", j = "missing"):
select element i from the list, using standard R list
selection paradigms.signature(X = "SRList", FUN="ANY"): apply a function to
all elements of X, with additional arguments interpreted
as with lapply.signature(X = "SRList"): apply a function to
all elements of X, simplifying the result if
possible. Additional arguments interpreted as with
sapply.signature(object="SRList"): coerce the SRList
object to a list.signature(object = "SRList"): display an
informative summary of the object content, including the length of
the list represented by object.signature(x = "SRList"): display a more
extensive version of the object, as one might expect from printing
a standard list in R.SRVector inherits all methods from SRList, and has the
following additional methods: signature(object = "SRVector"): display an
informative summary of the object content, e.g., the vector class
(vclass) and length.signature(x = "SRVector"): display a more
extensive version of the object, as one might expect from a
printing a standard R list.getClass(".SRUtil", where=getNamespace("ShortRead"))
ShortRead:::.SRError_types
ShortRead:::.SRWarn_types
detail(SRList(1:5, letters[1:5]))
tryCatch(SRVector(1:5, letters[1:5]),
SRVectorClassDisagreement=function(err) {
cat("caught:", conditionMessage(err), "\n")
})
Run the code above in your browser using DataLab