Renew (update) a ShortRead object with new values
Use renew
to update an object defined in ShortRead with
new values. Discover update-able classes and values with
renewable
.
renewable(x, ...) renew(x, ...)
x |
For |
... |
For |
When invoked with no arguments renewable
returns a character
vector naming classes that can be renewed.
When invoked with a character(1)
or an instance of a
ShortRead class, a list of the names and values of the elements
that can be renewed. When x
is a character vector naming a
virtual class, then each element of the returned list is a non-virtual
descendant of that class that can be used in renewal. This is not
fully recursive.
renew
is always invoked with the x
argument being an
instance of a class identified by renewable()
. Remaining
arguments are name-value pairs identifying the components of x
that are to be renewed (updated). The name-value pairs must be
consistent with renewable(x)
. The resulting object is checked
for validity. Multiple components of the object can be updated in a
single call to renew
, allowing comparatively efficient complex
transformations.
renewable()
returns a character vector of renewable classes.
renewable(x)
returns a named list. The names correspond to
renewable classes, and the elements of the list correspond to
renewable components of the class.
renew(x, ...)
returns an object of the same class as
x
, but with components of x
replaced by the named values
of ...
.
Martin Morgan <mtmorgan@fhcrc.org>
## discovery renewable() renewable("AlignedRead") renewable("QualityScore") ## instantiable classes ## example data sp <- SolexaPath(system.file("extdata", package="ShortRead")) ap <- analysisPath(sp) filt <- chromosomeFilter("chr[[:digit:]+].fa") aln <- readAligned(ap, "s_2_export.txt", "SolexaExport", filter=filt) ## renew chromosomes from 'chr1.fa' to 'chr1', etc labels <- sub("\\.fa", "", levels(chromosome(aln))) renew(aln, chromosome=factor(chromosome(aln), labels=labels)) ## multiple changes -- update chromosome, offset position renew(aln, chromosome=factor(chromosome(aln), labels=labels), position=1L+position(aln)) ## oops! invalid instances cannot be constructed try(renew(aln, position=1:10))
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.