Description Objects from the Class Slots Extends Methods Author(s) Examples
The Features of Interest infrastructure allows to define a set
of features of particular interest to be used/matched against existing
data sets contained in "MSnSet"
. A specific set
of features is stored as an FeaturesOfInterest
object and a
collection of such non-redundant instances (for example for a specific
organism, project, ...) can be collected in a FoICollection
.
Objects can be created with the respective FeaturesOfInterest
and FoICollection
constructors.
FeaturesOfInterest
instances can be generated in two different
ways: the constructor takes either (1) a set of features names (a
character
vector) and a description (character
of length
1 - any subsequent elements are silently ignored) or (2) feature
names, a description and an instance of class
"MSnSet"
. In the latter case, we call such
FeaturesOfInterest
objects traceable, because we can identify
the origin of the feature names and thus their validity. This is done
by inspecting the MSnSet
instance and recording its dimensions,
its name and a unique md5 hash tag (these are stores as part of the
optional objpar
slot). In such cases, the feature names passed
to the FeaturesOfInterest
constructor must also be present in
the MSnSet
; if one or more are not, an error will be thrown. If
your features of interest to be recorded stem for an existing
experiment and have all been observed, it is advised to pass the 3
arguments to the constructor to ensure that the feature names as
valid. Otherwise, only the third argument should be omitted.
FoICollection
instances can be constructed by creating an empty
collection and serial additions of FeaturesOfInterest
using
addFeaturesOfInterest
or by passing a list of
FeaturesOfInterest
instance.
FeaturesOfInterest
class:
description
:Object of class "character"
describing the instance.
objpar
:Optional object of class "list"
providing details about the MSnSet
instance originally used
to create the instance. See details section.
fnames
:Object of class "character"
with the
feature of interest names.
date
:Object of class "character"
with the date
the instance was first generated.
.__classVersion__
: Object of class "Versions"
with the FeaturesOfInterest
class version. Only relevant for
development.
FoICollection
class:
foic
:Object of class "list"
with the
FeaturesOfInterest
.
.__classVersion__
:Object of class "Versions"
with the FoICollection
class version. Only relevant for
development.
Class "Versioned"
, directly.
FeaturesOfInterest
class:
signature(object = "FeaturesOfInterest")
:
returns the description of object
.
signature(object = "FeaturesOfInterest")
: returns
the features of interests.
signature(x = "FeaturesOfInterest")
: returns
the number of features of interest in x
.
signature(object = "FeaturesOfInterest")
:
displays object
.
signature(x = "FeaturesOfInterst", y =
"MSnSet", count = "logical")
: if count
is FALSE
(default), return a logical indicating whether there is at least
one feautre of interest present in x
? Otherwise, returns
the number of such features. Works also with matrices and
data.frames.
Subsetting works like lists. Returns a new
FoICollection
.
Subsetting works like lists. Returns a new
FeatureOfInterest
.
FoICollection
class:
signature(object = "FoICollection")
:
returns the description of object
.
signature(object = "FoICollection")
: returns a
list of FeaturesOfInterest
.
signature(x = "FoICollection")
: returns the
number of FeaturesOfInterest
in the collection.
signature(x = "FoICollection")
: returns the
number of features of interest in each FeaturesOfInterest
in the collection x
.
signature(x =
"FeaturesOfInterest", y = "FoICollection")
: add the
FeaturesOfInterest
instance x
to
FoICollection
y
. If x
is already present, a
message is printed and y
is returned unchanged.
signature(object =
"FoICollection", i = "numeric")
: removes the i
th
FeatureOfInterest
in the collection object
.
signature(object = "FoICollection")
: displays
object
.
Laurent Gatto <lg390@cam.ac.uk>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | library("pRolocdata")
data(tan2009r1)
x <- FeaturesOfInterest(description = "A traceable test set of features of interest",
fnames = featureNames(tan2009r1)[1:10],
object = tan2009r1)
x
description(x)
foi(x)
y <- FeaturesOfInterest(description = "Non-traceable features of interest",
fnames = featureNames(tan2009r1)[111:113])
y
## an illegal FeaturesOfInterest
try(FeaturesOfInterest(description = "Won't work",
fnames = c("A", "Z", featureNames(tan2009r1)),
object = tan2009r1))
FeaturesOfInterest(description = "This work, but not traceable",
fnames = c("A", "Z", featureNames(tan2009r1)))
xx <- FoICollection()
xx
xx <- addFeaturesOfInterest(x, xx)
xx <- addFeaturesOfInterest(y, xx)
names(xx) <- LETTERS[1:2]
xx
## Sub-setting
xx[1]
xx[[1]]
xx[["A"]]
description(xx)
foi(xx)
fnamesIn(x, tan2009r1)
fnamesIn(x, tan2009r1, count = TRUE)
rmFeaturesOfInterest(xx, 1)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.