Description Usage Arguments Details Value Methods and Functions Author(s) See Also Examples
This function combines values in the assays
slot for replicates
e.g. of counts of the same biological sample sequenced on different
lanes.
1 2 3 4 5 |
x |
The |
by |
Either a character of length 1 specifying the column in
|
collapse |
A character of length 1 to be used as a separator for values in
columns of |
seed |
The seed for the random number generator. |
x |
The BAM file name or a |
This function combines values from replicates in a
SummarizedExperiment identified by the argument by
. By default,
for each row, the values of replicates are summed (assuming count
data). The argument FUN
however allows to apply a different
aggregation function. Also, by default, the same aggregation function
is applied to all assays in x
. Different aggregation functions
can be applied by specifying several functions, where the number of
specified functions has to match length(assays(x))
; functions
are applied in sequential order, i.e. the first function is applied to
the first assay (assays(x)[1]
), the second to the second and
so on.
In addition to the combination of assay data, also the colData
is reduced to fit the number of unique replicates
(length(unique(by))
). Values in columns with non-unique values for the
same replicate are collapsed using the characted defined by
collapse
as separator between the unique values. The original
colnames of the object are collapsed in a column added to the
colData
named "collapsed"
.
A SummarizedExperiment0
or RangedSummarizedExperiment
.
the function samples the specified fraction of reads from the Bam
file. The returned object is a list of lists. For more details
please see the help of the scanBam
function.
Johannes Rainer
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | nrows <- 200
ncols <- 6
counts <- matrix(runif(nrows * ncols, 1, 1e4), nrows)
colData <- DataFrame(Treatment=rep(c("ChIP", "Input"), 3),
name=c("ChIP.a", "Input.a", "ChIP.b",
"Input.b", "ChIP.a", "Input.a"),
row.names=LETTERS[1:6])
se0 <- SummarizedExperiment(assays=SimpleList(counts=counts),
colData=colData)
## sum assay values of replicates identified by column "name"
## in the colData.
ser <- reduce(se0, by="name")
colData(ser)
colnames(ser)
## alternatively use a vector of length=length(colnames(se0))
set <- reduce(se0, by=c(1, 2, 1, 2, 3, 4))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.