Description Usage Arguments Value Constructors Methods and functions Creating links between assays Examples
Links between assays within a QFeatures object are handled by an
AssayLinks
object. It is composed by a list of AssayLink
instances.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | ## S4 method for signature 'AssayLink'
show(object)
AssayLink(name, from = NA_character_, fcol = NA_character_, hits = Hits())
AssayLinks(..., names = NULL)
assayLink(x, i)
assayLinks(x, i)
## S4 method for signature 'AssayLink,character,ANY,ANY'
x[i, j, ..., drop = TRUE]
## S4 method for signature 'AssayLinks,list,ANY,ANY'
x[i, j, ..., drop = TRUE]
addAssayLink(object, from, to, varFrom, varTo)
addAssayLinkOneToOne(object, from, to)
|
object |
An |
name |
A mandatory name of the assay(s). |
from |
A |
fcol |
The feature variable of the parent assay used to
generate the current assay (used in
|
hits |
An object of class S4Vectors::Hits matching the features of two assays. |
... |
A set of |
names |
A |
x |
An instance of class QFeatures. |
i |
The index or name of the assay whose |
j |
ignored. |
drop |
ignored. |
to |
A |
varFrom |
A |
varTo |
A |
assayLink
returns an instance of class AssayLink
.
assayLinks
returns an instance of class AssayLinks
.
Object can be created with the AssayLink()
and AssayLinks()
constructors.
assayLink(x, i)
accesses the AssayLink at position i
or with
name i
in the QFeatures object x
.
parentAssayLinks(x, i, recursive = FALSE)
accesses the
parent(s) AssayLinks
or assay with index or name i
.
addAssayLink
takes a parent assay and a child assay contained
in the QFeatures object and creates a link given a matching
feature variable in each assay's rowData
. addAssayLink
also
allows to link an assay from multiple parent assays (see
Examples).
addAssayLinkOneToOne
links two assays contained in the
QFeatures object. The parent assay and the child assay must
have the same size and contain the same rownames (a different
ordering is allowed). The matching is performed based on the row
names of the assays, instead of a supplied variable name in
rowData
. Providing multiple parents is not supported.
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 47 48 49 50 51 52 | ##-----------------------------
## Creating an AssayLink object
##-----------------------------
al1 <- AssayLink(name = "assay1")
al1
##------------------------------
## Creating an AssayLinks object
##------------------------------
AssayLinks(al1)
al2 <- AssayLinks(names = c("Assay1", "Assay2"))
al2
##---------------------------------------
## Adding an AssayLink between two assays
##---------------------------------------
## create a QFeatures object with 2 (identical) assays
## see also '?QFeatures'
se <- SummarizedExperiment(matrix(runif(20), ncol = 2,
dimnames = list(LETTERS[1:10],
letters[1:2])),
rowData = DataFrame(ID = 1:10))
ft <- QFeatures(list(assay1 = se, assay2 = se))
## assay1 and assay2 are not linked
assayLink(ft, "assay2") ## 'from' is NA
assayLink(ft, "assay1") ## 'from' is NA
## Suppose assay2 was generated from assay1 and the feature variable
## 'ID' keeps track of the relationship between the two assays
ftLinked <- addAssayLink(ft, from = "assay1", to = "assay2",
varFrom = "ID", varTo = "ID")
assayLink(ftLinked, "assay2")
## For one-to-one relationships, you can also use
ftLinked <- addAssayLinkOneToOne(ft, from = "assay1", to = "assay2")
assayLink(ftLinked, "assay2")
##----------------------------------------
## Adding an AssayLink between more assays
##----------------------------------------
## An assay can also be linked to multiple parent assays
## Create a QFeatures object with 2 parent assays and 1 child assay
ft <- QFeatures(list(parent1 = se[1:6, ], parent2 = se[4:10, ], child = se))
ft <- addAssayLink(ft, from = c("parent1", "parent2"), to = "child",
varFrom = c("ID", "ID"), varTo = "ID")
assayLink(ft, "child")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.